Back to MCP Catalog

Neovim Control MCP Server

Developer ToolsTypeScript
Control Neovim editor through MCP
Available Tools

vim_buffer

Current VIM text editor buffer with line numbers shown

filename

vim_command

Send a command to VIM for navigation, spot editing, and line deletion

command

vim_status

Get the status of the VIM editor including cursor position, mode, filename, visual selection, window layout, current tab, marks, registers, and working directory

vim_edit

Edit lines using insert, replace, or replaceAll in the VIM editor

startLinemodelines

vim_window

Manipulate Neovim windows (split, vsplit, close, navigate)

command

vim_mark

Set a mark at a specific position

marklinecolumn

vim_register

Set content of a register

registercontent

vim_visual

Make a visual selection

startLinestartColumnendLineendColumn

Connect Claude Desktop or any Model Context Protocol client to Neovim using the official neovim/node-client JavaScript library. This server leverages Vim's native text editing commands and workflows to create a lightweight code or general purpose AI text assistance layer. It allows AI assistants to view your current buffers, get cursor location and file information, run vim commands, and make edits using insert or replacement.

Overview

The Neovim Control MCP server enables AI assistants to interact with your Neovim text editor sessions. It creates a bridge between Model Context Protocol clients (like Claude Desktop) and Neovim, allowing the AI to view and edit your code or text files using Vim's native commands.

Installation

To use the Neovim Control MCP server, you need to:

  1. Make sure you have Node.js installed on your system
  2. Start Neovim with a socket file exposed (e.g., nvim --listen /tmp/nvim)
  3. Add the MCP server configuration to your Claude Desktop or other MCP client

Adding to Claude Desktop

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "MCP Neovim Server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-neovim-server"
      ],
      "env": {
        "ALLOW_SHELL_COMMANDS": "true",
        "NVIM_SOCKET_PATH": "/tmp/nvim"
      }
    }
  }
}

Configuration Options

You can customize the behavior of the Neovim Control MCP server using these environment variables:

  • ALLOW_SHELL_COMMANDS: Set to 'true' to enable shell command execution (e.g., !ls). Defaults to false for security.
  • NVIM_SOCKET_PATH: Set to the path of your Neovim socket. Defaults to '/tmp/nvim' if not specified.

Usage

Once connected, the AI assistant can:

  1. View your current buffers and their content
  2. Get information about cursor location, mode, file name
  3. Run vim commands for navigation and editing
  4. Make edits using insert or replacement modes
  5. Manipulate windows (split, close, navigate)
  6. Set marks and manage registers
  7. Create visual selections

The server exposes resources like nvim://session (current Neovim text editor session) and nvim://buffers (list of all open buffers with metadata).

Limitations

  • This is a proof of concept, so use at your own risk
  • May not interact well with custom Neovim configurations
  • Error handling could be improved
  • The AI assistant may occasionally format Vim commands incorrectly

Security Note

By default, shell command execution is disabled for security. Only enable ALLOW_SHELL_COMMANDS if you trust the AI assistant and understand the potential risks of allowing it to execute shell commands through Vim.

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.