Current VIM text editor buffer with line numbers shown
Send a command to VIM for navigation, spot editing, and line deletion
Get the status of the VIM editor including cursor position, mode, filename, visual selection, window layout, current tab, marks, registers, and working directory
Edit lines using insert, replace, or replaceAll in the VIM editor
Manipulate Neovim windows (split, vsplit, close, navigate)
Set a mark at a specific position
Set content of a register
Make a visual selection
Connect Claude Desktop or any Model Context Protocol client to Neovim using the official neovim/node-client JavaScript library. This server leverages Vim's native text editing commands and workflows to create a lightweight code or general purpose AI text assistance layer. It allows AI assistants to view your current buffers, get cursor location and file information, run vim commands, and make edits using insert or replacement.
The Neovim Control MCP server enables AI assistants to interact with your Neovim text editor sessions. It creates a bridge between Model Context Protocol clients (like Claude Desktop) and Neovim, allowing the AI to view and edit your code or text files using Vim's native commands.
To use the Neovim Control MCP server, you need to:
nvim --listen /tmp/nvim
)Add this configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"MCP Neovim Server": {
"command": "npx",
"args": [
"-y",
"mcp-neovim-server"
],
"env": {
"ALLOW_SHELL_COMMANDS": "true",
"NVIM_SOCKET_PATH": "/tmp/nvim"
}
}
}
}
You can customize the behavior of the Neovim Control MCP server using these environment variables:
ALLOW_SHELL_COMMANDS
: Set to 'true' to enable shell command execution (e.g., !ls
). Defaults to false for security.NVIM_SOCKET_PATH
: Set to the path of your Neovim socket. Defaults to '/tmp/nvim' if not specified.Once connected, the AI assistant can:
The server exposes resources like nvim://session
(current Neovim text editor session) and nvim://buffers
(list of all open buffers with metadata).
By default, shell command execution is disabled for security. Only enable ALLOW_SHELL_COMMANDS
if you trust the AI assistant and understand the potential risks of allowing it to execute shell commands through Vim.