mcp-setup by yeachan-heo/oh-my-claudecode
npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill mcp-setup配置模型上下文协议(MCP)服务器,以扩展 Claude Code 的能力,使其能够使用外部工具,如网络搜索、文件系统访问和 GitHub 集成。
MCP 服务器提供了 Claude Code 智能体可以使用的额外工具。此技能可帮助您使用 claude mcp add 命令行界面配置流行的 MCP 服务器。
使用 AskUserQuestion 向用户展示可用的 MCP 服务器选项:
问题: "您想配置哪个 MCP 服务器?"
选项:
无需 API 密钥。可立即使用。
询问 API 密钥:
您有 Exa API 密钥吗?
- 在此获取:https://exa.ai
- 输入您的 API 密钥,或输入 'skip' 稍后配置
询问允许访问的目录:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
文件系统 MCP 应有权访问哪些目录?
默认:当前工作目录
输入逗号分隔的路径,或按 Enter 使用默认值
询问令牌:
您有 GitHub 个人访问令牌吗?
- 在此创建:https://github.com/settings/tokens
- 推荐范围:repo, read:org
- 输入您的令牌,或输入 'skip' 稍后配置
使用 claude mcp add 命令配置每个 MCP 服务器。CLI 会自动处理 settings.json 的更新和合并。
claude mcp add context7 -- npx -y @upstash/context7-mcp
claude mcp add -e EXA_API_KEY=<用户提供的密钥> exa -- npx -y exa-mcp-server
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem <允许访问的目录>
选项 1:Docker(本地)
claude mcp add -e GITHUB_PERSONAL_ACCESS_TOKEN=<用户提供的令牌> github -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
选项 2:HTTP(远程)
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
注意:Docker 选项需要安装 Docker。HTTP 选项更简单,但功能可能有所不同。
配置完成后,验证 MCP 服务器是否已正确设置:
# 列出已配置的 MCP 服务器
claude mcp list
这将显示所有已配置的 MCP 服务器及其状态。
MCP 服务器配置完成!
已配置的服务器:
[列出已配置的服务器]
后续步骤:
1. 重启 Claude Code 以使更改生效
2. 所有智能体都将可以使用已配置的 MCP 工具
3. 运行 `claude mcp list` 以验证配置
使用提示:
- Context7:询问库文档(例如,"如何使用 React hooks?")
- Exa:用于网络搜索(例如,"搜索最新的 TypeScript 功能")
- 文件系统:超出工作目录的扩展文件操作
- GitHub:与 GitHub 仓库、问题和 PR 交互
故障排除:
- 如果 MCP 服务器未出现,请运行 `claude mcp list` 检查状态
- 确保已安装 Node.js 18+ 以使用基于 npx 的服务器
- 对于 GitHub Docker 选项,确保 Docker 已安装并正在运行
- 运行 /oh-my-claudecode:omc-doctor 来诊断问题
管理 MCP 服务器:
- 添加更多服务器:/oh-my-claudecode:mcp-setup 或 `claude mcp add ...`
- 列出服务器:`claude mcp list`
- 移除服务器:`claude mcp remove <服务器名称>`
如果用户选择"自定义":
询问:
stdio(默认)或 httpnpx my-mcp-server)https://example.com/mcp)然后构建并运行相应的 claude mcp add 命令:
对于 stdio 服务器:
# 不带环境变量
claude mcp add <服务器名称> -- <命令> [参数...]
# 带环境变量
claude mcp add -e KEY1=value1 -e KEY2=value2 <服务器名称> -- <命令> [参数...]
对于 HTTP 服务器:
# 基本 HTTP 服务器
claude mcp add --transport http <服务器名称> <url>
# 带请求头的 HTTP 服务器
claude mcp add --transport http --header "Authorization: Bearer <令牌>" <服务器名称> <url>
claude mcp list 验证服务器状态claude mcp addclaude mcp list 确认服务器处于活动状态claude mcp remove <服务器名称>每周安装次数
150
仓库
GitHub 星标数
11.2K
首次出现
2026 年 1 月 23 日
安全审计
已安装于
opencode138
claude-code136
gemini-cli133
codex131
cursor131
github-copilot121
Configure Model Context Protocol (MCP) servers to extend Claude Code's capabilities with external tools like web search, file system access, and GitHub integration.
MCP servers provide additional tools that Claude Code agents can use. This skill helps you configure popular MCP servers using the claude mcp add command-line interface.
Present the user with available MCP server options using AskUserQuestion:
Question: "Which MCP server would you like to configure?"
Options:
No API key required. Ready to use immediately.
Ask for API key:
Do you have an Exa API key?
- Get one at: https://exa.ai
- Enter your API key, or type 'skip' to configure later
Ask for allowed directories:
Which directories should the filesystem MCP have access to?
Default: Current working directory
Enter comma-separated paths, or press Enter for default
Ask for token:
Do you have a GitHub Personal Access Token?
- Create one at: https://github.com/settings/tokens
- Recommended scopes: repo, read:org
- Enter your token, or type 'skip' to configure later
Use the claude mcp add command to configure each MCP server. The CLI automatically handles settings.json updates and merging.
claude mcp add context7 -- npx -y @upstash/context7-mcp
claude mcp add -e EXA_API_KEY=<user-provided-key> exa -- npx -y exa-mcp-server
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem <allowed-directories>
Option 1: Docker (local)
claude mcp add -e GITHUB_PERSONAL_ACCESS_TOKEN=<user-provided-token> github -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
Option 2: HTTP (remote)
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
Note: Docker option requires Docker installed. HTTP option is simpler but may have different capabilities.
After configuration, verify the MCP servers are properly set up:
# List configured MCP servers
claude mcp list
This will display all configured MCP servers and their status.
MCP Server Configuration Complete!
CONFIGURED SERVERS:
[List the servers that were configured]
NEXT STEPS:
1. Restart Claude Code for changes to take effect
2. The configured MCP tools will be available to all agents
3. Run `claude mcp list` to verify configuration
USAGE TIPS:
- Context7: Ask about library documentation (e.g., "How do I use React hooks?")
- Exa: Use for web searches (e.g., "Search the web for latest TypeScript features")
- Filesystem: Extended file operations beyond the working directory
- GitHub: Interact with GitHub repos, issues, and PRs
TROUBLESHOOTING:
- If MCP servers don't appear, run `claude mcp list` to check status
- Ensure you have Node.js 18+ installed for npx-based servers
- For GitHub Docker option, ensure Docker is installed and running
- Run /oh-my-claudecode:omc-doctor to diagnose issues
MANAGING MCP SERVERS:
- Add more servers: /oh-my-claudecode:mcp-setup or `claude mcp add ...`
- List servers: `claude mcp list`
- Remove a server: `claude mcp remove <server-name>`
If user selects "Custom":
Ask for:
stdio (default) or httpnpx my-mcp-server)https://example.com/mcp)Then construct and run the appropriate claude mcp add command:
For stdio servers:
# Without environment variables
claude mcp add <server-name> -- <command> [args...]
# With environment variables
claude mcp add -e KEY1=value1 -e KEY2=value2 <server-name> -- <command> [args...]
For HTTP servers:
# Basic HTTP server
claude mcp add --transport http <server-name> <url>
# HTTP server with headers
claude mcp add --transport http --header "Authorization: Bearer <token>" <server-name> <url>
claude mcp list to verify server statusclaude mcp add with correct credentials if neededclaude mcp list to confirm servers are activeclaude mcp remove <server-name>Weekly Installs
150
Repository
GitHub Stars
11.2K
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykFail
Installed on
opencode138
claude-code136
gemini-cli133
codex131
cursor131
github-copilot121
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
155,300 周安装
小跃虚拟伴侣Skill - 为OpenClaw AI助手添加温暖对话与情感陪伴能力
10 周安装
Git Worktree缺失文件自动修复工具 - 智能符号链接管理
11 周安装
Go配置库num30/config详解:声明式配置读取,支持YAML/JSON/TOML、环境变量和命令行
16 周安装
Laravel Actions 包:单一类处理多任务,提升 Laravel 开发效率
18 周安装
popo-doc-reader - 高效文档阅读与解析工具,支持GitHub集成
20 周安装
KiCad项目分析技能:自动化BOM提取、原理图分析与PCB制造订购
25 周安装