Skip to main content

MCP server for AI-assisted control of Neovim via msgpack-RPC

Project description

nvim-mcp

PyPI

An MCP server that gives AI agents first-class access to your running Neovim session. It connects through Neovim's native msgpack-RPC socket — no plugins required.

Works with Cursor, Claude Code, Codex, and any MCP-compatible client.

What agents can do

  • See what you see — editor mode, working directory, open buffers, window layout, cursor context, folds, selections, marks, and diagnostics.
  • Edit buffers in memory — find-and-replace or full rewrites with immediate feedback and full undo support. Nothing touches disk until you save.
  • Run any Vim command:w, :e, :vsplit, macros, or anything else you could type at the command line.
  • Send keystrokes — navigate, enter insert mode, trigger mappings.
  • Query LSP diagnostics — errors, warnings, and hints across one buffer or the whole session.
  • Annotate code with highlights — colored extmarks to draw your attention to specific lines.

Anything you can do in Neovim, the agent can too. See the full tool reference for details.

Demos

Using nvim-mcp across two terminals

Using nvim-mcp with a terminal inside Neovim

Claude and Cursor collaborating in one Neovim instance

Using nvim-mcp in Cursor

Quick start

  1. Install uv if you don't have it:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Register the MCP server with your client. Example for Cursor (.cursor/mcp.json):

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

    For Claude Code, Codex, Claude Desktop, and other clients, see the configuration guide.

  3. Add agent rules so the agent knows when and how to use the tools:

    ./config/generate-configs.sh
    

    See the configuration guide for details.

  4. Start Neovim — on most Linux systems it listens on a Unix socket automatically and is discovered by nvim-mcp. If auto-discovery doesn't work, see environment variables.

Verify it works

Open a file in Neovim and paste this into your AI agent:

For each step: explain what you're about to do, then do it, then tell me
what happened. Wait for me to say "next" before moving on.

1. What file am I in? Highlight the function my cursor is in.
2. Are there any diagnostics? Highlight any lines with errors or warnings.
3. Add a docstring above the function, then show me the diff.
4. Open a vertical split, write a short test for that function, and save both files.

Requirements

  • Linux
  • Python ≥ 3.10
  • Neovim ≥ 0.11 (older versions work with --listen and NVIM_ADDRESS)

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvim_mcp-0.6.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvim_mcp-0.6.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file nvim_mcp-0.6.1.tar.gz.

File metadata

  • Download URL: nvim_mcp-0.6.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nvim_mcp-0.6.1.tar.gz
Algorithm Hash digest
SHA256 ec0c0e010313848bb3e9debf55e88bda9d4cd097b7aa6b1280b9a1b965d66f46
MD5 ebd83a939f88575379d71d9dbb689597
BLAKE2b-256 192990c26032fb5686578605142c3d47a2a2d69162eb985023187e2029ae1913

See more details on using hashes here.

File details

Details for the file nvim_mcp-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: nvim_mcp-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nvim_mcp-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f77170ff5747f74159a278480c7d3d5cc661fff90b426af0e420641fcb35f2e0
MD5 831ce82c684b62d3bc862c57549891e2
BLAKE2b-256 b98b9f1951bd26eafd42be49d82d497987a37848bd2b955dfb46be98dce5a505

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page