使用 MCP 可以做什么
连接 MCP 服务器后,您可以要求 Claude Code:- 从问题跟踪器实现功能:“添加 JIRA 问题 ENG-4521 中描述的功能,并在 GitHub 上创建 PR。”
- 分析监控数据:“检查 Sentry 和 Statsig 以检查 ENG-4521 中描述的功能的使用情况。”
- 查询数据库:“根据我们的 Postgres 数据库,查找使用功能 ENG-4521 的 10 个随机用户的电子邮件。”
- 集成设计:“根据在 Slack 中发布的新 Figma 设计更新我们的标准电子邮件模板”
- 自动化工作流:“创建 Gmail 草稿,邀请这 10 个用户参加关于新功能的反馈会议。“
热门 MCP 服务器
以下是一些您可以连接到 Claude Code 的常用 MCP 服务器:Development & Testing Tools
Monitor errors, debug production issuesCommand
claude mcp add --transport http sentry https://mcp.sentry.dev/mcpSecurity analysis for dependenciesCommand
claude mcp add --transport http socket https://mcp.socket.dev/Provides access to Hugging Face Hub information and Gradio AI ApplicationsCommand
claude mcp add --transport http hugging-face https://huggingface.co/mcpDebug faster with AI agents that can access Jam recordings like video, console logs, network requests, and errorsCommand
claude mcp add --transport http jam https://mcp.jam.dev/mcpProject Management & Documentation
Interact with your Asana workspace to keep projects on trackCommand
claude mcp add --transport sse asana https://mcp.asana.com/sseManage your Jira tickets and Confluence docsCommand
claude mcp add --transport sse atlassian https://mcp.atlassian.com/v1/sseTask management, project trackingCommand
claude mcp add --transport stdio clickup --env CLICKUP_API_KEY=YOUR_KEY --env CLICKUP_TEAM_ID=YOUR_ID -- npx -y @hauptsache.net/clickup-mcpAccess real-time customer conversations, tickets, and user dataCommand
claude mcp add --transport http intercom https://mcp.intercom.com/mcpIntegrate with Linear's issue tracking and project managementCommand
claude mcp add --transport http linear https://mcp.linear.app/mcpRead docs, update pages, manage tasksCommand
claude mcp add --transport http notion https://mcp.notion.com/mcpAsk questions about your enterprise content, get insights from unstructured data, automate content workflowsCommand
claude mcp add --transport http box https://mcp.box.com/Extract valuable insights from meeting transcripts and summariesCommand
claude mcp add --transport http fireflies https://api.fireflies.ai/mcpManage monday.com boards by creating items, updating columns, assigning owners, setting timelines, adding CRM activities, and writing summariesCommand
claude mcp add --transport http monday https://mcp.monday.com/mcpDatabases & Data Management
Read/write records, manage bases and tablesCommand
claude mcp add --transport stdio airtable --env AIRTABLE_API_KEY=YOUR_KEY -- npx -y airtable-mcp-serverSupplies high quality fundamental financial data sourced from SEC Filings, investor presentationsCommand
claude mcp add --transport http daloopa https://mcp.daloopa.com/server/mcpAccess and manage HubSpot CRM data by fetching contacts, companies, and deals, and creating and updating recordsCommand
claude mcp add --transport http hubspot https://mcp.hubspot.com/anthropicPayments & Commerce
Integrate PayPal commerce capabilities, payment processing, transaction managementCommand
claude mcp add --transport http paypal https://mcp.paypal.com/mcpAnalyze, troubleshoot, and optimize Plaid integrations. Banking data, financial account linkingCommand
claude mcp add --transport sse plaid https://api.dashboard.plaid.com/mcp/sseUse an agent to build on Square APIs. Payments, inventory, orders, and moreCommand
claude mcp add --transport sse square https://mcp.squareup.com/ssePayment processing, subscription management, and financial transactionsCommand
claude mcp add --transport http stripe https://mcp.stripe.comDesign & Media
Generate better code by bringing in full Figma contextVisit developers.figma.com for local server setup.Command
claude mcp add --transport http figma-remote-mcp https://mcp.figma.com/mcpUpload, manage, transform, and analyze your media assetsMultiple services available. See documentation for specific server URLs.
Build video creation capabilities into your applicationsCommand
claude mcp add --transport sse invideo https://mcp.invideo.io/sseBrowse, summarize, autofill, and even generate new Canva designs directly from ClaudeCommand
claude mcp add --transport http canva https://mcp.canva.com/mcpInfrastructure & DevOps
Build applications, analyze traffic, monitor performance, and manage security settings through CloudflareMultiple services available. See documentation for specific server URLs. Claude Code can use the Cloudflare CLI if installed.
Create, deploy, and manage websites on Netlify. Control all aspects of your site from creating secrets to enforcing access controls to aggregating form submissionsCommand
claude mcp add --transport http netlify https://netlify-mcp.netlify.app/mcpConfigure and manage Stytch authentication services, redirect URLs, email templates, and workspace settingsCommand
claude mcp add --transport http stytch http://mcp.stytch.dev/mcpVercel's official MCP server, allowing you to search and navigate documentation, manage projects and deployments, and analyze deployment logs—all in one placeCommand
claude mcp add --transport http vercel https://mcp.vercel.com/Automation & Integration
需要特定的集成? 在 GitHub 上查找数百个 MCP 服务器,或使用 MCP SDK 构建您自己的服务器。
安装 MCP 服务器
MCP 服务器可以根据您的需求以三种不同的方式进行配置:选项 1:添加远程 HTTP 服务器
HTTP 服务器是连接到远程 MCP 服务器的推荐选项。这是云服务最广泛支持的传输方式。选项 2:添加远程 SSE 服务器
选项 3:添加本地 stdio 服务器
Stdio 服务器作为本地进程在您的计算机上运行。它们非常适合需要直接系统访问或自定义脚本的工具。理解 ”—” 参数:
--(双破折号)将 Claude 自己的 CLI 标志与传递给 MCP 服务器的命令和参数分开。-- 之前的所有内容都是 Claude 的选项(如 --env、--scope),-- 之后的所有内容都是运行 MCP 服务器的实际命令。例如:claude mcp add --transport stdio myserver -- npx server→ 运行npx serverclaude mcp add --transport stdio myserver --env KEY=value -- python server.py --port 8080→ 运行python server.py --port 8080,环境中设置KEY=value
管理您的服务器
配置后,您可以使用以下命令管理 MCP 服务器:插件提供的 MCP 服务器
插件可以捆绑 MCP 服务器,在启用插件时自动提供工具和集成。插件 MCP 服务器的工作方式与用户配置的服务器相同。 插件 MCP 服务器的工作原理:- 插件在插件根目录的
.mcp.json中或在plugin.json中内联定义 MCP 服务器 - 启用插件时,其 MCP 服务器会自动启动
- 插件 MCP 工具与手动配置的 MCP 工具一起出现
- 插件服务器通过插件安装进行管理(不是
/mcp命令)
.mcp.json 中:
plugin.json 中内联:
- 自动生命周期:服务器在插件启用时启动,但您必须重新启动 Claude Code 以应用 MCP 服务器更改(启用或禁用)
- 环境变量:使用
${CLAUDE_PLUGIN_ROOT}表示插件相对路径 - 用户环境访问:访问与手动配置的服务器相同的环境变量
- 多种传输类型:支持 stdio、SSE 和 HTTP 传输(传输支持可能因服务器而异)
- 捆绑分发:工具和服务器打包在一起
- 自动设置:无需手动 MCP 配置
- 团队一致性:安装插件时,每个人都获得相同的工具
MCP 安装范围
MCP 服务器可以在三个不同的范围级别进行配置,每个级别都用于管理服务器可访问性和共享的不同目的。了解这些范围可以帮助您确定为特定需求配置服务器的最佳方式。本地范围
本地范围的服务器代表默认配置级别,存储在您的项目特定用户设置中。这些服务器对您保持私密,仅在当前项目目录中工作时可访问。此范围非常适合个人开发服务器、实验配置或包含不应共享的敏感凭证的服务器。项目范围
项目范围的服务器通过在项目根目录中存储配置到.mcp.json 文件来启用团队协作。此文件设计为检入版本控制,确保所有团队成员都可以访问相同的 MCP 工具和服务。添加项目范围的服务器时,Claude Code 会自动创建或更新此文件,使用适当的配置结构。
.mcp.json 文件遵循标准化格式:
.mcp.json 文件的项目范围服务器之前会提示批准。如果您需要重置这些批准选择,请使用 claude mcp reset-project-choices 命令。
用户范围
用户范围的服务器提供跨项目可访问性,使其在您计算机上的所有项目中可用,同时对您的用户帐户保持私密。此范围适用于个人实用程序服务器、开发工具或您在不同项目中经常使用的服务。选择正确的范围
根据以下条件选择您的范围:- 本地范围:个人服务器、实验配置或特定于一个项目的敏感凭证
- 项目范围:团队共享服务器、项目特定工具或协作所需的服务
- 用户范围:跨多个项目需要的个人实用程序、开发工具或经常使用的服务
范围层次结构和优先级
MCP 服务器配置遵循明确的优先级层次结构。当具有相同名称的服务器存在于多个范围时,系统通过首先优先考虑本地范围的服务器、其次是项目范围的服务器,最后是用户范围的服务器来解决冲突。此设计确保个人配置可以在需要时覆盖共享配置。.mcp.json 中的环境变量扩展
Claude Code 支持 .mcp.json 文件中的环境变量扩展,允许团队共享配置,同时保持对计算机特定路径和 API 密钥等敏感值的灵活性。
支持的语法:
${VAR}- 扩展为环境变量VAR的值${VAR:-default}- 如果设置了VAR,则扩展为VAR,否则使用default
command- 服务器可执行文件路径args- 命令行参数env- 传递给服务器的环境变量url- 对于 HTTP 服务器类型headers- 对于 HTTP 服务器身份验证
实际示例
示例:使用 Sentry 监控错误
示例:连接到 GitHub 进行代码审查
示例:查询您的 PostgreSQL 数据库
使用远程 MCP 服务器进行身份验证
许多基于云的 MCP 服务器需要身份验证。Claude Code 支持 OAuth 2.0 以实现安全连接。1
添加需要身份验证的服务器
例如:
2
在 Claude Code 中使用 /mcp 命令
在 Claude Code 中,使用命令:然后按照浏览器中的步骤登录。
从 JSON 配置添加 MCP 服务器
如果您有 MCP 服务器的 JSON 配置,可以直接添加它:1
从 JSON 添加 MCP 服务器
2
验证服务器已添加
从 Claude Desktop 导入 MCP 服务器
如果您已在 Claude Desktop 中配置了 MCP 服务器,可以导入它们:1
从 Claude Desktop 导入服务器
2
选择要导入的服务器
运行命令后,您将看到一个交互式对话框,允许您选择要导入的服务器。
3
验证服务器已导入
将 Claude Code 用作 MCP 服务器
您可以将 Claude Code 本身用作 MCP 服务器,其他应用程序可以连接到它:MCP 输出限制和警告
当 MCP 工具产生大量输出时,Claude Code 可帮助管理令牌使用情况,以防止压倒您的对话上下文:- 输出警告阈值:当任何 MCP 工具输出超过 10,000 个令牌时,Claude Code 显示警告
- 可配置限制:您可以使用
MAX_MCP_OUTPUT_TOKENS环境变量调整最大允许的 MCP 输出令牌 - 默认限制:默认最大值为 25,000 个令牌
- 查询大型数据集或数据库
- 生成详细的报告或文档
- 处理大量日志文件或调试信息
使用 MCP 资源
MCP 服务器可以暴露资源,您可以使用 @ 提及来引用这些资源,类似于引用文件的方式。引用 MCP 资源
1
列出可用资源
在您的提示中键入
@ 以查看来自所有连接的 MCP 服务器的可用资源。资源与文件一起出现在自动完成菜单中。2
引用特定资源
使用格式
@server:protocol://resource/path 来引用资源:3
多个资源引用
您可以在单个提示中引用多个资源:
将 MCP 提示用作斜杠命令
MCP 服务器可以暴露提示,这些提示在 Claude Code 中作为斜杠命令可用。执行 MCP 提示
1
发现可用的提示
键入
/ 以查看所有可用的命令,包括来自 MCP 服务器的命令。MCP 提示以 /mcp__servername__promptname 格式出现。2
执行不带参数的提示
3
执行带参数的提示
许多提示接受参数。在命令后面用空格分隔传递它们:
企业 MCP 配置
对于需要对 MCP 服务器进行集中控制的组织,Claude Code 支持企业管理的 MCP 配置。这允许 IT 管理员:- 控制员工可以访问哪些 MCP 服务器:在整个组织中部署一组标准化的已批准 MCP 服务器
- 防止未授权的 MCP 服务器:可选择限制用户添加自己的 MCP 服务器
- 完全禁用 MCP:如果需要,完全删除 MCP 功能
设置企业 MCP 配置
系统管理员可以在托管设置文件旁边部署企业 MCP 配置文件:- macOS:
/Library/Application Support/ClaudeCode/managed-mcp.json - Windows:
C:\ProgramData\ClaudeCode\managed-mcp.json - Linux:
/etc/claude-code/managed-mcp.json
managed-mcp.json 文件使用与标准 .mcp.json 文件相同的格式:
使用允许列表和拒绝列表限制 MCP 服务器
除了提供企业管理的服务器外,管理员还可以使用managed-settings.json 文件中的 allowedMcpServers 和 deniedMcpServers 控制用户可以配置哪些 MCP 服务器:
- macOS:
/Library/Application Support/ClaudeCode/managed-settings.json - Windows:
C:\ProgramData\ClaudeCode\managed-settings.json - Linux:
/etc/claude-code/managed-settings.json
allowedMcpServers):
undefined(默认):无限制 - 用户可以配置任何 MCP 服务器- 空数组
[]:完全锁定 - 用户无法配置任何 MCP 服务器 - 服务器名称列表:用户只能配置指定的服务器
deniedMcpServers):
undefined(默认):没有服务器被阻止- 空数组
[]:没有服务器被阻止 - 服务器名称列表:指定的服务器在所有范围内被显式阻止
- 这些限制适用于所有范围:用户、项目、本地,甚至来自
managed-mcp.json的企业服务器 - 拒绝列表具有绝对优先级:如果服务器同时出现在两个列表中,它将被阻止
企业配置优先级:企业 MCP 配置具有最高优先级,无法被用户、本地或项目配置覆盖。