NeoVimMCP
This server exposes Neovim editor state over MCP (Streamable HTTP), letting MCP clients retrieve buffer, cursor, selection, yank, path, and file content snapshots from connected Neovim instances.
Retrieve current file path (absolute and relative)
Get full buffer/file content
Get cursor position and nearby lines for context
Get visual selection (based on marks)
Get yank register content and type
Get line ranges (start to end, 0-indexed, end-exclusive)
Choose which Neovim instance to query (or default to most recent)
Access via HTTP endpoint (
/mcp) with optional bearer-token authSupports multiple Neovim instances with focus tracking
Provides tools for accessing and manipulating Neovim buffers, including retrieving active buffer, listing buffers, looking up buffer content, getting cursor context, publishing buffer updates, and clearing buffers.
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., "@NeoVimMCP show me the current buffer content"
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.
NeoVimMCP
MCP server that receives Neovim buffer updates over HTTP and exposes editor context as MCP tools — to clients on this machine or on any other device on your network.
How it works
Neovim (Lua plugin) --HTTP POST--> NeoVimMCP server <--MCP over HTTP-- phone / laptop / any clientNeovim pushes buffer, cursor, selection and yank state to the server on autocmds; the server keeps the latest snapshot per instance in memory and serves it over the MCP Streamable HTTP transport. Nothing depends on a Unix socket, so an MCP client on another device only needs to reach this machine's IP and port.
Related MCP server: @aetherall/mcp-nvim-tmux
Features
MCP over Streamable HTTP — reachable from other devices on the same network
HTTP ingest endpoint Neovim POSTs to
In-memory state store with focus tracking across multiple Neovim instances
Tools for cursor context, line ranges, selection, yank, full buffer and paths
Optional bearer-token auth
stdio transport still available for local-only setups
Start the server
npm install
npm run build
npm startThe startup banner prints the URLs to use:
[MCP] HTTP listening on 0.0.0.0:4389
[MCP] MCP endpoint: http://192.168.1.42:4389/mcp
[MCP] Neovim ingest: http://192.168.1.42:4389/nvim/stateEnvironment variables
Variable | Default | Purpose |
|
| Bind address. Use |
|
| Listen port. |
| (unset) | When set, every request except |
|
| Set to |
Security: the default bind exposes your buffer contents to everyone on the network. Set
NVIM_MCP_TOKENwhenever the server is not bound to loopback — the server warns at startup if you have not. For access beyond your LAN, put it behind a tunnel or reverse proxy with TLS rather than forwarding the port.
Connect Neovim
Copy nvim/nvim-mcp.lua into your config's lua/ directory (or add this repo's
nvim/ folder to your runtimepath), then:
require("nvim-mcp").setup({
url = "http://127.0.0.1:4389",
-- token = "your-token", -- must match NVIM_MCP_TOKEN
-- instance = "work-laptop", -- defaults to hostname-pid
})Requires curl on PATH. Commands: :NvimMcpSync pushes immediately,
:NvimMcpStatus shows the configured URL and instance id.
Connect an MCP client
Any client that speaks the MCP Streamable HTTP transport, on any device that can reach the machine:
{
"mcpServers": {
"nvim": {
"type": "http",
"url": "http://192.168.1.42:4389/mcp",
"headers": { "Authorization": "Bearer your-token" }
}
}
}In Claude Code: claude mcp add --transport http nvim http://192.168.1.42:4389/mcp.
For a local-only stdio setup instead:
{
"mcpServers": {
"nvim": {
"command": "node",
"args": ["/absolute/path/to/nvimMCP/dist/server.js", "--stdio"]
}
}
}Note that stdio mode still binds the HTTP ingest port so Neovim has somewhere to POST — only one instance can own that port at a time.
MCP tools exposed
list_editors— every registered Neovim instance and how stale it isget_cursor_contextget_linesget_selectionget_yankget_full_fileget_path
Every tool except list_editors takes an optional instance argument; without
it, the most recently focused Neovim is used. Responses include age_ms so a
client can tell how fresh the snapshot is.
HTTP API
Method | Path | Purpose |
|
| MCP Streamable HTTP endpoint (also |
|
| Neovim pushes a state snapshot; absent fields keep their previous value |
|
| Mark |
|
| Remove an instance from the store |
|
| Dump the store (debugging) |
|
| Unauthenticated liveness check |
Docker
docker build -t nvimmcp .
docker run -p 4389:4389 -e NVIM_MCP_TOKEN=your-token nvimmcpAvailable Tools
6 toolsget_cursor_contextGet Cursor ContextA
Returns current file, filetype, cursor position, and nearby lines.
Inputs: no named parameters.
get_full_fileGet Full FileA
Returns full current buffer content.
Inputs: no named parameters.
get_linesGet Line RangeA
Returns lines from start to end (0-indexed, end-exclusive).
Inputs: end (required), start (required).
get_pathGet file path absolute and relativeB
Returns the absolute and relative path of the current file.
Inputs: no named parameters.
get_selectionGet Visual SelectionA
Returns last visual selection based on '< and '> marks.
Inputs: no named parameters.
get_yankGet Yank RegisterA
Returns unnamed register text and register type.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool retrieves a distinct piece of information: cursor context, line range, selection, yank register, full file, and file path. There is no overlap in purpose.
All tools follow a consistent 'get_' prefix followed by a clear noun describing the fetched data (e.g., get_cursor_context, get_lines). No mixing of styles.
With 6 tools covering essential read operations, the count is reasonable for a focused inspection server, though slightly on the lower side.
The server provides only read operations, lacking any mutation tools like edit, execute commands, or buffer management. This leaves significant gaps for a NeoVim integration.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Cross-tool persistent memory and context for AI assistants over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceIntegrates Neovim buffers with Claude, enabling real-time buffer awareness and direct in-editor content updates through MCP resources and tools.712 npm19MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables AI agents to control Neovim instances running in tmux sessions.12MIT
- 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
- AlicenseNot gradedqualityDmaintenanceProvides VS Code active editor context (open file, cursor position, selection) to MCP-compatible AI tools.10 npm1MIT