将 Claude Code 连接到 Performance Hub
本页内容
说明截至 2026 年11月 26 日 (AEST)。厂商的 MCP 支持变更频繁,如果发现有所不同,请对照链接的来源进行核实。
Claude Code 通过 HTTP 连接到远程 MCP 服务器。Performance Hub 公开了一个 Streamable HTTP 端点。
服务器详情
https://app.performancehub.co/mcp
使用 Bearer 令牌添加服务器
export PH_MCP_API_KEY='<YOUR_TOKEN>'
claude mcp add --transport http performance-hub https://app.performancehub.co/mcp \
--header "Authorization: Bearer ${PH_MCP_API_KEY}"
备用请求头:
claude mcp add --transport http performance-hub https://app.performancehub.co/mcp \
--header "x-mcp-api-key: ${PH_MCP_API_KEY}"
作用域
| 作用域 | 标志 | 存储位置 |
|---|---|---|
| 本地(默认) | (省略,或 --scope local) | 当前项目的 ~/.claude.json |
| 项目 | --scope project | 项目根目录中的 .mcp.json(可共享) |
| 用户 | --scope user | 所有项目的 ~/.claude.json |
机器上每个项目的示例:
claude mcp add --scope user --transport http performance-hub https://app.performancehub.co/mcp \
--header "Authorization: Bearer ${PH_MCP_API_KEY}"
当你手动编写 JSON(.mcp.json 或 ~/.claude.json)时,请在条目上设置 "type": "http"(或 "streamable-http")。带有 url 但没有 type 的条目会被视为 stdio 并被跳过。
OAuth 选项
如果你喜欢使用 OAuth 而不是静态密钥,可以在不带请求头的情况下添加服务器,并在 Claude Code 提示时完成登录(/mcp > Authenticate,或 claude mcp login performance-hub)。
验证
claude mcp list
在 Claude Code 会话中,打开 /mcp 并确认 Performance Hub 显示为已连接,然后让它列出可用的工具。
来源
- Claude Code MCP 文档:https://code.claude.com/docs/en/mcp
- Performance Hub MCP:https://app.performancehub.co/mcp