Skip to content

A Model Context Protocol (MCP) server that provides seamless integration with Neovim instances, enabling AI assistants to interact with your editor through connections and access diagnostic information via structured resources.

License

Notifications You must be signed in to change notification settings

linw1995/nvim-mcp

Repository files navigation

Neovim MCP Server

codecov GitHub Actions Workflow Status

A Model Context Protocol (MCP) server that provides seamless integration with Neovim instances, enabling AI assistants to interact with your editor through connections and access diagnostic information via structured resources. Supports both stdio and HTTP server transport modes for different integration scenarios.

Features

  • Multi-Connection Support: Manage multiple concurrent Neovim instances
  • LSP Integration: Complete LSP workflow with code actions, hover, and diagnostics
  • Universal Document Identifier: Work with files by buffer ID, relative path, or absolute path
  • MCP Resources: Structured diagnostic data via connection-aware URI schemes
  • Multi-Transport Support: Both stdio and HTTP server transport modes
  • Dynamic Tool System ⚠️ (Experimental): User-extensible custom tools
  • Plugin Integration: Automatic setup through Neovim plugin

Installation

Use Cargo install from crates.io

cargo install nvim-mcp

Using Nix

nix profile install github:linw1995/nvim-mcp#nvim-mcp

From Source

git clone https://github.com/linw1995/nvim-mcp.git && cd nvim-mcp
cargo install --path .

Demo

Diagnostic Analysis and Code Fixes

See how the nvim-mcp server helps fix workspace diagnostics in real-time using AI assistance and LSP integration. (From #10)

discussion_10_fix_workspace_diagnostics.kimi-turbo.mp4

LSP Hover Translation

Seamlessly translate LSP hover information into your native language without breaking your development workflow. (From #85)

translate_hover.mp4

Smart Context Retrieval

Efficiently retrieve related code context for symbols under the cursor through LSP integration, eliminating the need for manual searching. (From #86)

analyze.kimi-turbo.mp4

Quick Start

1. Setup Neovim Integration

With a plugin manager like lazy.nvim:

return {
    "linw1995/nvim-mcp",
    build = "cargo install --path .",
    opts = {},
}

2. Configure claude or other MCP clients

# Auto-connect to current project Neovim instances (recommended)
claude mcp add -s local nvim -- nvim-mcp --log-file . \
  --log-level debug --connect auto

# Analyze diagnostics in current Neovim instance
claude "analyze @nvim:nvim-diagnostics://"

Documentation

For detailed information, see:

Development

Basic development setup:

# Enter development shell
nix develop .

# Run tests
cargo test -- --show-output

# Build and run
cargo run -- --connect auto

See Development Guide for complete setup instructions, testing procedures, and contribution guidelines.

About

A Model Context Protocol (MCP) server that provides seamless integration with Neovim instances, enabling AI assistants to interact with your editor through connections and access diagnostic information via structured resources.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages