您可以使用 MCP 做什麼
連接 MCP 伺服器後,您可以要求 Claude Code:- 從問題追蹤器實現功能:“新增 JIRA 問題 ENG-4521 中描述的功能,並在 GitHub 上建立 PR。”
- 分析監控資料:“檢查 Sentry 和 Statsig 以檢查 ENG-4521 中描述的功能使用情況。”
- 查詢資料庫:“根據我們的 Postgres 資料庫,找到 10 個使用功能 ENG-4521 的隨機使用者的電子郵件。”
- 整合設計:“根據在 Slack 中發佈的新 Figma 設計更新我們的標準電子郵件範本”
- 自動化工作流程:“建立 Gmail 草稿,邀請這 10 個使用者參加關於新功能的回饋會議。“
熱門 MCP 伺服器
以下是一些您可以連接到 Claude Code 的常用 MCP 伺服器:使用第三方 MCP 伺服器需自行承擔風險 - Anthropic 尚未驗證
所有這些伺服器的正確性或安全性。
請確保您信任要安裝的 MCP 伺服器。
使用可能會取得不受信任內容的 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 伺服器
SSE (Server-Sent Events) 傳輸已被棄用。請改用 HTTP 伺服器(如果可用)。
選項 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 伺服器:提示:
- 使用
--scope旗標指定配置的儲存位置:local(預設):僅在目前專案中對您可用(在較舊版本中稱為project)project:透過.mcp.json檔案與專案中的所有人共享user:在所有專案中對您可用(在較舊版本中稱為global)
- 使用
--env旗標設定環境變數(例如--env KEY=value) - 使用 MCP_TIMEOUT 環境變數配置 MCP 伺服器啟動逾時(例如
MCP_TIMEOUT=10000 claude設定 10 秒逾時) - 當 MCP 工具輸出超過 10,000 個令牌時,Claude Code 將顯示警告。若要增加此限制,請設定
MAX_MCP_OUTPUT_TOKENS環境變數(例如MAX_MCP_OUTPUT_TOKENS=50000) - 使用
/mcp向需要 OAuth 2.0 驗證的遠端伺服器進行驗證
Windows 使用者:在原生 Windows(不是 WSL)上,使用 沒有
npx 的本機 MCP 伺服器需要 cmd /c 包裝器以確保正確執行。cmd /c 包裝器,您會遇到「連接已關閉」錯誤,因為 Windows 無法直接執行 npx。(請參閱上面的注意以了解 -- 參數的說明。)外掛程式提供的 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,否則使用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 中,使用命令:然後按照瀏覽器中的步驟登入。
提示:
- 驗證令牌安全儲存並自動重新整理
- 在
/mcp功能表中使用「清除驗證」撤銷存取 - 如果您的瀏覽器未自動開啟,請複製提供的 URL
- OAuth 驗證適用於 HTTP 伺服器
從 JSON 配置新增 MCP 伺服器
如果您有 MCP 伺服器的 JSON 配置,您可以直接新增它:1
從 JSON 新增 MCP 伺服器
2
驗證伺服器已新增
提示:
- 確保 JSON 在您的 shell 中正確轉義
- JSON 必須符合 MCP 伺服器配置架構
- 您可以使用
--scope user將伺服器新增到您的使用者配置,而不是專案特定配置
從 Claude Desktop 匯入 MCP 伺服器
如果您已在 Claude Desktop 中配置了 MCP 伺服器,您可以匯入它們:1
從 Claude Desktop 匯入伺服器
2
選擇要匯入的伺服器
執行命令後,您將看到一個互動式對話框,允許您選擇要匯入的伺服器。
3
驗證伺服器已匯入
提示:
- 此功能僅適用於 macOS 和 Windows Subsystem for Linux (WSL)
- 它從這些平台上的標準位置讀取 Claude Desktop 配置檔案
- 使用
--scope user旗標將伺服器新增到您的使用者配置 - 匯入的伺服器將具有與 Claude Desktop 中相同的名稱
- 如果已存在具有相同名稱的伺服器,它們將獲得數字尾碼(例如
server_1)
使用 Claude Code 作為 MCP 伺服器
您可以使用 Claude Code 本身作為其他應用程式可以連接到的 MCP 伺服器:提示:
- 伺服器提供對 Claude 工具(如 View、Edit、LS 等)的存取
- 在 Claude Desktop 中,嘗試要求 Claude 讀取目錄中的檔案、進行編輯等。
- 請注意,此 MCP 伺服器只是將 Claude Code 的工具公開給您的 MCP 用戶端,因此您自己的用戶端負責為個別工具呼叫實現使用者確認。
MCP 輸出限制和警告
當 MCP 工具產生大型輸出時,Claude Code 可幫助管理令牌使用,以防止淹沒您的對話內容:- 輸出警告閾值:當任何 MCP 工具輸出超過 10,000 個令牌時,Claude Code 會顯示警告
- 可配置限制:您可以使用
MAX_MCP_OUTPUT_TOKENS環境變數調整最大允許 MCP 輸出令牌 - 預設限制:預設最大值為 25,000 個令牌
- 查詢大型資料集或資料庫
- 產生詳細報告或文件
- 處理廣泛的日誌檔案或除錯資訊
如果您經常遇到特定 MCP 伺服器的輸出警告,請考慮增加限制或配置伺服器以分頁或篩選其回應。
使用 MCP 資源
MCP 伺服器可以公開資源,您可以使用 @ 提及來參考,類似於您參考檔案的方式。參考 MCP 資源
1
列出可用資源
在您的提示中輸入
@ 以查看來自所有連接 MCP 伺服器的可用資源。資源與檔案一起出現在自動完成功能表中。2
參考特定資源
使用格式
@server:protocol://resource/path 來參考資源:3
多個資源參考
您可以在單個提示中參考多個資源:
提示:
- 參考時會自動擷取資源並作為附件包含
- 資源路徑在 @ 提及自動完成中可進行模糊搜尋
- Claude Code 在伺服器支援時自動提供列出和讀取 MCP 資源的工具
- 資源可以包含 MCP 伺服器提供的任何類型的內容(文字、JSON、結構化資料等)
使用 MCP 提示作為斜線命令
MCP 伺服器可以公開提示,這些提示在 Claude Code 中作為斜線命令可用。執行 MCP 提示
1
發現可用提示
輸入
/ 以查看所有可用命令,包括來自 MCP 伺服器的命令。MCP 提示以 /mcp__servername__promptname 格式出現。2
執行不帶引數的提示
3
執行帶引數的提示
許多提示接受引數。在命令後以空格分隔的方式傳遞它們:
提示:
- MCP 提示從連接的伺服器動態發現
- 引數根據提示的定義參數進行解析
- 提示結果直接注入到對話中
- 伺服器和提示名稱已標準化(空格變為底線)
企業 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 配置具有最高優先順序,當啟用
useEnterpriseMcpConfigOnly 時無法被使用者、本機或專案配置覆蓋。