mcp-neovim-server

This repository provides a Model Context Protocol (MCP) server that integrates Claude Desktop with Neovim, enabling AI-powered text assistance by leveraging Vim's native editing commands and workflows. This repository provides

184
7

Neovim MCP Server

This project is a proof-of-concept integration between Claude Desktop (or any client) and Neovim, leveraging the Model Context Protocol (MCP) and the neovim/node-client JavaScript library. It enables AI-powered text assistance within Neovim by utilizing Vim's native text editing commands, which Claude already understands.

Features

  • Connects to a running Neovim instance via a socket file (e.g., --listen /tmp/nvim).
  • Provides access to current buffers, cursor location, mode, and filename.
  • Executes Vim commands and optional shell commands.
  • Enables edits using insert or replacement operations.

API

The server exposes resources like nvim://session and nvim://buffers. It offers tools such as vim_buffer (retrieves buffer content), vim_command (executes Vim commands), vim_status (gets editor status), vim_edit (edits lines), vim_window (manages windows), vim_mark (sets marks), vim_register (sets register content), and vim_visual (makes visual selections).

Limitations

This is an experimental project with potential limitations, including compatibility issues with custom Neovim configurations and imperfect error handling.

Configuration

Environment variables ALLOW_SHELL_COMMANDS (defaults to false) and NVIM_SOCKET_PATH (defaults to /tmp/nvim) can be configured.

Usage with Claude Desktop

Configuration details are provided for integrating the server with Claude Desktop.

License

The project is licensed under the MIT License.

Repository

BI
bigcodegen

bigcodegen/mcp-neovim-server

Created

December 22, 2024

Updated

March 28, 2025

Language

TypeScript

Category

Developer Tools