Labsco
MCP SERVER

Vim MCP Server

by breggles

Let an agent read your Vim buffers, move your cursor and open a diff in a tab — with writes off by default.

Editors, Terminals & Local Dev Environment
Summary
Three separate opt-ins, so the agent can look without being able to write.

Editing, saving and arbitrary Ex commands are gated by three independent variables — the default install can read buffers and move your cursor and nothing else. show_git_diff is the small pleasure here: git computes both sides and Vim renders the comparison in a new tab, where you already know the keys.

What it is

An MCP server that runs inside Vim itself and serves over HTTP. It exposes buffers, the cursor, the visual selection, the quickfix and location lists, message history and Ex commands to a connected client.

What you get
  • list_buffers, get_buffer with an optional line range, open_file and close_buffer
  • edit_buffer and save_buffer — replace, insert or delete lines, and write the file (both opt-in)
  • get_cursor and set_cursor — read where you are, or move to a line and column
  • get_visual_selection — whatever you have highlighted right now
  • get_quickfix_list, set_quickfix_list, get_location_list and set_location_list
  • get_messages — the :messages history
  • show_diff and show_git_diff — a side-by-side diff in a new tab, with git computing both sides inside Vim
  • execute_command — any Ex command (opt-in)
  • Buffers addressable by number or by file path, defaulting to the current one
Requirements

Vim compiled with +python3, installed as a plugin. Start it with :McpServerStart, or set the autostart variable in your vimrc. The client connects to http://127.0.0.1:8765/mcp by default. Editing, saving and Ex commands each stay disabled until you enable the matching option.

Setup effort

One command — Plug 'breggles/vim-mcp-server'