nvim-mcp

mcp
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 37 GitHub stars
Code Fail
  • eval() — Dynamic code execution via eval() in src/nvim_mcp/client.py
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This server acts as a bridge, giving AI agents direct, first-class access to a running Neovim session via native msgpack-RPC. It enables the AI to read and edit buffers, execute commands, and send keystrokes without requiring any Neovim plugins.

Security Assessment
Overall Risk: High
By design, this tool grants extensive control over your code editor. While it does not request dangerous system-level permissions or make external network requests, it inherently accesses your local files and editor state. The automated scan flagged the use of `eval()` for dynamic code execution in the client code. While the tool's core purpose is executing Vim commands, the presence of `eval()` introduces a potential vector for arbitrary code execution if an AI agent is manipulated or behaves unpredictably. There are no hardcoded secrets.

Quality Assessment
Overall Quality: Good
The project is actively maintained, with the most recent push occurring today. It has a solid foundation of community trust, backed by an MIT license and 37 GitHub stars. The repository is well-documented, featuring clear setup instructions and multiple usage demos.

Verdict
Use with caution. While well-made and actively maintained, granting an AI agent unrestricted `eval()` access and direct control over your editor carries significant inherent risks; use only in isolated or non-critical environments.
SUMMARY

MCP server that connects AI agents to your running Neovim instance via msgpack-RPC — no plugins required.

README.md

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.
  • Work with multiple instances — auto-discovers running sessions and connects to the right one. See multiple instances.

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

Multiple Neovim instances

Quick start

nvim-mcp runs via either uv or Nix — pick whichever you already use.

  1. Install a launcher.

    uv
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    Nix

    Install Nix and enable flakes (add experimental-features = nix-command flakes to ~/.config/nix/nix.conf, or use the Determinate installer which enables them by default).

  2. Register the MCP server with your client. Example for Cursor (.cursor/mcp.json):

    With uv
    {
      "mcpServers": {
        "nvim-mcp": {
          "command": "uvx",
          "args": ["nvim-mcp"]
        }
      }
    }
    
    With Nix
    {
      "mcpServers": {
        "nvim-mcp": {
          "command": "nix",
          "args": ["run", "github:paulburgess1357/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. Running multiple instances? See multiple instances.

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.

Reviews (0)

No results found