# mcphub.nvim

> MCP Server

Mcphub.nvim is a Neovim plugin that integrates MCP servers into your workflow, offering a centralized configuration, intuitive UI, and programmatic API access for managing tools and resources, especially for LLM integration.

## Overview

- **Category:** Developer Tools
- **Language:** Lua
- **Stars:** 1783
- **Forks:** 12
- **Owner:** ravitemer
- **GitHub:** https://github.com/ravitemer/mcphub.nvim
- **Created:** 2025-02-19T06:55:16+00:00
- **Updated:** 2025-03-28T20:05:23+00:00
- **Source:** https://model-context-protocol.com/servers/neovim-mcp-server-management-plugin

## Setup

## Setup
Using [lazy.nvim](https://github.com/folke/lazy.nvim):

```lua
{
    "ravitemer/mcphub.nvim",
    dependencies = {
        "nvim-lua/plenary.nvim",  -- Required for Job and HTTP requests
    },
    -- cmd = "MCPHub", -- lazily start the hub when `MCPHub` is called
    build = "npm install -g mcp-hub@latest", -- Installs required mcp-hub npm module
    config = function()
        require("mcphub").setup({
            -- Required options
            port = 3000,  -- Port for MCP Hub server
            config = vim.fn.expand("~/mcpservers.json"),  -- Absolute path to config file

            -- Optional options
            on_ready = function(hub)
                -- Called when hub is ready
            end,
            on_error = function(err)
                -- Called on errors
            end,
            log = {
                level = vim.log.levels.WARN,
                to_file = false,
                file_path = nil,
                prefix = "MCPHub"
            },
        })
    end
}
```

Example configuration file:

```json
{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    },
    "todoist": {
      "command": "npx",
      "args": ["-y", "@abhiz123/todoist-mcp-server"],
      "disabled": true,
      "env": {
        "TODOIST_API_TOKEN": "your-api-token-here"
      }
    }
  }
}
```

### Requirements

- Neovim >= 0.8.0
- Node.js >= 18.0.0
- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
- [mcp-hub](https://github.com/ravitemer/mcp-hub) (automatically installed via build command)

## Tools

## Available Tools

1.  Simple single-command interface (`:MCPHub`)
2.  Integrated Hub view for managing servers and tools (Dynamically enable/disable servers and tools to optimize token usage, Start/stop servers with persistent state, Enable/disable specific tools per server, Configure custom instructions per server, State persists across restarts)
3.  Marketplace Integration (Browse available MCP servers with details and stats, Sort, filter by category, and search servers, View server documentation and installation guides, One-click installation via Avante/CodeCompanion)
4.  Interactive Testing (Real-time tool testing interface, Resource browsing and access, Built-in documentation and help)
5.  Performance and Reliability (Parallel startup for improved performance, Automatic server lifecycle management, Smart shutdown handling with configurable delay)
6.  Developer-friendly (Both sync and async operations supported, Clean client registration/cleanup, Comprehensive API for tool and resource access)
