Embedded MCP server for Vim

Embedded MCP server for Vim

vim-mcp-server•bybreggles

A Vim plugin that runs an MCP server over HTTP, letting MCP-compatible clients such as AI coding agents read and modify buffers, move the cursor, and run Ex commands.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Lists, reads, edits, opens, saves, and closes Vim buffers through MCP tools.
  • •Gets and sets the cursor position and retrieves the current visual selection.
  • •Reads and sets quickfix and location lists, and retrieves Vim message history.
  • •Opens side-by-side diff views, including git diffs computed inside Vim.

BEST FOR

  • •Getting an AI coding agent to show files and lines in Vim.
  • •Showing selected regions of a buffer to an agent.
  • •Enabling read-only Vim tools for OpenCode plan mode.

ABOUT VIM-MCP-SERVER

Embedded MCP server for Vim is cataloged as an MCP server attributed to breggles. A Vim plugin that runs an MCP server over HTTP, letting MCP-compatible clients such as AI coding agents read and modify buffers, move the cursor, and run Ex commands. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Embedded MCP server for Vim are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which tools are opt-in and disabled by default?

The execute_command, save_buffer, and edit_buffer tools are gated behind configuration options.

Can the server start automatically when Vim launches?

Yes, setting g:mcp_server_autostart to 1 starts the server on VimEnter.

Upstream README

View this exact version on GitHub

README.md · c194811a15cd · Fetched 2026-11-13 14:02:10 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

vim-mcp-server

An MCP (Model Context Protocol) server embedded in Vim. It exposes tools over HTTP that let MCP-compatible clients — such as AI coding agents — read and modify buffers, move the cursor, retrieve visual selections, manage quickfix and location lists, open side-by-side diffs (including git diffs computed inside Vim), read message history, and run Ex commands.

Atm, I mainly use this for getting the agent to show me files/lines in Vim. Sometimes, I use it for showing selected regions to the agent.

Requirements

  • Vim compiled with +python3

Installation

Use your preferred plugin manager.

vim-plug

Plug 'breggles/vim-mcp-server'

Vundle

Plugin 'breggles/vim-mcp-server'

Manual

Clone the repository into your Vim packages directory:

git clone https://github.com/breggles/vim-mcp-server.git \
    ~/.vim/pack/plugins/start/vim-mcp-server

Usage

Start the server

In Vim, run:

:McpServerStart

Auto-start the server on Vim launch by adding this to your vimrc:

let g:mcp_server_autostart = 1

MCP Client Configuration

Point your MCP client at http://127.0.0.1:8765/mcp (or whichever port you chose).

For example, for opencode add the server to your opencode.jsonc:

"mcp": {
  "vim": {
    "type": "remote",
    "url": "http://localhost:8765/mcp",
    "enabled": true
  }
}

Commands

CommandDescription
:McpServerStart [port]Start the server (default port 8765)
:McpServerStopStop the server
:McpServerStatusPrint server status and URL

Options

VariableDefaultDescription
g:mcp_server_port8765Port the server listens on
g:mcp_server_autostart0Start the server automatically on VimEnter
g:mcp_server_allow_execute0Enable the execute_command tool
g:mcp_server_allow_save0Enable the save_buffer tool
g:mcp_server_allow_edit0Enable the edit_buffer tool

Tools

The server exposes the following tools to MCP clients:

ToolDescription
list_buffersList all open buffers
get_bufferRead buffer contents (optionally a line range)
edit_bufferReplace, insert, or delete lines in a buffer
open_fileOpen a file via :edit
save_bufferSave a buffer via :write (opt-in, see above)
close_bufferClose a buffer via :bdelete
get_cursorGet current cursor position
set_cursorMove cursor to a line and column
get_visual_selectionGet the current visual selection, if any
execute_commandRun an arbitrary Ex command (opt-in, see above)
get_quickfix_listGet the current quickfix list entries
set_quickfix_listSet the quickfix list
get_location_listGet the location list for the current window
set_location_listSet the location list for the current window
get_messagesGet Vim's message history (:messages output)
show_diffOpen a side-by-side diff view in a new tab (files or content)
show_git_diffOpen a side-by-side git diff in a new tab; git computes both sides inside Vim

When a tool accepts a buffer argument it can be specified by number (buffer_id) or by file path (buffer_path). When both are omitted, the current buffer is used.

OpenCode Plan Mode

By default, OpenCode's plan mode disables all MCP tools. To allow read-only vim tools in plan mode, add the following to your opencode.jsonc:

{
  "agent": {
    "plan": {
      "tools": {
        "vim_*": false,
        "vim_list_buffers": true,
        "vim_get_buffer": true,
        "vim_get_cursor": true,
        "vim_get_visual_selection": true,
        "vim_open_file": true,
        "vim_set_cursor": true,
        "vim_get_quickfix_list": true,
        "vim_set_quickfix_list": true,
        "vim_get_location_list": true,
        "vim_set_location_list": true,
        "vim_get_messages": true,
        "vim_show_diff": true,
        "vim_show_git_diff": true
      }
    }
  }
}

This disables all vim_* tools first, then re-enables specific ones. Adjust the list to suit your workflow.

Development

To work on the plugin without installing it, clone the repository and add it to Vim's runtime path:

set rtp+=~/path/to/vim-mcp-server

Add this to your vimrc or run it manually. Changes take effect the next time Vim is started.

Generate the help tags with:

:helptags ~/path/to/vim-mcp-server/doc

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Embedded MCP server for Vim from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/vim-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools