mcpserver.nvim
About
A MCP Server for a Neovim instance, using the Neovim RPC MessagePack-RPC protocol
Details
- Author
- calebfroese
- Downloads
- 317
- Categories
- Other
Jump to
- Implements a full MCP server inside Neovim
- Provides get_buffer_content tool returning filename, content, and line count
- Creates a unique Unix socket per Neovim process (PID‑based)
- Standalone stdio server for external MCP clients
- Supports JSON‑RPC protocol over socket or stdio
- Simple :MCPServerStart and :MCPServerStop commands
Install with lazy.nvim; the server starts automatically on VimEnter. Use :MCPServerStart and :MCPServerStop to control the server manually. External clients can connect to the Unix socket at /tmp/nvim-mcp-server-<PID>.sock or use the standalone stdio server (lua standalone.lua) for JSON‑RPC communication.
mcpserver.nvim
A Neovim plugin that implements an MCP (Model Context Protocol) server, allowing external MCP clients to interact with Neovim through a Unix socket.
Features
- get_buffer_content: Fetch the contents of the current buffer
Installation
Using lazy.nvim:
{
dir = "/path/to/mcpserver.nvim", -- Use your local path
-- Server starts automatically on VimEnter
}
Usage
Neovim Plugin
Manual Control
Start the MCP server:
:MCPServerStart
Stop the MCP server:
:MCPServerStop
Get Socket Path
local mcpserver = require('mcpserver')
local socket_path = mcpserver.get_socket_path()
print(socket_path) -- e.g., "/tmp/nvim-mcp-server-12345.sock"
Socket Location
The server creates a unique Unix socket at /tmp/nvim-mcp-server-<PID>.sock where <PID> is the Neovim process ID. This allows multiple Neovim instances to run MCP servers simultaneously.
Standalone MCP Server
For use with external MCP clients that communicate via stdio:
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



