[FEATURE] Define Custom Tools
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 plugin 如何读取其配置,以及基于 WebSocket 的 Claude 集成如何公开工具。定义受支持的 custom_tools 结构,包括 schema 和 callback,并验证 Claude 能否在 Neovim 中调用已配置的 Lua 函数。
由索引模型根据 Issue 内容生成。
描述
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:
{
"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).
- 主要语言
- Lua
- 星标
- 3.1k
- 派生
- 220
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/claudecode.nvim 的其他 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
coder/claudecode.nvim#321 ·
-
[BUG] ClaudeCodeAdd fails on paths with spaces可能已有人在做 @7A1T 于 53 天前认领。 未关闭bug needs-triage
难度 1/5 1 小时以内 新手友好度 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
coder/claudecode.nvim#313 ·
-
needs-triage
难度 5/5 一周以上 新手友好度 20/100
coder/claudecode.nvim#319 · 6 个 reaction ·
-
[BUG] 框选文本一直抱错误信息可能已有人在做 @DukeLog 于 41 天前认领。 未关闭bug needs-triage
难度 4/5 3-5 天 新手友好度 35/100
coder/claudecode.nvim#316 · 1 条评论 ·
查看 coder/claudecode.nvim 的全部 Issue