home / mcp / neovim mcp server

Neovim MCP Server

Provides real-time buffer context and buffer operations by exposing Neovim buffers as MCP resources for Claude Code.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

Prerequisites you must have installed before configuring the MCP server:

  • Node.js 16+
  • Neovim with RPC support
  • Claude Code with MCP support

Option 1 — CLI setup (Recommended)

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.

Option 2 — Manual configuration

{
  "mcpServers": {
    "nvim": {
      "command": "npx",
      "args": ["nvim-mcp-server"]
    }
  }
}

Verify setup

After configuring, verify that Claude Code recognizes the MCP server by listing available MCP servers or checking the status in Claude Code.

Additional setup notes

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.

Troubleshooting

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.

Development

node index.js
```

The server can be run for manual testing using standard Node.js invocation.

Available tools

list_nvim_buffers

List all open buffers across Neovim instances running in the current directory.

get_current_buffer

Retrieve the currently active Neovim buffer.

get_buffer_content

Get the content of a specific Neovim buffer by its path.

update_buffer

Update the content of a Neovim buffer in memory so changes appear in Neovim immediately.

open_file

Open a file in Neovim to start editing it.

reload_buffer

Reload a buffer from disk, discarding in-memory changes.

reload_all_buffers

Reload all buffers that have changed on disk.