mcp-neovim-server
MCP ServerFreeControl Neovim using Model Context Protocol (MCP) and the official neovim/node-client JavaScript library
Capabilities16 decomposed
mcp-to-neovim rpc bridge with socket communication
Medium confidenceTranslates Model Context Protocol requests into Neovim RPC calls via Unix socket communication managed by a NeovimManager singleton. The server implements a three-layer architecture (MCP interface, application logic, socket integration) that maintains a persistent connection to running Neovim instances and serializes/deserializes RPC payloads, enabling AI clients to control Neovim as a remote process without direct binary dependencies.
Uses official neovim/node-client JavaScript library for RPC communication rather than spawning subprocess or implementing custom RPC protocol, ensuring compatibility with Neovim's native RPC interface and reducing maintenance burden. Implements NeovimManager as a singleton pattern to maintain stateful connection across multiple MCP tool invocations.
More reliable than shell-based Neovim control (nvim --remote) because it uses native RPC protocol with proper error handling and connection state management, and more lightweight than embedding a full Neovim instance as a subprocess.
buffer-aware code reading and context extraction
Medium confidenceExposes the nvim://buffers resource that lists all open buffers with metadata (filename, line count, modification status) and implements vim_buffer tool to read full buffer content or specific line ranges. The system maintains awareness of which buffers are currently loaded in the editor session, enabling AI clients to query editor state and extract code context without requiring file system access.
Exposes buffer content through MCP resources (nvim://buffers) rather than only as tool outputs, allowing MCP clients to treat editor buffers as first-class knowledge sources that can be referenced in prompts and context windows. Integrates with Neovim's native buffer management rather than implementing custom file tracking.
More efficient than file system-based code reading because it accesses already-loaded buffers in memory via RPC, avoiding disk I/O and file permission issues. Provides real-time editor state vs static file snapshots.
visual selection and range-based operations
Medium confidenceImplements vim_visual_select tool that creates visual selections (character, line, or block mode) on specified line ranges, and vim_get_selection that retrieves currently selected text. The tools use Neovim's cursor positioning and mode-setting RPC calls to establish selections, then enable subsequent operations (delete, copy, format) on the selected range. Selections are mode-aware (visual, visual-line, visual-block).
Exposes Vim's visual selection modes (character, line, block) as programmable operations rather than keystroke sequences, allowing AI clients to perform mode-specific operations that would be difficult to express otherwise. Uses Neovim's cursor and mode RPC API for precise selection control.
More precise than line-based edits because it supports character-level and block-level selections. More flexible than regex-based operations because it can select arbitrary ranges regardless of content.
mark and register-based navigation and storage
Medium confidenceImplements vim_set_mark and vim_goto_mark tools for creating and navigating to named marks, and vim_get_register/vim_set_register for accessing Vim's register storage. Marks are stored in Neovim's mark table (nvim_buf_set_mark, nvim_buf_get_mark) and registers are accessed via the register API. This enables AI clients to bookmark positions and store text snippets for later retrieval without external state management.
Exposes Vim's native mark and register systems as MCP tools rather than implementing custom bookmarking, allowing AI clients to leverage Vim's built-in navigation and storage without external state management. Marks integrate with Neovim's buffer-local mark table.
More integrated than external bookmarking because it uses Vim's native mark system that persists across editor sessions. More efficient than storing state externally because marks and registers are in-memory and accessed via RPC.
tab and window management for multi-view workflows
Medium confidenceImplements vim_create_tab, vim_close_tab, and vim_switch_tab tools for managing Neovim's tab interface, and vim_split_window/vim_close_window for window management. The tools use Neovim's tab and window RPC API (nvim_command for :tabnew, :split, etc.) to manipulate the editor layout. Tab and window state is queryable through the session resource.
Exposes Neovim's tab and window system as programmable operations rather than requiring keystroke simulation, allowing AI clients to organize complex multi-file workflows with structured layout management. Uses native Neovim commands (:tabnew, :split) via RPC.
More reliable than keystroke-based window management because it uses native RPC commands that don't depend on keybindings or editor state. More flexible than fixed layouts because it allows dynamic tab/window creation based on workflow needs.
code folding and structural navigation
Medium confidenceImplements vim_fold and vim_unfold tools that manage code folding using Neovim's folding API. The tools use Neovim's fold commands (:fold, :unfold) to collapse/expand code regions based on syntax or manual folds. vim_get_folds retrieves fold structure for the current buffer, enabling AI clients to understand code organization and navigate at the structural level rather than line-by-line.
Exposes Neovim's folding system as a way to understand code structure rather than just for visual organization, allowing AI clients to navigate code at the semantic level (functions, classes) rather than raw line numbers. Integrates with Neovim's foldmethod settings.
More efficient than reading entire files for structural analysis because folds provide a hierarchical view. More flexible than AST-based analysis because it respects user's Neovim folding configuration.
contextual workflow guidance via prompts
Medium confidenceExposes neovim_workflow prompt that provides contextual guidance for using the Neovim MCP server effectively. The prompt includes best practices, common patterns, and workflow recommendations tailored to the user's current editor state. Prompts are static templates that MCP clients can include in their system prompts to guide AI behavior when interacting with Neovim.
Provides MCP prompts that guide AI behavior when using Neovim tools, rather than relying on implicit understanding. Allows MCP clients to include workflow guidance in their system prompts for better AI decision-making.
More effective than undocumented tools because it provides explicit guidance on when and how to use each capability. More integrated than external documentation because prompts are delivered through MCP protocol.
error handling and connection state management
Medium confidenceImplements robust error handling throughout the MCP server with try-catch blocks around all Neovim RPC calls, connection state validation, and graceful error reporting. The NeovimManager singleton maintains connection state and automatically reconnects on socket failures. Errors are caught at the RPC layer and returned as structured error responses with error codes and messages, preventing cascading failures.
Implements error handling at the RPC layer with connection state validation, ensuring that transient socket failures don't crash the server. Uses NeovimManager singleton to maintain connection state across multiple tool invocations.
More reliable than naive RPC calls because it validates connection state and handles socket errors gracefully. More informative than silent failures because it returns structured error responses with context.
structured buffer editing with line-level precision
Medium confidenceImplements vim_edit tool that performs targeted text modifications using Neovim's native buffer API with line and column precision. Supports insertion, deletion, and replacement operations on specific line ranges, using Neovim's buffer_set_lines RPC method to atomically update content. The tool validates line numbers and handles edge cases (empty buffers, out-of-range lines) through Neovim's built-in error handling.
Uses Neovim's native buffer_set_lines RPC method for atomic multi-line edits rather than simulating keystrokes or using text replacement patterns. This ensures edits are applied transactionally and respects Neovim's buffer state management, avoiding issues with syntax highlighting or plugin interference.
More reliable than keystroke simulation (used by some editor automation tools) because edits are atomic and don't trigger intermediate buffer states. More precise than regex-based find-replace because it targets exact line ranges regardless of content.
vim command execution with output capture
Medium confidenceImplements vim_command tool that executes arbitrary Vim commands (e.g., :set, :substitute, :normal) through Neovim's command RPC interface and captures output. The tool translates MCP requests into Neovim's nvim_command or nvim_exec RPC calls, enabling access to Neovim's full command language without requiring direct shell execution or keystroke simulation.
Exposes Neovim's full command language through MCP rather than limiting to a predefined set of operations, allowing AI clients to leverage Vim's powerful command syntax and user-defined commands. Uses nvim_exec RPC method for proper command parsing and execution context.
More powerful than tool-based editing because it can execute any Vim command including plugins and custom mappings. More reliable than keystroke simulation because commands execute in Neovim's command context rather than as input events.
search and replace with pattern matching
Medium confidenceImplements vim_search and vim_search_replace tools that perform pattern-based text search and replacement using Neovim's native search capabilities. vim_search uses Neovim's search API to find patterns and return line numbers and context, while vim_search_replace executes :substitute commands with optional flags (case-insensitive, global, etc.). Both tools leverage Neovim's regex engine rather than implementing custom pattern matching.
Uses Neovim's native search API and :substitute command rather than implementing custom regex matching, ensuring compatibility with user's Vim regex settings and plugins. Supports Vim-specific regex features like lookahead/lookbehind and character classes that differ from standard regex.
More powerful than simple string matching because it supports full regex patterns and Vim's regex extensions. More efficient than reading entire buffer and searching in JavaScript because it leverages Neovim's optimized search implementation.
multi-buffer navigation and switching
Medium confidenceImplements vim_buffer_switch tool that changes the active buffer in Neovim using the buffer number or name, and vim_file_open that opens files by path. Both tools use Neovim's native buffer management RPC calls (nvim_set_current_buf, nvim_command for :edit) to navigate the editor state. The nvim://buffers resource provides the list of available buffers for navigation decisions.
Integrates buffer switching with the nvim://buffers resource, allowing MCP clients to query available buffers and make informed navigation decisions rather than blindly switching by number. Uses Neovim's native buffer API rather than simulating :buffer commands.
More reliable than keystroke-based navigation (e.g., simulating :buffer N) because it uses native RPC calls that don't depend on editor state or keybindings. Provides structured buffer list vs requiring clients to parse editor output.
buffer persistence and file operations
Medium confidenceImplements vim_buffer_save tool that writes buffer content to disk using Neovim's :write command, and vim_file_open that creates new buffers for files. The tools leverage Neovim's native file I/O and buffer management rather than implementing custom file writing. vim_buffer_save respects Neovim's file format settings and handles encoding automatically.
Delegates file I/O to Neovim's native :write command rather than implementing custom file writing, ensuring compatibility with Neovim's file format settings, encoding detection, and file type plugins. Respects user's Neovim configuration for file handling.
More reliable than direct file system writes because it respects Neovim's file format settings and encoding. More integrated than external file operations because it uses Neovim's buffer state as source of truth.
session state and editor metadata exposure
Medium confidenceExposes nvim://session resource that provides current editor session metadata including active buffer, cursor position, window layout, and editor mode. The resource is populated by querying Neovim's current state via RPC calls (nvim_get_current_buf, nvim_win_get_cursor, nvim_get_mode) and returns structured JSON. This enables MCP clients to understand editor context without making separate tool calls.
Exposes editor state as a queryable MCP resource rather than requiring clients to call individual tools, allowing prompts and context to reference session state directly. Provides structured metadata that MCP clients can use for conditional logic without parsing text output.
More efficient than making multiple tool calls to query individual state properties because it returns all metadata in one RPC round-trip. More reliable than inferring editor state from buffer content because it queries Neovim's actual state.
grep-based code search across buffers
Medium confidenceImplements vim_grep tool that performs pattern-based search across multiple buffers or files using Neovim's :grep command (which delegates to external grep/ripgrep). The tool executes :grep with a pattern and optional file filter, captures results, and returns structured match data with file paths, line numbers, and context. Results are parsed from Neovim's quickfix list.
Leverages Neovim's :grep command and quickfix integration rather than implementing custom multi-file search, allowing users to configure their preferred grep tool (ripgrep, ag, etc.) and benefit from Neovim's search result navigation. Respects .gitignore and other grep configuration.
More efficient than reading all files and searching in JavaScript because it delegates to optimized external tools (ripgrep). More flexible than hardcoded search because it respects user's Neovim grepprg configuration.
macro recording and playback automation
Medium confidenceImplements vim_record_macro and vim_playback_macro tools that enable recording and executing Vim macros through MCP. vim_record_macro captures a sequence of Vim commands into a named register, while vim_playback_macro executes a recorded macro a specified number of times. Both tools use Neovim's register management RPC API (nvim_get_register, nvim_set_register) to store and retrieve macro content.
Exposes Vim's native macro system through MCP rather than simulating keystrokes, allowing AI clients to leverage Vim's powerful macro recording and playback without implementing custom automation logic. Uses Neovim's register API for reliable macro storage and retrieval.
More powerful than keystroke simulation because macros can include complex Vim commands and motions that are difficult to express as individual keystrokes. More reliable than custom automation because it uses Vim's battle-tested macro engine.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with mcp-neovim-server, ranked by overlap. Discovered automatically through the match graph.
mcphub.nvim
An MCP client for Neovim that seamlessly integrates MCP servers into your editing workflow with an intuitive interface for managing, testing, and using MCP servers with your favorite chat plugins.
ollama-mcp-bridge
Bridge between Ollama and MCP servers, enabling local LLMs to use Model Context Protocol tools
mcphub.nvim
** A Neovim plugin that provides a UI and api to interact with MCP servers.
@modelcontextprotocol/sdk
Model Context Protocol implementation for TypeScript
OpenMCP Client
** - An all-in-one vscode/trae/cursor plugin for MCP server debugging. [Document](https://kirigaya.cn/openmcp/) & [OpenMCP SDK](https://kirigaya.cn/openmcp/sdk-tutorial/).
ida-pro-mcp
AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
Best For
- ✓AI-assisted developers using Claude Desktop with Neovim as primary editor
- ✓Teams building LLM-powered development tools that need editor integration
- ✓Neovim power users wanting to automate complex editing workflows via AI
- ✓AI code analysis workflows that need live editor context
- ✓Developers wanting Claude to understand their current editing session
- ✓Multi-file refactoring scenarios where AI needs to see related buffers
- ✓Bulk code transformations that operate on line ranges
- ✓Column-based editing tasks (block visual mode)
Known Limitations
- ⚠Requires Neovim instance to be running and listening on a socket (typically /tmp/nvim-*/0)
- ⚠No built-in connection pooling — single NeovimManager singleton limits concurrent client requests
- ⚠Socket communication adds ~50-100ms latency per RPC call compared to direct in-process access
- ⚠Depends on neovim/node-client library which may lag behind latest Neovim API versions
- ⚠Only reads buffers currently open in Neovim — cannot access files not loaded in editor
- ⚠No incremental sync — each read fetches full buffer content, inefficient for large files (>10MB)
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Oct 11, 2025
About
Control Neovim using Model Context Protocol (MCP) and the official neovim/node-client JavaScript library
Categories
Alternatives to mcp-neovim-server
Are you the builder of mcp-neovim-server?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →