Skip to main content
Glama

MCP Manager

CI License: MIT Python 3.10+

通用 MCP 服务器管理器 — 在一个地方添加、删除、监控和配置所有 MCP 服务器。

功能

  • 7 种集成环境 — OpenCode、Claude Desktop、Cursor、Windsurf、Cline、Zed、Continue.dev

  • 23 个工具 — 服务器管理、健康检查、令牌轮换、跨集成环境同步

  • 20+ 服务器目录 — GitHub、Supabase、Playwright、Docker、PostgreSQL 等

  • 加密令牌 — 使用 PBKDF2 密钥派生的 Fernet AES-128-CBC

  • 跨集成环境同步 — 在不同 AI 编码工具之间迁移服务器

Related MCP server: git-org-group-cred-vault

快速开始

git clone https://github.com/kobramantra-debug/mcp-manager-mcp-manage.git
cd mcp-manager-mcp-manage
pip install -e .

安装

从源码安装

git clone https://github.com/kobramantra-debug/mcp-manager-mcp-manage.git
cd mcp-manager-mcp-manage
pip install -e .

Docker

docker build -t mcp-manager .

配置

环境变量

变量

默认值

描述

MCP_HARNESS

opencode

要管理的活动集成环境

MCP_CONFIG_PATH

(自动检测)

覆盖配置文件路径

MCP_MANAGER_MASTER_PASSWORD

(无)

用于 Fernet 加密的主密码

OpenCode

添加到 ~/.config/opencode/opencode.json:

{
  "mcp": {
    "mcp-manager": {
      "type": "local",
      "command": ["python", "-m", "src"],
      "cwd": "/path/to/mcp-manager",
      "enabled": true
    }
  }
}

Claude Desktop

添加到 %APPDATA%/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-manager": {
      "command": "python",
      "args": ["-m", "src"],
      "cwd": "/path/to/mcp-manager"
    }
  }
}

Cursor

添加到 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "mcp-manager": {
      "command": "python",
      "args": ["-m", "src"],
      "cwd": "/path/to/mcp-manager"
    }
  }
}

Docker (STDIO)

{
  "mcp": {
    "mcp-manager": {
      "type": "docker",
      "command": ["docker", "run", "-i", "--rm", "mcp-manager"],
      "enabled": true
    }
  }
}

示例

1. 列出所有集成环境并查看哪些已安装

list_harnesses_info()
{
  "harnesses": [
    {"id": "opencode", "name": "OpenCode", "installed": true, "is_active": true},
    {"id": "claude-desktop", "name": "Claude Desktop", "installed": true, "is_active": false},
    {"id": "cursor", "name": "Cursor", "installed": false, "is_active": false},
    {"id": "windsurf", "name": "Windsurf", "installed": false, "is_active": false},
    {"id": "cline", "name": "Cline", "installed": false, "is_active": false},
    {"id": "zed", "name": "Zed", "installed": false, "is_active": false},
    {"id": "continue", "name": "Continue.dev", "installed": false, "is_active": false}
  ],
  "active": "opencode",
  "installed_count": 2
}

2. 切换到 Claude Desktop 并列出其服务器

switch_harness("claude-desktop")
list_servers()
{
  "harness": "Claude Desktop",
  "servers": [
    {"name": "github", "enabled": true, "type": "docker"},
    {"name": "playwright", "enabled": true, "type": "npx"}
  ],
  "count": 2
}

3. 从目录中添加 GitHub MCP 服务器

add_from_catalog("github")
{
  "success": true,
  "action": "added",
  "server": "github",
  "harness": "OpenCode",
  "catalog_entry": "github",
  "config": {
    "type": "docker",
    "command": ["docker", "run", "-i", "--rm", "-e", "GITHUB_TOKEN={env:GITHUB_TOKEN}", "ghcr.io/github/github-mcp-server"],
    "enabled": true
  }
}

4. 添加自定义远程服务器

add_server(
    name="my-api",
    server_type="remote",
    url="https://api.example.com/mcp",
    env_vars="API_KEY=sk-123,BASE_URL=https://api.example.com"
)
{
  "success": true,
  "action": "added",
  "server": "my-api",
  "config": {
    "type": "remote",
    "url": "https://api.example.com/mcp",
    "environment": {"API_KEY": "sk-123", "BASE_URL": "https://api.example.com"},
    "enabled": true
  }
}

5. 对所有服务器运行健康检查

health_check()
{
  "harness": "opencode",
  "summary": {"total": 3, "healthy": 2, "unhealthy": 1, "unknown": 0, "timeout": 0},
  "results": {
    "github": {"status": "healthy", "message": "Server: github-mcp-server", "latency_ms": 1250.3},
    "playwright": {"status": "healthy", "message": "Server: playwright", "latency_ms": 890.1},
    "my-api": {"status": "unhealthy", "message": "No response (exit 1)", "latency_ms": 5000.0}
  }
}

6. 将所有服务器从 OpenCode 同步到 Cursor

sync_to_harness("cursor")
{
  "success": true,
  "source": "OpenCode",
  "target": "Cursor",
  "servers_synced": 3,
  "added": 3,
  "updated": 0
}

7. 轮换带有过期时间的令牌

rotate_token("github", "ghp_new_token_abc123", expires_at="2026-12-31")
{
  "success": true,
  "action": "token_rotated",
  "server": "github",
  "preview": "ghp_***abc123",
  "expires_at": "2026-12-31"
}

8. 搜索服务器目录

search_catalog("database")
{
  "results": [
    {"id": "postgres", "name": "PostgreSQL", "description": "PostgreSQL database server", "category": "database"},
    {"id": "sqlite", "name": "SQLite", "description": "SQLite database server", "category": "database"}
  ],
  "count": 2
}

9. 为不同的集成环境导出配置

export_for_harness("claude-desktop")
{
  "source_harness": "opencode",
  "target_harness": "claude-desktop",
  "config": {
    "mcpServers": {
      "github": {"command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/github/github-mcp-server"]},
      "playwright": {"command": "npx", "args": ["-y", "@anthropic/playwright-mcp"]}
    }
  },
  "note": "Import this JSON into Claude Desktop"
}

10. 列出所有存储的令牌(安全 — 仅预览)

list_all_tokens()
{
  "tokens": {
    "github": {"token_preview": "ghp_***abc123", "storage_backend": "encrypted_sqlite"},
    "supabase": {"token_preview": "sb-***xyz789", "storage_backend": "encrypted_sqlite"}
  },
  "count": 2
}

工具参考

集成环境管理

工具

描述

list_harnesses_info

列出所有集成环境及其安装状态

switch_harness

切换活动集成环境

get_active_harness

获取当前集成环境信息

服务器管理

工具

描述

list_servers

列出已配置的服务器

add_server

添加新服务器

remove_server

删除服务器

get_server_detail

获取服务器详细信息

enable_server

启用已禁用的服务器

disable_server

禁用服务器

健康与监控

工具

描述

test_connection

测试单个服务器

health_check

测试所有服务器

get_logs

获取健康检查历史

令牌管理

工具

描述

rotate_token

更新 API 令牌

retrieve_token

获取解密后的令牌(请谨慎使用)

list_all_tokens

列出存储的令牌(仅预览)

get_token_history

获取轮换历史

list_token_backends

显示加密状态

导出 / 导入 / 同步

工具

描述

export_config

将配置导出为 JSON

import_config

从 JSON 导入配置

export_for_harness

以另一种集成环境格式导出

sync_to_harness

将服务器同步到另一个集成环境

目录

工具

描述

search_catalog

搜索服务器目录

add_from_catalog

从目录添加服务器

支持的集成环境

集成环境

配置路径

格式

OpenCode

~/.config/opencode/opencode.json

mcp (keyed object)

Claude Desktop

%APPDATA%/Claude/claude_desktop_config.json

mcpServers (keyed object)

Cursor

~/.cursor/mcp.json

mcpServers (keyed object)

Windsurf

~/.codeium/windsurf/mcp_config.json

mcpServers (keyed object)

Cline

%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

mcpServers (keyed object)

Zed

%APPDATA%/Zed/settings.json

context_servers (nested object)

Continue.dev

~/.continue/config.json

mcpServers (array)

服务器目录

服务器

类型

描述

github

docker

GitHub MCP 服务器

supabase

npx

Supabase MCP 服务器

playwright

npx

Playwright 浏览器自动化

chrome-devtools

npx

Chrome DevTools 协议

context7

npx

Context7 文档查找

filesystem

local

文件系统访问

git

local

Git 操作

postgres

npx

PostgreSQL 数据库

sqlite

npx

SQLite 数据库

docker

local

Docker 管理

brave-search

npx

Brave Search API

fetch

npx

HTTP 抓取工具

memory

local

知识图谱记忆

slack

npx

Slack 工作区集成

gdrive

npx

Google Drive 访问

google-maps

npx

Google Maps API

puppeteer

npx

Puppeteer 浏览器自动化

everything

npx

通用搜索

stitch

npx

Stitch UI 设计

令牌安全

令牌使用 Fernet (AES-128-CBC) 存储在加密的 SQLite 数据库中。

设置 MCP_MANAGER_MASTER_PASSWORD 以启用加密:

# Linux/macOS
export MCP_MANAGER_MASTER_PASSWORD="your-secure-password"

# Windows
set MCP_MANAGER_MASTER_PASSWORD=your-secure-password

如果没有主密码,令牌将以明文存储(不建议用于生产环境)。

许可证

MIT 许可证 — 详情请参阅 LICENSE。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    MCP server for managing multiple SSH servers via AI assistants, offering tools for remote command execution, file operations, and system monitoring.
    11
    45 PyPI
    2
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables LLMs to manage, aggregate, and proxy other MCP servers dynamically, including discovering, adding, enabling, disabling, and configuring servers while exposing their tools under unified prefixes.
    -