home / mcp / neovim mcp server
Provides real-time buffer context and buffer operations by exposing Neovim buffers as MCP resources for Claude Code.
Configuration
View docs{
"mcpServers": {
"laktek-nvim-mcp-server": {
"command": "npx",
"args": [
"nvim-mcp-server"
]
}
}
}This MCP server links Neovim buffers with Claude Code, giving you buffer-aware context and real-time edits. It exposes your Neovim buffers as resources and enables buffer operations from Claude Code without manual file writes, so you can refactor, inspect, and update buffers directly from your editor.
Install and start the MCP server, then use Claude Code to interact with Neovim buffers. The server exposes the currently active buffer and a list of open buffers for context, and it provides tools to read, update, open, and reload buffers directly from Claude Code. You can perform common edits and see changes appear instantly in Neovim.
Prerequisites you must have installed before configuring the MCP server:
claude mcp add --transport stdio nvim -- npx nvim-mcp-server
```
This configures Claude Code to start the Neovim MCP server over stdio and records the configuration for automatic use.{
"mcpServers": {
"nvim": {
"command": "npx",
"args": ["nvim-mcp-server"]
}
}
}After configuring, verify that Claude Code recognizes the MCP server by listing available MCP servers or checking the status in Claude Code.
Development and testing tips: you can run the server directly for testing with standard Node.js commands, as shown in the development steps. This can help you validate that the Neovim socket discovery and buffer RPC work as expected.
If you encounter issues, verify the following: you are in the same directory as your Neovim instance, Neovim is running, and the nvim socket exists in your temporary directory. Ensure the target buffer path matches exactly when performing updates, and confirm Claude Code has permission to access the Neovim socket.
node index.js
```
The server can be run for manual testing using standard Node.js invocation.List all open buffers across Neovim instances running in the current directory.
Retrieve the currently active Neovim buffer.
Get the content of a specific Neovim buffer by its path.
Update the content of a Neovim buffer in memory so changes appear in Neovim immediately.
Open a file in Neovim to start editing it.
Reload a buffer from disk, discarding in-memory changes.
Reload all buffers that have changed on disk.