vim_buffer
Get buffer contents with line numbers
Let an agent work inside the Neovim you already have open — your buffers, marks, registers, macros and quickfix list — instead of editing files behind the editor's back.
LABSCO SUMMARY
Because every call goes through a running Neovim over its socket, there is one editor state rather than two: the agent's change appears where you are looking, and vim_status hands back your cursor position, mode, marks and registers so it can start from where you actually are. The decision worth making before you connect it is ALLOW_SHELL_COMMANDS, which is the difference between vim_command running editor commands and vim_command running your shell.
A client for a running Neovim instance: 19 tools that drive the editor over its socket rather than reading and writing files directly.
A running Neovim whose socket the server can reach at NVIM_SOCKET_PATH. Shell commands through vim_command stay unavailable until ALLOW_SHELL_COMMANDS is set. MIT-licensed.
One command — npx -y mcp-neovim-server
USE CASES
Find every occurrence into the quickfix list, run the substitution with the case and confirm options you want, and write the buffer. All of it happens in the editor you are watching rather than to files underneath it.
Read the editor's state — cursor position, mode, marks, registers — then the buffer with line numbers, and edit from the line that state pointed at. The agent starts from where you actually are instead of from the top of the file.
Record the edit once as a macro, then replay it with a count. Registers and visual selections are addressable too, so the recorded sequence can operate on a selection rather than on whatever the cursor happens to be near.
Fold the sections that are not in question, drop named marks on the ones that are, and use the jump list to get back to where you came from after following a definition.
Open the other file into a buffer, split the window or put it in a tab, and switch between them by name or number — the same layout you would have set up by hand, done from the conversation.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
vim_bufferGet buffer contents with line numbers
vim_buffer_saveSave current buffer or save to specific filename
vim_buffer_switchSwitch between buffers by name or number
vim_commandExecute Vim commands with optional shell command support
vim_editEdit buffer content using insert, replace, or replaceAll modes
vim_file_openOpen files into new buffers
vim_foldManage code folding: create, open, close, and toggle folds
vim_grepProject-wide search using vimgrep with quickfix list
vim_healthCheck Neovim connection health
vim_jumpNavigate Neovim jump list: go back, forward, or list jumps
vim_macroRecord, stop, and play Neovim macros
vim_markSet named marks at specific positions in the buffer
vim_registerManage Neovim register contents
vim_searchSearch within current buffer with regex support and options
vim_search_replaceFind and replace with global, case-insensitive, and confirm options
vim_statusGet comprehensive Neovim status including cursor position, mode, marks, and registers
vim_tabManage Neovim tabs: create, close, and navigate between tabs
vim_visualCreate visual mode selections in the buffer
vim_windowManage Neovim windows: split, close, and navigate between windows
BEFORE YOU INSTALL
19 tools when we connected.
CONTEXT COST
Rated by the size of the 19 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
Add the block to your client, or run the command directly.
{
"mcpServers": {
"MCP Neovim Server": {
"command": "npx",
"args": [
"-y",
"mcp-neovim-server"
],
"env": {
"ALLOW_SHELL_COMMANDS": "true",
"NVIM_SOCKET_PATH": "/tmp/nvim"
}
}
}
}npx -y mcp-neovim-server