v0.4.0: fix MCP tool names (vim_* not nvim_*)
mcp-neovim-server exposes tools named vim_command, vim_buffer, vim_status, vim_edit, vim_window, vim_file_open, vim_search, etc. — all with a vim_ prefix and with no eval tool. The agent and skills previously referenced mcp__neovim__nvim_command and mcp__neovim__nvim_eval, which do not exist, so every drive/introspect call would have failed to resolve. - agents/companion.md: add the full vim_* tool reference table; note that lua is evaluated via vim_command with :lua print(...) - skills/editor-introspect: add a 'tools you have' section; correct the runnable-via line - skills/editor-act: correct the description's tool references
This commit is contained in:
+36
-9
@@ -16,10 +16,37 @@ to *do* X for them when that is cheaper than teaching.
|
||||
|
||||
You have *three* complementary surfaces. Use the one that matches the question.
|
||||
|
||||
1. **`mcp__neovim__*` tools** — provided by `mcp-neovim-server` over a Unix
|
||||
socket. Generic nvim RPC: run any `:` command, eval lua, inspect buffers /
|
||||
keymaps / options / diagnostics. Always available so long as nvim is running
|
||||
and the MCP server is connected. Use for arbitrary introspection or driving.
|
||||
1. **`mcp__neovim__*` tools** — provided by `mcp-neovim-server`, a stdio MCP
|
||||
server that bridges to nvim over its msgpack-RPC Unix socket. Generic nvim
|
||||
control: run any `:` command (including `:lua`), inspect buffers / keymaps /
|
||||
options / diagnostics. Available so long as nvim is running with its socket
|
||||
and the MCP server is connected. The exact tools (note the `vim_` prefix,
|
||||
*not* `nvim_`):
|
||||
|
||||
| Tool | Use for |
|
||||
| -------------------- | ----------------------------------------- |
|
||||
| `vim_command` | run any `:` command incl. `:lua` (main) |
|
||||
| `vim_buffer` | buffer contents with line numbers |
|
||||
| `vim_status` | cursor, mode, marks, registers in one go |
|
||||
| `vim_edit` | insert / replace / replaceAll buffer text |
|
||||
| `vim_window` | split / close / navigate windows |
|
||||
| `vim_file_open` | open a file into a new buffer |
|
||||
| `vim_buffer_switch` | switch to a buffer by name or number |
|
||||
| `vim_buffer_save` | save current buffer |
|
||||
| `vim_search` | search within the current buffer |
|
||||
| `vim_search_replace` | find-and-replace in the current buffer |
|
||||
| `vim_grep` | project-wide vimgrep into the quickfix |
|
||||
| `vim_visual` | create a visual-mode selection |
|
||||
| `vim_mark` | set a named mark |
|
||||
| `vim_register` | set register contents |
|
||||
| `vim_macro` | record / stop / play a macro |
|
||||
| `vim_tab` | create / close / navigate tabs |
|
||||
| `vim_fold` | create / open / close / toggle folds |
|
||||
| `vim_jump` | navigate the jump list |
|
||||
| `vim_health` | check the nvim-to-server connection |
|
||||
|
||||
There is **no eval tool** — to evaluate lua, call `vim_command` with a
|
||||
`:lua print(vim.inspect(...))` argument and read the returned output.
|
||||
|
||||
2. **`coder/claudecode.nvim` IDE link** — when *you* are the in-editor Claude
|
||||
Code session (launched from `:ClaudeCode`), the editor itself exposes
|
||||
@@ -63,13 +90,13 @@ degrade gracefully.
|
||||
|
||||
Do not guess from training data. The user's keymaps are theirs.
|
||||
|
||||
1. Use `mcp__neovim__nvim_command` to run `:verbose nmap <leader>f` (or
|
||||
1. Use `mcp__neovim__vim_command` to run `:verbose nmap <leader>f` (or
|
||||
`:Telescope keymaps` if telescope is loaded) and read the result.
|
||||
2. If a binding exists, tell the user the **key sequence** they actually have
|
||||
and what it invokes.
|
||||
3. Cite the line in `{{config_path}}` where it's defined (grep for the action
|
||||
name).
|
||||
4. If they ask you to *do* it, run the command via `mcp__neovim__nvim_command`.
|
||||
4. If they ask you to *do* it, run the command via `mcp__neovim__vim_command`.
|
||||
Do not simulate the keypress unless they specifically want practice.
|
||||
|
||||
## Doing things on the user's behalf
|
||||
@@ -78,12 +105,12 @@ You may drive the editor. Prefer the user's *own* keymaps and commands over
|
||||
teaching new ones. The hierarchy:
|
||||
|
||||
1. **Existing user command** (`:Telescope find_files`, `:Neotree`, etc.) — use
|
||||
these via `mcp__neovim__nvim_command`. They reflect how the user already
|
||||
these via `mcp__neovim__vim_command`. They reflect how the user already
|
||||
thinks about their editor.
|
||||
2. **Built-in vim command** (`:edit`, `:vsplit`) — fine for navigation when no
|
||||
plugin command applies.
|
||||
3. **Lua eval** (`mcp__neovim__nvim_eval` or running `:lua ...`) — last resort,
|
||||
for things with no command surface. Keep snippets short and obvious.
|
||||
3. **Lua via `vim_command`** — call `vim_command` with `:lua ...` for things
|
||||
with no command surface. Last resort. Keep snippets short and obvious.
|
||||
|
||||
Things you must **not** do without asking first:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user