看累了听个音乐吧
6.2 连接常用服务

安装 MCP Server 的统一方式
所有 MCP Server 的安装命令格式都一样:
bash
claude mcp add <名称> --transport <协议> [-- <命令或URL>]安装后立即生效,不需要重启 Claude Code。
下面逐个介绍最常用的几个。
GitHub MCP
能做什么: 直接操作 GitHub 仓库——搜索 issue、读 PR 内容、查看 CI 状态、创建 issue、发表评论。
安装:
bash
claude mcp add github --transport stdio \
--env GITHUB_PERSONAL_ACCESS_TOKEN=<你的token> \
-- npx -y @modelcontextprotocol/server-github在 github.com/settings/tokens 生成一个 Personal Access Token,勾选 repo 和 issues 权限。
安装后能做的事:
search for open issues labeled "bug" in the repo,
find the 3 most recently commented ones and summarize themcheck the CI status of the latest commit on the main branch.
if any checks are failing, show me the error logslook at PR #142, summarize the changes, and check if
there are any review comments I haven't responded tocreate a GitHub issue for the bug we just fixed:
title should describe the root cause, body should include
the fix summary and link to the commitSlack MCP
能做什么: 读取频道消息、发送消息、搜索历史、查看未读通知。
安装:
bash
claude mcp add slack --transport stdio \
--env SLACK_BOT_TOKEN=<你的bot-token> \
--env SLACK_TEAM_ID=<你的team-id> \
-- npx -y @modelcontextprotocol/server-slackSlack Bot Token 在 api.slack.com/apps 创建应用后获取,需要 channels:read、chat:write、channels:history 权限。
安装后能做的事:
check #eng-alerts for any new alerts since yesterday morning,
summarize the critical onespost a message to #deployments:
"Deployed v2.3.1 to staging — includes the payment fix from PR #142.
Please test before EOD."search Slack for any discussion about the "user session timeout" bug
we're working on — what context is there?PostgreSQL MCP
能做什么: 直接对 PostgreSQL 数据库执行查询(只读,不执行写操作——除非你明确配置允许)。
安装:
bash
claude mcp add postgres --transport stdio \
-- npx -y @modelcontextprotocol/server-postgres \
"postgresql://user:password@localhost:5432/dbname"⚠️ 强烈建议使用只读数据库账号,不要把有写权限的连接字符串给 MCP。
安装后能做的事:
show me the database schema — what tables exist and
what are the relationships between them?how many users signed up in the last 7 days?
break it down by day and show the trendfind all orders from the last 24 hours that are in
"pending" status for more than 2 hours.
these might be stuck — show me the order IDs and amountsthe checkout error we're debugging — query the logs table
for any errors with code "PAYMENT_FAILED" from today,
show the most recent 10 with their user IDsFigma MCP
能做什么: 读取 Figma 文件的设计内容、组件结构、样式定义。
安装:
bash
claude mcp add figma --transport http \
https://figma.com/api/mcp注意:Figma MCP 需要你在 figma.com 的设置里先开启 MCP 访问权限,并获取你的专属 URL。
安装后能做的事:
look at the new dashboard design in Figma,
and update the React components in src/components/Dashboard/
to match the latest design. focus on the card layout and color changes.extract all the color tokens from our Figma design system
and update the tailwind.config.js to match组合使用:真正的威力在这里
单独用每个 MCP 已经很有用了,但组合使用才是真正改变工作流的地方:
I just fixed the payment timeout bug.
1. check the GitHub issue #89 to confirm this fix addresses
all the reported scenarios
2. query the production DB to find out how many users
were affected by this bug in the last 7 days
3. update the GitHub issue with a comment summarizing
the fix and the impact numbers
4. post to #product-updates Slack channel:
"Payment timeout bug fixed. Affected X users over 7 days.
Fix deployed to staging, production rollout tomorrow."一条指令,Claude Code 跨四个系统完成任务。这就是为什么说 MCP 是 Claude Code 进入"真正有用"阶段的关键。
验证 MCP 连接是否正常
安装完之后,可以测试一下连接:
bash
# 列出所有已安装的 MCP Server
claude mcp list
# 查看某个 Server 的详细信息
claude mcp get github在 Claude Code 会话里,输入:
list all the tools available from the github MCP server它会列出所有可用的工具,确认连接正常。
下一节,我们来看 MCP 的配置文件结构,以及管理多个 MCP Server 的最佳实践。
