MCP 协议详解:Claude 的工具调用新标准
-
来源:AI 订阅指南
MCP(Model Context Protocol)是 Anthropic 推出的 AI 工具调用标准协议。
核心概念:
- 统一的工具调用接口
- 支持文件系统、数据库、API 等多种工具
- 标准化的输入输出格式
已有 MCP 服务器:
- GitHub MCP(代码管理)
- Slack MCP(消息发送)
- Database MCP(数据库查询)
- File System MCP(文件操作)
开发自定义 MCP:
from mcp import Server server = Server("my-tool") @server.tool() def search_web(query: str): # 你的工具逻辑 return {"results": }
更多 Agent 教程请关注 AI 订阅指南。
-
Agent 的 token 消耗是普通对话的 3-5 倍,有优化技巧吗?