An MCP server that gives coding agents a read-only view of what you have open in Neovim: the buffers on screen, cursor, visual selection and diagnostics.
The server runs inside nvim --headless, so there's nothing else to install.
With lazy.nvim:
{
"urwrstkn8mare/nvim-mcp.nvim",
config = function() require("nvim_mcp").setup() end,
}Then register it with your agent as a stdio MCP server that runs
nvim --headless +McpServer. Most agents take JSON like this:
{
"mcpServers": {
"nvim": { "command": "nvim", "args": ["--headless", "+McpServer"] }
}
}| Tool | What it does |
|---|---|
list_instances |
Running Neovim instances: pid, cwd, current file, mode |
get_view |
What's on screen: visible buffers, cursor, selection, diagnostics and contents |
The server picks the Neovim instance whose cwd matches the agent's working directory. If several match, it uses the most recently active one. Pass project or pid to choose a different one.
| Command | What it does |
|---|---|
:McpStatus |
Show whether this instance is registered |
:McpExclude / :McpInclude |
Hide this instance from agents / expose it again |