Neovim

Neovim

An MCP Server for your Neovim session.

259
Stars
21
Forks
12
Releases

Overview

Neovim MCP Server enables Claude Desktop (or any MCP client) to connect to a Neovim session via MCP, using the official neovim/node-client JavaScript library. It exposes Neovim's editing capabilities as a structured set of resources and tools for AI-assisted editing, navigation, and project-wide operations. The server connects through a Neovim socket (NVIM_SOCKET_PATH, default '/tmp/nvim') and can expose the current session and buffers with metadata. It provides commands to read and manipulate buffers, query cursor location, mode, filename, marks, registers, and visual selections, and to execute Vim commands (with optional shell commands when ALLOW_SHELL_COMMANDS=true). Editing supports insert, replace, and replaceAll modes. It enables search, regex-based replacement, and project-wide grep with quickfix integration, plus comprehensive window management (splits, navigation, closing). The API consists of multiple tools (vim_buffer, vim_command, vim_status, vim_edit, vim_window, vim_mark, vim_register, vim_visual, etc.) and an accompanying workflow prompt neovim_workflow. It includes error handling, health checks, environment-based configuration (ALLOW_SHELL_COMMANDS, NVIM_SOCKET_PATH), and straightforward installation options.

Details

Owner
bigcodegen
Language
TypeScript
License
MIT License
Updated
2025-12-07

Features

Neovim socket connection and session access

Connect to a running Neovim instance via a socket (e.g., --listen /tmp/nvim) and access the current session for MCP tooling.

Buffer view and management

View open buffers and access metadata; switch between buffers and manage buffer state through MCP tools.

Retrieve editor state and selections

Obtain cursor location, mode, filename, visual selections, marks, registers, and window layout for context-aware AI actions.

Command execution and shell command support

Send Vim commands (nvim.replaceTermcodes) and optionally execute shell commands when ALLOW_SHELL_COMMANDS is true.

Text editing modes

Edit buffers using insert, replace, or replaceAll modes to modify content programmatically.

Search, replace, and regex support

Perform regex-based searches and replacements within buffers, enabling advanced text manipulation.

Project-wide grep with quickfix

Run project-wide searches using vimgrep with quickfix integration for navigation and results.

Window management and layouts

Control Neovim windows (split, vsplit, navigate, close) and manage layout for efficient workflows.

Audience

AI developersIntegrate Claude Desktop or other MCP clients with Neovim to provide AI-guided editing, navigation, and code search within a Neovim session.
Neovim usersLeverage MCP to expose Neovim capabilities to an AI assistant for real-time guidance, buffer management, and workflow automation.

Tags

neovimmcpclaudenvimbufferscommandseditingsearchgrepwindowssocketshell-commandsintegrationapivim