Skip to content
Back to search

mcp-neovim-server

Control Neovim using Model Context Protocol (MCP) and the official neovim/node-client JavaScript library

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/bigcodegen--mcp-neovim-server/badge.svg)](/listings/bigcodegen--mcp-neovim-server)

HTML

<a href="/listings/bigcodegen--mcp-neovim-server"><img src="/api/listings/bigcodegen--mcp-neovim-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Option 1: DXT Package (Recommended)

1. Download the latest `.dxt` file from [Releases](https://github.com/bigcodegen/mcp-neovim-server/releases) 2. Drag the file to Claude Desktop

Option 2: Manual Installation

Add this to your `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"
      }
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 159 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Neovim MCP Server
  2. Connect Claude Desktop (or any Model Context Protocol client) to Neovim using MCP and the official neovim/node-client JavaScript library. This server leverages Vim's native text editing commands and workflows, which Claude already understands, to create a lightweight code or general purpose AI text assistance layer.
  3. <a href="https://glama.ai/mcp/servers/s0fywdwp87"><img width="380" height="200" src="https://glama.ai/mcp/servers/s0fywdwp87/badge" alt="mcp-neovim-server MCP server" /></a>
  4. ## Features
  5. - Connects to your nvim instance if you expose a socket file, for example `--listen /tmp/nvim`, when starting nvim
  6. - Views your current buffers and manages buffer switching
  7. - Gets cursor location, mode, file name, marks, registers, and visual selections
  8. - Runs vim commands and optionally shell commands through vim
  9. - Can make edits using insert, replace, or replaceAll modes
  10. - Search and replace functionality with regex support
  11. - Project-wide grep search with quickfix integration
  12. - Comprehensive window management
  13. - Health monitoring and connection diagnostics
  14. ## API
  15. ### Resources
  16. - `nvim://session`: Current neovim text editor session
  17. - `nvim://buffers`: List of all open buffers in the current Neovim session with metadata including modified status, syntax, and window IDs
  18. ### Tools
  19. #### Core Tools
  20. - **vim_buffer**
  21. - Get buffer contents with line numbers (supports filename parameter)
  22. - Input `filename` (string, optional) - Get specific buffer by filename
  23. - Returns numbered lines with buffer content
  24. - **vim_command**
  25. - Send a command to VIM for navigation, spot editing, and line deletion
  26. - Input `command` (string)
  27. - Runs vim commands with `nvim.replaceTermcodes`. Multiple commands work with newlines
  28. - Shell commands supported with `!` prefix when `ALLOW_SHELL_COMMANDS=true`
  29. - On error, `'nvim:errmsg'` contents are returned
  30. - **vim_status**
  31. - Get comprehensive Neovim status
  32. - Returns cursor position, mode, filename, visual selection with enhanced detection, window layout, current tab, marks, registers, working directory, LSP client info, and plugin detection
  33. - Enhanced visual selection reporting: detects visual mode type (character/line/block), provides accurate selection text, start/end positions, and last visual selection marks
  34. - **vim_edit**
  35. - Edit lines using insert, replace, or replaceAll modes
  36. - Input `startLine` (number), `mode` (`"insert"` | `"replace"` | `"replaceAll"`), `lines` (string)
  37. - insert: insert lines at startLine
  38. - replace: replace lines starting at startLine
  39. - replaceAll: replace entire buffer contents
  40. - **vim_window**
  41. - Manipulate Neovim windows (split, vsplit, close, navigate)
  42. - Input `command` (string: "split", "vsplit", "only", "close", "wincmd h/j/k/l")
  43. - **vim_mark**
  44. - Set named marks at specific positions
  45. - Input `mark` (string: a-z), `line` (number), `column` (number)
  46. - **vim_register**
  47. - Set content of registers
  48. - Input `register` (string: a-z or "), `content` (string)
  49. - **vim_visual**
  50. - Create visual mode selections
  51. - Input `startLine` (number), `startColumn` (number), `endLine` (number), `endColumn` (number)
  52. #### Enhanced Buffer Management
  53. - **vim_buffer_switch**
  54. - Switch between buffers by name or number
  55. - Input `identifier` (string | number) - Buffer name or number
  56. - **vim_buffer_save**
  57. - Save current buffer or save to specific filename
  58. - Input `filename` (string, optional) - Save to specific file
  59. - **vim_file_open**
  60. - Open files into new buffers
  61. - Input `filename` (string) - File to open
  62. #### Search and Replace
  63. - **vim_search**
  64. - Search within current buffer with regex support
  65. - Input `pattern` (string), `ignoreCase` (boolean, optional), `wholeWord` (boolean, optional)
  66. - **vim_search_replace**
  67. - Find and replace with advanced options
  68. - Input `pattern` (string), `replacement` (string), `global` (boolean, optional), `ignoreCase` (boolean, optional), `confirm` (boolean, optional)
  69. - **vim_grep**
  70. - Project-wide search using vimgrep with quickfix list
  71. - Input `pattern` (string), `filePattern` (string, optional) - File pattern to search
  72. #### Advanced Workflow Tools
  73. - **vim_macro**
  74. - Record, stop, and play Vim macros
  75. - Input `action` ("record" | "stop" | "play"), `register` (string, a-z), `count` (number, optional)
  76. - **vim_tab**
  77. - Complete tab management
  78. - Input `action` ("new" | "close" | "next" | "prev" | "first" | "last" | "list"), `filename` (string, optional)
  79. - **vim_fold**
  80. - Code folding operations
  81. - Input `action` ("create" | "open" | "close" | "toggle" | "openall" | "closeall" | "delete"), `startLine`/`endLine` (numbers, for create)
  82. - **vim_jump**
  83. - Jump list navigation
  84. - Input `direction` ("back" | "forward" | "list")
  85. #### System Tools
  86. - **vim_health**
  87. - Check Neovim connection health and socket status
  88. Using this comprehensive set of **19 tools**, Claude can peer into your neovim session, navigate buffers, perform searches, make edits, record macros, manage tabs and folds, and handle your complete development workflow with standard Neovim features.
  89. ### Prompts
  90. - **neovim_workflow**: Get contextual help and guidance for common Neovim workflows including editing, navigation, search, buffer management, window operations, and macro usage. Provides step-by-step instructions for accomplishing tasks with the available MCP tools.
  91. ## Error Handling
  92. The server implements comprehensive error handling with custom error classes and consistent error responses:
  93. - **NeovimConnectionError**: Socket connection failures with detailed messages
  94. - **NeovimCommandError**: Command execution failures with command context
  95. - **NeovimValidationError**: Input validation failures
  96. **New in v0.5.2**: All tools now include robust try-catch error handling that returns meaningful error messages in proper MCP format. Features include connection health monitoring, graceful error propagation, and actionable error messages to help diagnose issues.
  97. ## Limitations
  98. - May not interact well with complex neovim configurations or plugins
  99. - Shell command execution is disabled by default for security
  100. - Socket connection required - won't work with standard vim
  101. ## Configuration
  102. ### Environment Variables
  103. - `ALLOW_SHELL_COMMANDS`: Set to 'true' to enable shell command execution (e.g. `!ls`). Defaults to false for security.
  104. - `NVIM_SOCKET_PATH`: Set to the path of your Neovim socket. Defaults to '/tmp/nvim' if not specified.
  105. ## Installation
  106. ### Option 1: DXT Package (Recommended)
  107. 1. Download the latest `.dxt` file from [Releases](https://github.com/bigcodegen/mcp-neovim-server/releases)
  108. 2. Drag the file to Claude Desktop
  109. ### Option 2: Manual Installation
  110. Add this to your `claude_desktop_config.json`:
  111. ```json
  112. {
  113. "mcpServers": {
  114. "MCP Neovim Server": {
  115. "command": "npx",
  116. "args": [
  117. "-y",
  118. "mcp-neovim-server"
  119. ],
  120. "env": {
  121. "ALLOW_SHELL_COMMANDS": "true",
  122. "NVIM_SOCKET_PATH": "/tmp/nvim"
  123. }
  124. }
  125. }
  126. }
  127. ```
  128. ## License
  129. This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.