list_buffersLABSCO 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
Follow the published steps
USE CASES
Getting the agent to show you a line
Open the file and move the cursor there, so you are looking at the same place it is talking about.
Handing over the region you highlighted
Pull the current visual selection instead of describing it or pasting it.
Reviewing a change in Vim, not a chat window
Open a side-by-side diff in a new tab, with git computing both sides.
Turning findings into a jump list
Write the results into the quickfix list so you can step through them with the keys you already use.
17 tools
Listed in project docs. Your client may show a different list.
get_bufferedit_bufferopen_filesave_bufferclose_bufferget_cursorset_cursorget_visual_selectionexecute_commandget_quickfix_listset_quickfix_listget_location_listset_location_listget_messagesshow_diffshow_git_diffBEFORE YOU INSTALL
What to know first
Tools you get
17 tools named in the project's documentation.
Requires
- Vim compiled with +python3
- The server running inside Vim (:McpServerStart, default port 8765)
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
Requires Vim compiled with +python3
Install with your plugin manager — vim-plug: Plug 'breggles/vim-mcp-server'; Vundle: Plugin 'breggles/vim-mcp-server'; or manually: git clone https://github.com/breggles/vim-mcp-server.git ~/.vim/pack/plugins/start/vim-mcp-server
Start the server inside Vim with :McpServerStart (or add let g:mcp_server_autostart = 1 to your vimrc)
Point your MCP client at http://127.0.0.1:8765/mcp. For OpenCode, add the "mcp" block from the OpenCode tab to opencode.jsonc.
MCP Clients
OpenCode
{
"mcp": {
"vim": {
"type": "remote",
"url": "http://localhost:8765/mcp",
"enabled": true
}
}
}