nvim-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NVIM_SOCKET_PATH | No | Path to the Neovim socket to skip discovery entirely |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| connectA | Connect to a running Neovim instance over its Unix socket or TCP address. Call this before any other tool if the agent is not yet connected. Connection is persistent for the session; you only need to call it once unless you want to switch instances. Called with no arguments: auto-connects when exactly one instance is running; returns a list of instances when multiple are found. Optional selection (provide at most one):
Returns {connected, cwd, file} on success, or {error} with details on failure (e.g. no instances found, connection timeout, bad index). |
| send_commandA | Run one or more Vim ex commands in Neovim. This is a mutation tool — commands can modify buffers, files on disk, windows, and editor state. command: a single command string or a list of strings, without the leading ':'. E.g. "w", "e src/main.py", "42", "wincmd v", "lua vim.print(...)", or ["wincmd p", "e file.py", "wincmd p"]. Use this for editor operations that don't have a dedicated tool
(e.g. saving, opening files, splitting windows, setting options).
Use Returns {output} with the command's captured output, or {error} if the command failed. When given a list, returns a list of results in the same order; execution stops on the first error. |
| send_keysA | Send raw keystrokes to Neovim as if typed by the user. This is a mutation tool — keystrokes can modify buffers, change mode, and trigger editor actions. keys: a string of Vim keystrokes. Esc is prepended automatically, so input always begins in normal mode. Multi-mode sequences must be sent in a single call (e.g. "17GVG", not "17GV" then "G"). Use Vim notation for special keys (e.g. "", "v", ""). Use this for normal-mode motions, visual selections, or operator
sequences. Use Returns {sent} confirming the keys that were dispatched. Keystrokes are fire-and-forget; errors from the resulting Vim actions are not captured in the return value. |
| get_all_diagnosticsA | Get LSP diagnostics from all open buffers in Neovim. Read-only. Use this for a project-wide overview of errors and warnings. Use
Returns a list of {file, line, col, severity, message, source}. severity is one of "error", "warning", "info", "hint". Returns an empty list when there are no diagnostics. Results depend on which LSP servers are attached and which buffers are loaded in Neovim. |
| get_buf_diagnosticsA | Get LSP diagnostics for a single Neovim buffer. Read-only. file: path relative to Neovim's cwd (as shown in Use this when you need diagnostics for one specific file. Use
Returns a list of {file, line, col, severity, message, source}. severity is one of "error", "warning", "info", "hint". Returns an empty list when the buffer has no diagnostics. |
| find_and_replace_bufA | Find and replace text in a Neovim buffer. The edit happens in-memory and is fully undoable — nothing is written to disk until the user saves. file: path relative to Neovim's cwd (as shown in Creates the buffer if it doesn't already exist. Use this for targeted
edits. Use Returns {start_line, lines_removed, lines_added, total_lines} on success, or {error} with a message on failure. |
| write_full_bufA | Replace the entire content of a Neovim buffer. The edit happens in-memory and is fully undoable — nothing is written to disk until the user saves. file: path relative to Neovim's cwd (as shown in Creates the buffer if it doesn't already exist. Use this when you
need to rewrite the whole file. Use Returns {total_lines} with the new line count. |
| read_full_bufA | Read the full content of a Neovim buffer. Read-only; reads from Neovim's in-memory buffer, which may differ from the file on disk if there are unsaved changes. file: path relative to Neovim's cwd (as shown in Use this when you need to see the entire file. Use Returns {lines, total_lines}. lines is a list of strings, each prefixed with its 1-based line number (e.g. "1: first line"). |
| read_buf_rangeA | Read a specific line range from a Neovim buffer. Read-only; reads from Neovim's in-memory buffer, which may differ from the file on disk if there are unsaved changes. file: path relative to Neovim's cwd (as shown in Use this when you only need a section of a file. Use Returns {lines, total_lines}. lines is a list of strings, each prefixed with its 1-based line number (e.g. "10: some code"). |
| get_stateA | Full snapshot of the current Neovim session. Read-only — does not modify any editor state. Use Returns: mode (normal/insert/visual/etc.), cwd, buffers (relative paths of all listed buffers), modified_buffers, current_tab, tab_count. windows — list of visible windows (current tab only). The active window is always first, the alternate window (previous) is second. Each window entry contains: file (path relative to cwd), filetype, total_lines, modified, buftype ("file" for normal buffers, "terminal", etc.), line, col, indent: {expandtab, shiftwidth, tabstop}. Optional per-window fields (present when applicable):
|
| get_state_briefA | Lightweight snapshot of the Neovim session for quick orientation. Read-only — does not modify any editor state. Use this at the start of each turn to see what the user is working
on. Use Returns: mode (normal/insert/visual/etc.), cwd, buffers (relative paths of all listed buffers), modified_buffers, and active_window: {file, filetype, total_lines, modified, buftype, line, col, context}. context is a short list of numbered lines around the cursor. If an alternate window exists, also returns alternate_window with the same fields. |
| highlight_rangeA | Add a colored line highlight to a Neovim buffer. This is a visual annotation only — it does not modify buffer content and is not persisted to disk. Highlights stack; calling this multiple times adds more highlights without removing previous ones. file: path relative to Neovim's cwd (as shown in Use this for a single highlight. Use Returns {highlighted} with the number of lines highlighted. |
| highlight_rangesA | Add colored line highlights to one or more Neovim buffers in a single call. This is a visual annotation only — it does not modify buffer content and is not persisted to disk. Highlights stack; calling this adds more highlights without removing previous ones. highlights: a list of dicts. Each dict requires:
Use this when you need to highlight several ranges at once (possibly
across different files). Use Returns a list of {highlighted} results in the same order as the input. Raises an error if any item is missing required keys. Example: [{"file": "foo.py", "start_line": 1, "end_line": 3, "color": "#5f3a3a"}, {"file": "foo.py", "start_line": 10, "end_line": 12}] |
| clear_highlightsA | Remove all MCP highlights from a Neovim buffer. Only removes
highlights added by file: path relative to Neovim's cwd (as shown in Use this to clean up highlights after an annotation workflow.
Use |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulburgess1357/nvim-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server