by bigcodegen
Control Neovim via Model Context Protocol using the official neovim/node-client library, delivering lightweight AI‑assisted code and text editing capabilities.
Mcp Neovim Server enables a Model Context Protocol client (e.g., Claude Desktop) to interact directly with a running Neovim instance. It leverages Neovim's native commands and workflows, exposing them as MCP tools so that AI models can read, edit, search, and manage buffers, windows, tabs, and more.
nvim --listen /tmp/nvim
.vim_buffer
, vim_edit
, vim_search
, etc.) to issue commands and receive responses.!
prefix).Q: Does the server work with regular Vim?
A: No, it requires Neovim because it uses the neovim/node-client
API.
Q: Are shell commands safe?
A: Shell execution is disabled by default. Set ALLOW_SHELL_COMMANDS=true
in the environment to enable, understanding the security implications.
Q: What if my Neovim configuration has many plugins? A: The server works best with standard setups; complex plugin interactions may cause unexpected behavior.
Q: How is the server installed?
A: Preferred method is the DXT package (drag‑and‑drop into Claude Desktop). Manual installation can be done via npm using npx
as shown in the configuration example.
Q: How do I change the socket path?
A: Set NVIM_SOCKET_PATH
to the desired Unix socket file; defaults to /tmp/nvim
.
Connect Claude Desktop (or any Model Context Protocol client) to Neovim using MCP and the official neovim/node-client JavaScript library. This server leverages Vim's native text editing commands and workflows, which Claude already understands, to create a lightweight code or general purpose AI text assistance layer.
Version 0.5.3 - Now with a DXT package!
--listen /tmp/nvim
, when starting nvimnvim://session
: Current neovim text editor sessionnvim://buffers
: List of all open buffers in the current Neovim session with metadata including modified status, syntax, and window IDsfilename
(string, optional) - Get specific buffer by filenamecommand
(string)nvim.replaceTermcodes
. Multiple commands work with newlines!
prefix when ALLOW_SHELL_COMMANDS=true
'nvim:errmsg'
contents are returnedstartLine
(number), mode
("insert"
| "replace"
| "replaceAll"
), lines
(string)command
(string: "split", "vsplit", "only", "close", "wincmd h/j/k/l")mark
(string: a-z), line
(number), column
(number)register
(string: a-z or "), content
(string)startLine
(number), startColumn
(number), endLine
(number), endColumn
(number)identifier
(string | number) - Buffer name or numberfilename
(string, optional) - Save to specific filefilename
(string) - File to openpattern
(string), ignoreCase
(boolean, optional), wholeWord
(boolean, optional)pattern
(string), replacement
(string), global
(boolean, optional), ignoreCase
(boolean, optional), confirm
(boolean, optional)pattern
(string), filePattern
(string, optional) - File pattern to searchaction
("record" | "stop" | "play"), register
(string, a-z), count
(number, optional)action
("new" | "close" | "next" | "prev" | "first" | "last" | "list"), filename
(string, optional)action
("create" | "open" | "close" | "toggle" | "openall" | "closeall" | "delete"), startLine
/endLine
(numbers, for create)direction
("back" | "forward" | "list")Using this comprehensive set of 19 tools, Claude can peer into your neovim session, navigate buffers, perform searches, make edits, record macros, manage tabs and folds, and handle your complete development workflow with standard Neovim features.
The server implements comprehensive error handling with custom error classes and consistent error responses:
New in v0.5.2: All tools now include robust try-catch error handling that returns meaningful error messages in proper MCP format. Features include connection health monitoring, graceful error propagation, and actionable error messages to help diagnose issues.
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..dxt
file from ReleasesAdd this 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"
}
}
}
}
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "Mcp Neovim Server": { "command": "npx", "args": [ "-y", "mcp-neovim-server" ], "env": { "ALLOW_SHELL_COMMANDS": "true", "NVIM_SOCKET_PATH": "/tmp/nvim" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.