MCP配置管理工具

CC-MCP是一个命令行工具,用于管理Claude Code中的MCP配置,避免禁用时永久删除配置,实现快速重新启用。

  • by lisaross
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 lisaross/cc-mcp

使用说明

CC-MCP:克劳德代码MCP管理器

A. 最少的;最低限度的 一个解决关键问题的命令行工具: Claude Code 内置的禁用按钮将永久删除 MCP 配置。

CC-MCP在禁用MCP设置时会保留这些设置,从而实现无需重新配置即可立即重新激活。

问题

当你使用Claude Code内置的用户界面禁用一个MCP时,它会永久删除该配置 mcp.json对于具有复杂设置(API密钥、自定义路径、环境变量)的MCP,这意味着需要从头开始完全重新配置。

用户痛点: 我花了20分钟设置我的数据库MCP,包括连接字符串和API密钥。我为了设计任务将其禁用了,现在它完全消失了。我得重新开始

解决方案

CC-MCP在(不同系统/环境中)移动MCP配置 mcp.json (已启用)和 mcp.json.disabled (禁用)它们,而不是删除它们。

结果: 即时重新启用,且不丢失任何配置数据。

安装

快速安装(推荐)

# One-command installation
curl -fsSL https://raw.githubusercontent.com/lisaross/cc-mcp/main/install.sh | sh

这个脚本将:

  • 检查Deno是否已安装(如未安装,则提供安装帮助)
  • 自动配置PATH
  • 全局安装CC-MCP
  • 验证安装
  • 显示快速入门指南

手动安装

# Clone the repository
git clone https://github.com/lisaross/cc-mcp.git
cd cc-mcp

# Install globally  
deno install --global --allow-read --allow-write --name cc-mcp --force src/mvp/cc-mcp-mvp.ts

# Add to PATH (if needed)
export PATH="/Users/$USER/.deno/bin:$PATH"

# Test installation
cc-mcp --help

备选方案:直接运行

# Clone and run without installation
git clone https://github.com/lisaross/cc-mcp.git
cd cc-mcp

# Run directly
deno run --allow-read --allow-write src/mvp/cc-mcp-mvp.ts

# Or use the task runner
deno task mvp

所需权限:

  • --allow-read读取MCP配置文件
  • --allow-write编写MCP配置文件

⚠️ 重要提示:Claude 代码重启要求

将此添加到您的全局Claude代码记忆中 (~/.claude/CLAUDE.md):

## CC-MCP Usage Notes
- When CC-MCP shows "⚠️ Restart Claude Code for changes to take effect:", inform the user that a restart is required before MCP changes take effect
- If no restart occurs within 30 seconds, continue with a warning that MCP changes may not be active
- MCP changes only take effect after Claude Code restarts

用法

# Show all MCPs with status (default action)
cc-mcp
cc-mcp list
cc-mcp ls

# Enable a specific MCP 
cc-mcp enable github
cc-mcp e github

# Disable a specific MCP (preserves configuration)
cc-mcp disable github  
cc-mcp d github

# Initialize with working examples
cc-mcp init

首次运行

首次使用时,CC-MCP会自动创建:

  • mcp.json 和;与;带着 文件系统 MCP已启用(安全,即刻可用)
  • mcp.json.disabled 与;带有;用 GitHub MCP示例(含占位符标记)

您可以立即开始使用文件系统MCP,然后根据需要配置其他MCP。

示例工作流程

# See current status
$ cc-mcp
 filesystem
 github

# Enable GitHub MCP (after adding your token to mcp.json.disabled)
$ cc-mcp enable github
 Enabled github
�  Restart Claude Code: claude -c

# Later, disable for context management
$ cc-mcp disable github
 Disabled github (configuration preserved)
�  Restart Claude Code: claude -c

# Re-enable instantly - no reconfiguration needed!
$ cc-mcp enable github
 Enabled github
�  Restart Claude Code: claude -c

关键点: 配置被保存在 .mcp.json.disabled因此,重新启用时无需任何设置。

主要优势

  • 配置保留再也不用丢失MCP设置
  • 即时重新启用无需重新配置
  • 上下文管理仅启用当前任务所需的功能组件(MCPs)
  • 零学习曲线立即工作,自动搭建脚手架
  • 安全从不破坏性地编辑配置

配置文件

  • mcp.json当前启用的MCP服务器
  • mcp.json.disabled禁用的MCP服务器(配置已保留)

要求

  • Deno(注:Deno是一个JavaScript和TypeScript运行时,也指代一个技术或项目名称,具体翻译可能需根据上下文调整,此处直接音译) (适用于 macOS: brew install deno)
  • 克劳德·科德 带有MCP支持的项目
  • 项目目录的写入权限

MVP范围

这是一个 真正的最有价值球员(MVP) 仅专注于配置保留:

 包含列出、启用、禁用、自动搭建(或自动生成脚手架)
L 延期交互模式、复杂提示、备份系统

未来的版本将根据用户反馈增加更多功能。

做出贡献

发现了一个错误或者想要一个功能? 打开一个问题(或报告一个问题).

这个项目遵循MVP(最小可行性产品)原则——我们提供简单且有效的解决方案,并根据真实用户需求进行迭代。


警告: 不要使用Claude Code内置的MCP禁用按钮——它会永久删除配置。请始终使用CC-MCP来保存您的设置。