This Neovim MCP server, developed by Derek White (bigcodegen), integrates Claude Desktop with Neovim using the Model Context Protocol and the official neovim/node-client library. It leverages Vim's native text editing commands to create a lightweight code assistance layer, allowing AI to interact directly with Neovim sessions. The server connects to a running Nvim instance, providing tools to view and edit buffers, execute Vim commands, and retrieve editor status. By abstracting Neovim's complexities, it enables AI assistants to seamlessly work within the familiar Vim environment. This implementation is particularly useful for developers seeking AI-enhanced coding assistance within their preferred text editor, facilitating tasks such as code review, refactoring, and context-aware suggestions without leaving the Neovim ecosystem.
Current VIM text editor buffer with line numbers shown. Input `filename` (string) is ignored, returns a string of numbered lines with the current active buffer content.
Send a command to VIM for navigation, spot editing, and line deletion. Input `command` (string) runs a vim command first passed through `nvim.replaceTermcodes`. Multiple commands will work if separated by newlines. On error, 'nvim:errmsg' contents are returned.
Get the status of the VIM editor. Status contains cursor position, mode, filename, visual selection, window layout, current tab, marks, registers, and working directory.
Edit lines using insert, replace, or replaceAll in the VIM editor. Input `startLine` (number), `mode` (`'insert'` | `'replace'` | `'replaceAll'`), `lines` (string). Insert will insert lines at startLine, replace will replace lines starting at startLine, and replaceAll will replace the entire buffer contents.
Manipulate Neovim windows (split, vsplit, close, navigate). Input `command` (string: 'split', 'vsplit', 'only', 'close', 'wincmd h/j/k/l') allows window management operations.
Set a mark at a specific position. Input `mark` (string: a-z), `line` (number), `column` (number) sets named marks at specified positions.
Set content of a register. Input `register` (string: a-z or '), `content` (string) manages register contents.
Make a visual selection. Input `startLine` (number), `startColumn` (number), `endLine` (number), `endColumn` (number) creates visual mode selections.
No reviews yet. Be the first to review!
Sign in to join the conversation
Start the server with node to access it via any client or IDE.
node path/to/downloaded/file.mjs