Neovim MCP Server
The Neovim MCP Server provides real-time integration between Neovim and Claude, enabling AI-assisted editing with immediate buffer synchronization.
Core Capabilities:
Automatic Context Access - Claude automatically sees your currently active buffer (
nvim://current-buffer) and all open buffers (nvim://open-buffers) as resourcesList Open Buffers - Retrieve all buffers currently open in Neovim instances running in your working directory
Get Active Buffer - Obtain details and content of the currently focused buffer
Read Buffer Content - Fetch content of any specific buffer by its file path
Update Buffers Directly - Modify buffer content in real-time with changes appearing instantly in your editor without saving to disk
Open Files - Open new or existing files directly in your Neovim instance
Reload Buffers - Refresh individual buffers or all open buffers from disk after external changes
Key Benefits:
Real-time Synchronization - Changes appear immediately without file I/O
Context Awareness - Claude automatically knows which files you're editing and what's open
Seamless Workflow - Works with unsaved buffers, preserves undo/redo history, and triggers Neovim autocmds (LSP, linting, etc.)
Direct Editor Control - Create, refactor, and manage files directly in Neovim from Claude
Enables real-time buffer awareness and manipulation in Neovim, allowing reading and updating of buffer contents, listing open buffers, and making changes that appear instantly in the editor without file writes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Neovim MCP Server add error handling to the current buffer"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Neovim MCP Server
MCP (Model Context Protocol) server that integrates Neovim buffers with Claude Code, enabling seamless buffer awareness and real-time updates.
Features
Resources (Auto-available Context)
nvim://current-buffer- Currently active buffer with path and contentnvim://open-buffers- List of all open buffers with metadata
Tools (Claude Can Invoke)
list_nvim_buffers()- List all open buffers in nvim instances running in current directoryget_current_buffer()- Get the currently active bufferget_buffer_content(path)- Get content of a specific buffer by pathupdate_buffer(path, content)- Update buffer content directly in nvim (changes appear immediately!)open_file(path)- Open a file in nvim (useful after creating new files)reload_buffer(path)- Reload a buffer from diskreload_all_buffers()- Check and reload all buffers that changed on disk
Related MCP server: memory-mcp-server
Setup with Claude Code
Option 1: Using the CLI (Recommended)
Run the following command in your terminal:
claude mcp add --transport stdio nvim -- npx nvim-mcp-serverThis will automatically add the server to your ~/.claude.json configuration.
Option 2: Manual Configuration
Alternatively, manually edit ~/.claude.json:
{
"mcpServers": {
"nvim": {
"command": "npx",
"args": ["nvim-mcp-server"]
}
}
}After adding the configuration, restart Claude Code for changes to take effect.
Verify Setup
Check that the server is configured correctly:
claude mcp listOr use /mcp within Claude Code to check server status.
Usage
Once configured, the MCP server will automatically:
Detect Neovim instances running in the current directory
Expose buffer context to Claude via resources
Enable buffer operations via tools
Example Workflows
1. Refactor Current File
You: "Refactor the current file to use async/await"
Claude:
- Reads nvim://current-buffer resource automatically
- Sees you're working on src/api.js
- Refactors the code
- Calls update_buffer() to push changes to nvim
- Changes appear instantly in your editor!2. Check Open Buffers
You: "What files do I have open in nvim?"
Claude:
- Calls list_nvim_buffers() tool
- Shows you all open buffers3. Update Specific Buffer
You: "Add error handling to src/utils.js"
Claude:
- Calls get_buffer_content("src/utils.js")
- Adds error handling
- Calls update_buffer() to apply changes
- You see updates in nvim immediately4. Create and Open New File
You: "Create a new component called Button.jsx"
Claude:
- Creates the file using Write tool
- Calls open_file("src/components/Button.jsx")
- File opens in your nvim automatically
- You can continue editing right away!How It Works
Discovery: Uses
$TMPDIRto find nvim socket filesFiltering: Only connects to nvim instances running in the current directory
RPC Communication: Uses the
neovimnpm package to communicate via msgpack-rpcMCP Integration: Exposes nvim buffers as MCP resources and tools
Socket Discovery
The server finds nvim sockets using:
macOS:
$TMPDIR/nvim*/0(typically/var/folders/.../T/nvim*/0)Linux:
$TMPDIR/nvim*/0or/tmp/nvim*/0Falls back to
/tmpif$TMPDIRis not set
Benefits
Real-Time Updates
Traditional:
Claude writes to file → You reload in nvimWith MCP:
Claude updates buffer via RPC → Changes appear instantlyContext Awareness
Claude automatically knows:
Which file you're currently editing
All files you have open
Can make changes directly in your editor
Seamless Integration
No file writes needed (updates are in-memory)
Works with unsaved buffers
Normal nvim undo/redo works
Triggers autocmds (LSP, linting, etc.)
Troubleshooting
No Neovim instances found
Make sure you're running the command from the same directory as your nvim instance
Check that nvim is running:
ps aux | grep nvimVerify socket exists:
ls $TMPDIR/nvim*/0
Buffer updates not appearing
Ensure the buffer path matches exactly (use absolute paths)
Check that the buffer is listed:
:lsin nvimVerify the MCP server has permissions to access the socket
MCP server not connecting
Restart Claude Code after adding the MCP configuration
Check Claude Code logs for errors
Verify the path in the config is absolute and correct
Development
Test the server manually:
node index.jsThe server communicates via stdio, so you'll need an MCP client (like Claude Code) to interact with it properly.
Debug mode:
The server logs errors to stderr, which you can see in Claude Code's MCP server logs.
Running tests:
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:ui # Interactive UI
npm run test:coverage # With coverage reportPublishing
The project includes automated release scripts for publishing to npm.
Prerequisites:
Clean git working directory
Tests must pass
npm authentication configured (
npm login)
Release commands:
Patch release (1.0.0 → 1.0.1):
npm run release:patchMinor release (1.0.0 → 1.1.0):
npm run release:minorMajor release (1.0.0 → 2.0.0):
npm run release:majorSpecific version:
npm run release 1.2.3What the release script does:
Validates git working directory is clean
Runs all tests
Bumps version in package.json
Creates git commit with version bump
Creates git tag (e.g., v1.0.1)
Publishes to npm
Pushes commit and tags to git
If any step fails, the script will abort and rollback changes.
Requirements
Node.js 16+
Neovim with RPC support (any recent version)
Running nvim instance in the directory where you invoke Claude
License
MIT
Available Tools
7 toolsget_buffer_contentB
Get the content of a specific buffer by path
Inputs: path (required).
get_current_bufferB
Get the currently active buffer in Neovim
Inputs: no named parameters.
list_nvim_buffersB
List all open buffers in Neovim instances running in the current directory
Inputs: no named parameters.
open_fileA
Open a file in Neovim. Use this to open newly created files or existing files for editing.
Inputs: path (required).
reload_all_buffersA
Check all open buffers and reload any that have changed on disk. Use this after editing files externally.
Inputs: no named parameters.
reload_bufferA
Reload a buffer from disk. Use this after editing a file externally to refresh the buffer in Neovim.
Inputs: path (required).
update_bufferB
Update the content of a buffer in Neovim. Changes appear immediately in the editor.
Inputs: path (required), content (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have distinct purposes, but there is some overlap between 'reload_buffer' and 'reload_all_buffers' that could cause confusion. The descriptions help clarify that 'reload_buffer' targets a specific buffer while 'reload_all_buffers' handles all buffers, but the similar naming might lead to misselection in some contexts.
All tool names follow a consistent verb_noun pattern using snake_case, such as 'get_buffer_content', 'list_nvim_buffers', and 'update_buffer'. This predictability makes it easy for agents to understand and use the tools without confusion from mixed conventions.
With 7 tools, the server is well-scoped for managing Neovim buffers and files. Each tool serves a clear purpose, such as retrieving, listing, opening, and updating buffers, which aligns well with the domain of Neovim integration without being overly sparse or bloated.
The tool set covers core buffer operations like getting, listing, opening, and updating, with good lifecycle coverage. A minor gap is the lack of a tool for closing or deleting buffers, which might be needed for full buffer management, but agents can likely work around this with existing tools.
Maintenance
Related MCP Connectors
Read and write your Fresh Jots notes from Claude, Cursor, and any MCP client.
MCP-native notes and memory for ChatGPT, Claude, and other AI tools.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAI context management for codebases – enables Claude Code to read, search, and update project documentation via MCP.MIT
- FlicenseNot gradedqualityDmaintenanceBridges Claude Code and Claude.ai by exposing project memory files over MCP for shared context across both interfaces.-
- AlicenseNot gradedqualityDmaintenanceEnables LLM-powered code analysis, generation, debugging, and context management through MCP integration with IDEs like Cursor and Claude Desktop.MIT
- AlicenseAqualityDmaintenanceMake Neovim feel like Cursor. This MCP server gives an agent full control over the Neovim session it is running inside, including buffers, windows, diagnostics, LSP language intelligence, and terminals.23MIT