Model Context Protocol (MCP)
Model Context Protocol (MCP) 是一种把 AI agent 连接到外部工具与数据系统的开放协议。在当前 wiki 语境里,它的重要性不只在“统一接入”,还在于它把一个新问题推到前台:当 agent 通过 MCP 接入的服务器和工具足够多时,真正决定效率与成本的往往不再是协议本身,而是工具如何被暴露给模型、结果如何在执行环境与上下文之间流动。
- MCP 的基本价值是把“每个 agent 都要为每个系统单独写集成”的碎片化问题,变成“实现一次协议即可接入整个工具生态”的标准化问题。
- 但随着 MCP 服务器和工具数量上升,很多 client 会把全部工具定义直接塞进模型上下文,并让每次工具结果都穿过模型;这会显著增加 token 成本、延迟和出错概率。
- 在《Code execution with MCP - Building more efficient agents》里,Anthropic 给出的关键工程解法是:把 MCP 服务器呈现为代码 API,让模型通过文件系统按需读取接口,再在代码执行环境里组合调用。
- 这使 MCP 从“模型直接调工具”的模式,转向“模型写代码,代码调工具”的模式;因此复杂控制流、数据过滤、状态持久化和隐私处理可以更多地下沉到执行环境中完成。
- 这一概念与 Agent scaffold 直接相连,因为它本质上改变了工具暴露方式、上下文预算分配和状态管理边界;它也与 Agentic engineering 相连,因为它要求工程师去设计可被 agent 高效探索和安全执行的运行环境。
- 《Writing effective tools for agents — with agents》则补充了 MCP 的另一面:即使协议统一了接入方式,真正决定效果的仍是工具是否以 agent 友好的方式被命名、分组、裁剪响应、提示参数和处理错误。
- 这说明 MCP 解决的是“怎么接进来”,但 Tool ergonomics for agents 解决的是“接进来之后,agent 到底能不能高效用好这些工具”。
- 《Introducing advanced tool use on the Claude Developer Platform》则把这条线进一步产品化:通过
Tool Search Tool做按需发现,通过 Programmatic tool calling 做代码级编排,通过Tool Use Examples补齐 schema 无法表达的调用习惯。 - 这说明一旦工具规模足够大,MCP 的实际效果越来越依赖“发现层、调用层、示例层”三者是否同时设计到位,而不只是协议连通性本身。
ℹ️ Conflict:
- MCP 是协议;“code execution with MCP” 是一种 client/harness 设计模式。两者相关,但不能混为一谈。
- 支持 MCP 不等于默认应把所有工具暴露为直接 tool calls。随着工具规模扩大,工具发现方式、上下文策略和执行环境设计会比“是否用了 MCP”本身更决定实际效果。
- Code execution with MCP - Building more efficient agents
- Writing effective tools for agents — with agents
- Introducing advanced tool use on the Claude Developer Platform
- Anthropic
- Agent scaffold
- Tool ergonomics for agents
- Programmatic tool calling
- Agentic engineering
- Anthropic, “Code execution with MCP - Building more efficient agents”, 2025-11-04: https://www.anthropic.com/engineering/code-execution-with-mcp
- 原文摘录:[llm-wiki/raw/anthropic/Code execution with MCP - Building more efficient agents](/raw/anthropic/Code execution with MCP - Building more efficient agents.md)
- 中文翻译:通过 MCP 进行代码执行——构建更高效的智能体
- Anthropic, “Writing effective tools for agents — with agents”, 2025-09-11: https://www.anthropic.com/engineering/writing-effective-tools-for-agents-with-agents
- 原文摘录:[llm-wiki/raw/anthropic/Writing effective tools for agents — with agents](/raw/anthropic/Writing effective tools for agents — with agents.md)
- Anthropic, “Introducing advanced tool use on the Claude Developer Platform”, 2025-11-24: https://www.anthropic.com/engineering/introducing-advanced-tool-use-on-the-claude-developer-platform
- 原文摘录:[llm-wiki/raw/anthropic/Introducing advanced tool use on the Claude Developer Platform](/raw/anthropic/Introducing advanced tool use on the Claude Developer Platform.md)