NeoVimMCP

JaydenYip3/NeovimMCP
0 starsCommunity

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables AI clients to interact with Neovim buffers via MCP tools, providing buffer and cursor context.

README.md

NeoVimMCP

MCP server that receives Neovim buffer updates and exposes editor context as MCP tools.

<img width="1405" height="538" alt="image" src="https://github.com/user-attachments/assets/c98964e7-4c8a-4903-a7d0-b669fdbf1e61" />

<img width="1424" height="550" alt="image" src="https://github.com/user-attachments/assets/3b87054e-4c60-4f41-9fef-f79064aba23d" />

Features

  • MCP server over stdio for AI clients
  • HTTP bridge endpoint Neovim can POST to
  • In-memory buffer store with active buffer tracking
  • Tools for active buffer, list/lookup, cursor context, publish, and clear
  • Bridge written in C++ for mutliple nvim instances

Start server

npm install
npm start

Optional env var:

  • NVIM_BUFFER_PORT (default 4389)

MCP tools exposed

  • nvim_get_active_buffer
  • nvim_list_buffers
  • nvim_get_buffer
  • nvim_get_cursor_context
  • nvim_publish_buffer
  • nvim_clear_buffer

Connect your MCP client

Example mcpServers entry:

{
  "mcpServers": {
    "nvim": {
      "command": "node",
      "args": ["/absolute/path/to/nvimMCP/server.js"],
      "env": {
        "NVIM_SOCKET_PATH": "/tmp/nvim.sock (Neovim socket)"
      }
    }
  }
}

Connect Neovim

Drop nvim/nvim-mcp.lua into your config (or source it directly), then call setup:

local nvim_mcp = dofile("/absolute/path/to/nvimMCP/nvim/nvim-mcp.lua")

nvim_mcp.setup({
  endpoint = "http://127.0.0.1:4389/buffer/update",
  clear_endpoint = "http://127.0.0.1:4389/buffer/clear",
  debounce_ms = 150,
})

Available user commands:

  • :NvimMcpPublish (force publish current buffer)
  • :NvimMcpClear (clear current buffer from server)

TODO: Create a mutliplex using C++ to handle multiple instances that can share across the network.

Related MCP servers

Browse all →