nvim
MCP server for exposing Neovim buffers to AI agents like Claude Code
claude mcp add --transport stdio laktek-nvim-mcp-server npx nvim-mcp-server
How to use
This MCP server exposes Neovim buffers and makes them available to Claude Code as resources, enabling context-aware editing and real-time buffer updates. It discovers Neovim instances running in the current directory and exposes two core resources: nvim://current-buffer, which contains the active buffer with its path and content, and nvim://open-buffers, which lists all open buffers with metadata. In addition, a set of Cloud-based tools lets Claude interact with Neovim directly, such as listing buffers, fetching and updating buffer content, opening files, and reloading buffers. Once configured, Claude can reference these resources in prompts and invoke the provided tools to inspect or modify buffers without leaving the editor.
To use the server, install and start Claude Code with the MCP server configured via npx nvim-mcp-server. Claude will automatically discover the server and expose its resources to your prompts. You can also manually verify configuration with claude mcp list or by using the /mcp command inside Claude Code to check server status. The tools enable concrete workflows like refactoring the current file, updating a specific buffer, or creating and opening new files directly in Neovim, all through the Claude interface.
How to install
Prerequisites:
- Node.js 16+ installed on your machine
- Neovim installed with RPC support and a running Neovim instance in your project directory
- Claude Code (or an MCP client) capable of loading MCP servers
Installation steps:
- Install Node.js if you haven’t already (https://nodejs.org/).
- Ensure Neovim is running in your project directory and that you can connect to its RPC socket.
- Add the MCP server configuration to Claude Code:
- Automatic setup (recommended): run claude mcp add --transport stdio nvim -- npx nvim-mcp-server
- Manual setup: add the following to ~/.claude.json under mcpServers: { "nvim": { "command": "npx", "args": ["nvim-mcp-server"] } }
- Restart Claude Code to apply changes.
- Verify the setup: claude mcp list or use /mcp inside Claude Code to check server status.
Additional notes
Tips and caveats:
- The MCP server uses Neovim sockets discovered under $TMPDIR (macOS/Linux) as described in the docs. Ensure your Neovim instance is in the current directory when starting Claude Code.
- Buffers are exposed as resources and can be updated in real time. When you call update_buffer(path, content), the changes are pushed to Neovim immediately.
- Absolute paths are recommended when referencing buffers to avoid ambiguity.
- If you encounter connection issues, restart Claude Code after updating the MCP configuration and confirm that the Neovim socket exists (e.g., ls $TMPDIR/nvim*/0).
- The server communicates via stdio to the MCP client, so you’ll need an MCP client like Claude Code to interact with it properly.
- Prerelease or development environments may require additional flags or environment variables; consult the project README for any environment-specific notes.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.