coder / coder/claudecode.nvim

[FEATURE] Define Custom Tools

Open
#149 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
3.1k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

## Feature Description

I'd like to be able to define custom MCP tools in the plugin's config.

## Use Case

Users would be able to define any function that can be run by Claude within neovim. The use cases are basically infinite. Anything you can imagine as a Lua function could be run by Claude.

## Proposed Solution

I Imagine the function definition to look somewhat like this:

```lua
{
"coder/claudecode.nvim",
dependencies = { "folke/snacks.nvim" },
-- ...
custom_tools = {
{
"tool_name",
title = "The tool's title",
desc = "Does something",
input_schema = {
-- ...
},
output_schema = {
-- ...
},
annotations = {
-- ...
},
callback = function(arg1, arg2)
-- ...
end
},
},
}
```

## Alternatives Considered

- Letting claude execute arbitrary vim commands. That's not very Neovimy and more risky though. And this feature could still be implemented using the proposed solution.
- Making my own plugin. Though the power of claudecode.nvim is its WebSocket based integration, which I'd have to replicate (or I'd have to use a local http transport).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.