AI Learn
Anthropic · Claude Code Tutorial

Connect one external tool to Claude Code with MCP

Add an MCP server for a specific workflow, inspect exposed tools and permissions, test read-only access, then decide whether write actions are justified.

Reviewed September 19, 2026Independent tutorialFeatures may vary
Not official support. AI Learn is an independent education site and is not affiliated with Anthropic. Check the provider’s current documentation for plan-specific limits, pricing and feature availability.
Before you start

MCP expands what Claude Code can reach beyond the repository. Treat every server as a new trust boundary and review credentials, scopes and data paths before enabling it.

1. Start from a workflow need

Choose one concrete need such as reading issue metadata, querying internal docs or using a browser tool. Do not connect tools “just in case.”

2. Use the provider’s official setup

Install or configure the MCP server from its trusted documentation. Keep secrets in supported environment or credential stores instead of pasting them into prompts.

3. Inspect the exposed tools

Before asking Claude Code to act, list or review what the server makes available. Look for write, delete, send, admin or broad search capabilities.

4. Test read-only first

Ask for one narrow retrieval and compare the returned data with the source system. Confirm account, workspace and object boundaries are correct.

5. Add writes only with review

If the workflow needs external changes, add the smallest permission needed and keep an approval step before consequential actions.

Try this prompt

Use this MCP connection in read-only mode first. List the tools you can access, then retrieve only [specific object]. Do not create, edit, send or delete anything. Show me the exact write-capable tools separately.

Common mistakes

Connecting an unreviewed server; pasting tokens into chat; assuming “MCP” means safe by default; enabling broad writes before testing the account and object scope.

Finish check

You can name the server, account, tools, credential path and exact write capabilities, and a read-only test returned the expected source data.

开始之前

MCP 会把 Claude Code 的能力扩展到仓库之外。每接入一个 Server 都相当于增加一个新的信任边界,启用前要审查凭证、权限范围和数据流向。

1. 从真实工作需求出发

先选一个具体需求,例如读取 issue 元数据、查询内部文档或使用浏览器工具。不要因为“以后可能会用”就把一堆 MCP 全接上。

2. 按照可信官方方式配置

使用提供方可信文档安装或配置 MCP Server。密钥放在支持的环境变量或凭证存储中,不要直接贴进提示词。

3. 先看它暴露了哪些工具

让 Claude Code 行动前,先列出或检查 Server 提供的能力,特别关注写入、删除、发送、管理员操作和大范围搜索。

4. 第一次只做只读测试

先完成一个很窄的数据读取,并与源系统对照,确认账号、工作区和对象边界都正确。

5. 写入能力只按最小需要开放

如果工作流确实要修改外部系统,只增加最小权限,并对有后果的动作保留人工审批。

可以直接套用的提示词

先以只读方式使用这个 MCP 连接。列出你能访问的工具,然后只读取【指定对象】。不要创建、编辑、发送或删除任何内容;把具有写入能力的工具单独列出来给我看。

常见错误

接入从未审查过的 Server;把 Token 直接贴到聊天里;误以为“用了 MCP”就天然安全;还没验证账号和对象范围就开放大范围写权限。

完成检查

完成后,你应该能说清 Server、账号、工具、凭证保存方式和具体写能力,并且只读测试拿到了预期源数据。

開始之前

MCP 會把 Claude Code 的能力擴展到倉庫之外。每接入一個 Server 都相當於增加一個新的信任邊界,啓用前要審查憑證、權限範圍和數據流向。

1. 從真實工作需求出發

先選一個具體需求,例如讀取 issue 元數據、查詢內部文檔或使用瀏覽器工具。不要因為“以後可能會用”就把一堆 MCP 全接上。

2. 按照可信官方方式配置

使用提供方可信文檔安裝或配置 MCP Server。密鑰放在支持的環境變量或憑證存儲中,不要直接貼進提示詞。

3. 先看它暴露了哪些工具

讓 Claude Code 行動前,先列出或檢查 Server 提供的能力,特別關注寫入、刪除、發送、管理員操作和大範圍搜尋。

4. 第一次只做只讀測試

先完成一個很窄的數據讀取,並與來源系統對照,確認賬號、工作區和對象邊界都正確。

5. 寫入能力只按最小需要開放

如果工作流確實要修改外部系統,只增加最小權限,並對有後果的動作保留人工審批。

可以直接套用的提示詞

先以只讀方式使用這個 MCP 連接。列出你能訪問的工具,然後只讀取【指定對象】。不要創建、編輯、發送或刪除任何內容;把具有寫入能力的工具單獨列出來給我看。

常見錯誤

接入從未審查過的 Server;把 Token 直接貼到聊天里;誤以為“用了 MCP”就天然安全;還沒驗證賬號和對象範圍就開放大範圍寫權限。

完成檢查

完成後,你應該能說清 Server、賬號、工具、憑證儲存方式和具體寫能力,並且只讀測試拿到了預期來源數據。

Official references

Check current product details at the source

Related practical tutorials

Continue with another single-task workflow.

All tutorials →