mcp-neovim-server

Integrations

  • Connects to a Neovim instance to view and manipulate text buffers, run Vim commands, access editor status, manage windows, set marks and registers, and make visual selections. Allows AI to interact directly with content in the Neovim editor.

  • Leverages Vim's native text editing commands and workflows to enable AI assistance with code and text editing. Supports navigation, manipulation of buffers, window management, and visual selections.

Neovim MCP サーバー

モデルコンテキストプロトコル(MCP)と公式JavaScriptライブラリneovim/node-clientを使用して、Claude Desktop(または任意のクライアント)とNeovimを統合する概念実証です。このサーバーは、Claudeが既に理解しているVimのネイティブテキスト編集コマンドとワークフローを活用して、軽量コードまたは汎用AIテキスト支援レイヤーを作成します。

特徴

  • nvim を起動するときに、たとえば--listen /tmp/nvimようにソケットファイルを公開すると、nvim インスタンスに接続します。
  • 現在のバッファを表示します
  • カーソルの位置、モード、ファイル名を取得します
  • vim コマンドとオプションでシェル コマンドを vim 経由で実行します
  • 挿入または置換を使用して編集できます

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ファイルをご覧ください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

Claude がすでに理解している Vim のネイティブのテキスト編集コマンドとワークフローを活用して、軽量のコード支援レイヤーを作成します。

  1. Features
    1. API
      1. Resources
      2. Tools
    2. Limitations
      1. Configuration
        1. Environment Variables
      2. Usage with Claude Desktop
        1. License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.
            Last updated -
            6
            79
            Python
            MIT License
            • Apple
            • Linux
          • -
            security
            A
            license
            -
            quality
            Facilitates integration with the Cursor code editor by enabling real-time code indexing, analysis, and bi-directional communication with Claude, supporting concurrent sessions and automatic reconnection.
            Last updated -
            2
            21
            31
            TypeScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Cursor-compatible toolkit that provides intelligent coding assistance through custom AI tools for code architecture planning, screenshot analysis, code review, and file reading capabilities.
            Last updated -
            1,519
            2
            TypeScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A utility toolkit that enhances Claude's code interaction capabilities by providing seamless tools for Java code analysis, manipulation, and testing workflows.
            Last updated -
            2
            TypeScript

          View all related MCP servers

          ID: s0fywdwp87