mcp-neovim-server
Neovim MCP サーバー
モデルコンテキストプロトコル(MCP)と公式JavaScriptライブラリneovim/node-clientを使用して、Claude Desktop(または任意のクライアント)とNeovimを統合する概念実証です。このサーバーは、Claudeが既に理解しているVimのネイティブテキスト編集コマンドとワークフローを活用して、軽量コードまたは汎用AIテキスト支援レイヤーを作成します。
特徴
nvim を起動するときに、たとえば
--listen /tmp/nvimようにソケットファイルを公開すると、nvim インスタンスに接続します。現在のバッファを表示します
カーソルの位置、モード、ファイル名を取得します
vim コマンドとオプションでシェル コマンドを vim 経由で実行します
挿入または置換を使用して編集できます
Related MCP server: loreto-mcp
API
リソース
nvim://session: 現在の Neovim テキストエディタセッションnvim://buffers: 現在の Neovim セッションで開いているすべてのバッファのリスト。変更されたステータス、構文、ウィンドウ ID などのメタデータが含まれます。
ツール
vim_バッファ
行番号が表示された現在の VIM テキストエディタバッファ
入力
filename(文字列)ファイル名は無視され、現在アクティブなバッファの内容を含む番号付き行の文字列を返します。
vimコマンド
ナビゲーション、スポット編集、行削除のためにVIMにコマンドを送信します
入力
command(文字列)nvim.replaceTermcodesに渡された vim コマンドを実行します。改行で区切れば複数のコマンドも実行できます。エラーの場合は、
'nvim:errmsg'内容が返されます
vim_ステータス
VIMエディタのステータスを取得する
ステータスには、カーソル位置、モード、ファイル名、ビジュアル選択、ウィンドウレイアウト、現在のタブ、マーク、レジスタ、作業ディレクトリが含まれます。
vim_edit
VIM エディタで insert、replace、replaceAll を使用して行を編集します。
入力
startLine(数値)、mode("insert"|"replace"|"replaceAll")、lines(文字列)insert は startLine に行を挿入します
replaceはstartLineから始まる行を置き換えます
replaceAllはバッファの内容全体を置き換えます
vim_ウィンドウ
Neovim ウィンドウを操作する (分割、vsplit、閉じる、移動)
入力
command(文字列: "split"、"vsplit"、"only"、"close"、"wincmd h/j/k/l")ウィンドウ管理操作を可能にする
vim_mark
特定の位置にマークを設定する
入力
mark(文字列:az)、line(番号)、column(番号)指定された位置に名前付きマークを設定します
vim_register
レジスタの内容を設定する
入力
register(文字列:azまたは ")、content(文字列)レジスタの内容を管理する
vim_visual
視覚的に選択する
startLine(数値)、startColumn(数値)、endLine(数値)、endColumn(数値) を入力します。ビジュアルモードの選択を作成します
このシンプルなツールセットを使用すると、Claude は neovim セッションを覗いて質問に答えたり、バッファーを編集したりすることができます。
制限事項
これはモデルコンテキストプロトコルを試すための簡単な概念実証です。自己責任でご利用ください。
カスタム neovim 構成とうまく連携しない可能性があります。
エラー処理は改善される可能性があります。
時々、Claude は vim コマンドを正しく入力できないことがあります。
構成
環境変数
ALLOW_SHELL_COMMANDS: シェルコマンド(例!ls)の実行を有効にするには、「true」に設定します。セキュリティ上の理由から、デフォルトは false です。NVIM_SOCKET_PATH: Neovimソケットのパスを設定します。指定されていない場合はデフォルトで「/tmp/nvim」になります。
Claude Desktopでの使用
これを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"
}
}
}
}ライセンス
このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。
Available Tools
19 toolsvim_bufferC
Get buffer contents with line numbers
Inputs: filename.
vim_buffer_saveC
Save current buffer or save to specific filename
Inputs: filename.
vim_buffer_switchC
Switch between buffers by name or number
Inputs: identifier (required).
vim_commandC
Execute Vim commands with optional shell command support
Inputs: command (required).
vim_editC
Edit buffer content using insert, replace, or replaceAll modes
Inputs: lines (required), mode (required), startLine (required).
vim_file_openC
Open files into new buffers
Inputs: filename (required).
vim_foldC
Manage code folding: create, open, close, and toggle folds
Inputs: action (required), endLine, startLine.
vim_grepC
Project-wide search using vimgrep with quickfix list
Inputs: pattern (required), filePattern.
vim_healthB
Check Neovim connection health
Inputs: no named parameters.
vim_jumpC
Navigate Neovim jump list: go back, forward, or list jumps
Inputs: direction (required).
vim_macroC
Record, stop, and play Neovim macros
Inputs: action (required), count, register.
vim_markB
Set named marks at specific positions in the buffer
Inputs: column (required), line (required), mark (required).
vim_registerC
Manage Neovim register contents
Inputs: content (required), register (required).
vim_searchC
Search within current buffer with regex support and options
Inputs: pattern (required), ignoreCase, wholeWord.
vim_search_replaceC
Find and replace with global, case-insensitive, and confirm options
Inputs: pattern (required), replacement (required), confirm, global, +1 more.
vim_statusA
Get comprehensive Neovim status including cursor position, mode, marks, and registers
Inputs: no named parameters.
vim_tabC
Manage Neovim tabs: create, close, and navigate between tabs
Inputs: action (required), filename.
vim_visualC
Create visual mode selections in the buffer
Inputs: endColumn (required), endLine (required), startColumn (required), startLine (required).
vim_windowB
Manage Neovim windows: split, close, and navigate between windows
Inputs: command (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool has a clearly distinct purpose targeting specific Neovim operations like buffer management, editing, navigation, and system control. There is no overlap or ambiguity; for example, vim_search handles searching within a buffer while vim_grep handles project-wide searches, and vim_buffer_switch is distinct from vim_tab or vim_window for navigation.
All tools follow a consistent 'vim_' prefix with descriptive snake_case names that clearly indicate their function, such as vim_buffer_save, vim_command, and vim_search_replace. This uniform pattern makes the tool set predictable and easy to understand, with no deviations in style or structure.
With 19 tools, the count is slightly high but reasonable for covering the broad scope of Neovim operations, including editing, navigation, file management, and system health. It avoids being excessive by focusing on core functionalities without redundant tools, though it might feel heavy compared to simpler servers.
The tool set provides comprehensive coverage of Neovim's core features, including CRUD-like operations for buffers, files, and content, as well as navigation, search, macros, marks, and system status. There are no obvious gaps; it supports full lifecycle management from opening files to editing, saving, and navigating, ensuring agents can handle typical workflows without dead ends.
Maintenance
Related MCP Connectors
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
People and AI agents build software together in persistent cloud sessions for Claude Code.
Your AI mind directs coding agents; work reviewed against your memories: Claude Code, Codex, Cursor
Bring meeting decisions, tasks and user stories into your AI editor (Claude, Cursor, Copilot).
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that gives AI models access to your iTerm terminal session, allowing them to read output, write commands, and send control characters.3MIT
- AlicenseAqualityBmaintenanceTurn any YouTube video, article, PDF, or image into a reusable Claude Code skill — without leaving your editor.6153 PyPI36MIT
- FlicenseNot gradedqualityDmaintenanceTurns Claude Desktop into a Cursor-like assistant for code browsing, editing, searching, linting, formatting, and version control.-
- AlicenseAqualityBmaintenanceBridges Claude Code and OpenAI Codex CLI for an interactive plan-execute-review workflow, enabling Claude to interview, design, and review while Codex implements code changes.7565 npm4MIT