home / mcp / neovim mcp server
Control Neovim using Model Context Protocol (MCP) and the official neovim/node-client JavaScript library
Configuration
View docs{
"mcpServers": {
"bigcodegen-mcp-neovim-server": {
"command": "npx",
"args": [
"-y",
"mcp-neovim-server"
],
"env": {
"NVIM_SOCKET_PATH": "/tmp/nvim",
"ALLOW_SHELL_COMMANDS": "true"
}
}
}
}You connect Claude Desktop to Neovim using the MCP Neovim Server to leverage Neovim’s editing capabilities with AI assistance. This server exposes Neovim features like buffer management, cursor info, and command execution through MCP, enabling smooth, context-aware interactions with your editor.
You can use the MCP Neovim Server to peek into your Neovim session, switch buffers, inspect cursor state, and perform edits or searches directly from Claude Desktop or any Model Context Protocol client. Typical workflows include opening files, navigating buffers, creating or adjusting selections, running vim commands, and performing project-wide searches. Use the available MCP tools to edit buffers, manage windows and tabs, run macros, and perform sophisticated search and replace operations.
Prerequisites: you need Node.js and npm or npx available on your system. Ensure Neovim is running with a socket exposed, for example by starting Neovim with --listen /tmp/nvim.
Option 1: DXT Package (Recommended) install steps - Download the latest .dxt file from the available releases - Drag the file to Claude Desktop and follow any prompts to install the MCP Neovim Server package
Option 2: Manual Installation
- Add the following to your claude_desktop_config.json to run the MCP Neovim Server via npx{
"mcpServers": {
"MCP Neovim Server": {
"command": "npx",
"args": [
"-y",
"mcp-neovim-server"
],
"env": {
"ALLOW_SHELL_COMMANDS": "true",
"NVIM_SOCKET_PATH": "/tmp/nvim"
}
}
}
}Shell commands are disabled by default for security. If you explicitly enable them, you can execute shell commands via the editor commands using the MCP tools that support shell execution when ALLOW_SHELL_COMMANDS is set to true.
Get buffer contents with line numbers and optional filename; returns numbered lines for the current buffer or a specific one by filename.
Send a Vim command to Neovim to navigate, edit, or delete lines. Supports shell commands with a leading ! when enabled.
Return comprehensive Neovim status including cursor, mode, filename, selections, window layout, registers, marks, and LSP/plugin info.
Edit buffer lines in insert, replace, or replaceAll modes. Specify startLine, mode, and the text content to apply.
Manipulate Neovim windows: split, vsplit, close, and navigate between windows.
Set named marks at specific line and column positions for quick navigation.
Set the content of a register to store and reuse text or commands.
Create and manipulate visual mode selections by coordinates.
Switch between buffers by name or number; open specific buffers as needed.
Save current buffer or write to a specified filename.
Open files into new buffers for editing.
Search within the current buffer with regex support, including ignoreCase and wholeWord options.
Find and replace with options for global replacement, ignoreCase, and optional confirmation.
Perform a project-wide search with vimgrep and populate the quickfix list.
Record, stop, and play Vim macros to automate repetitive edits.
Manage tabs: create new, close, navigate, and list tabs.
Control code folding to create, open, close, toggle, or delete folds.
Navigate the jump list to move backward or forward through positions.
Check Neovim connection health and socket status.