代理框架中的 MCP
将 MCP 服务器接入代理运行时。
代理框架中的 MCP 是 CoddyKit 上的免费 MCP Academy 课时。 这是第 2 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 MCP Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 MCP Academy 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Agents Need Tools Too
An agent framework runs a loop: the model thinks, picks a tool, sees the result, repeats. MCP is a tidy way to feed it those tools.
One Connection, Many Tools
Instead of wiring each tool by hand, your agent connects to an MCP server once and instantly gains everything that server advertises.
Frameworks Speak MCP
Popular agent runtimes add MCP support so you can drop a server in as a tool source, no custom glue code per framework.
Discover, Then Use
At startup the framework asks the server to list tools, then exposes them to the model like any other callable in the loop.
tools = await session.list_tools()The Loop Stays the Same
Your agent loop does not change much. MCP just supplies the tool definitions the model chooses from on each step.
Calling a Tool
When the model picks a tool, the framework forwards the call to the MCP server with call_tool and waits for the result.
result = await session.call_tool(
"get_weather", {"city": "Rome"})Mix Many Servers
An agent can attach several MCP servers at once, pooling a database server, a search server, and a files server into one toolbox.
Swap Tools Without Code
Because tools live behind servers, you can add or remove capabilities by changing config, not by rewriting the agent itself.
The Host Handles Plumbing
The framework acts as the host: it starts servers, manages connections, and translates between the model and MCP for you.
Why This Scales
One server can power many agents, and one agent can use many servers. That many-to-many reach is exactly what MCP was built for.
Keep Your Agent Logic
MCP does not own your agent. Your reasoning, planning, and memory stay in the framework; MCP only standardizes the tool layer.
Quick Check
How does MCP fit into an agent framework?
Recap
An agent framework connects to MCP servers, discovers their tools, and calls them inside its loop. Plug in capability, keep your logic. 🔌
常见问题解答
「代理框架中的 MCP」课时是免费的吗?
是的 — 「代理框架中的 MCP」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 MCP Academy 课程的其余内容,请升级到 CoddyKit PRO。 MCP Academy 课程共包含 4 节课。
「代理框架中的 MCP」这节课中我会学到什么?
将 MCP 服务器接入代理运行时。 你通过在浏览器中直接运行的动手代码来练习 MCP Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 MCP Academy 需要有经验吗?
无需任何先前经验。CoddyKit 上的 MCP Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 2 节课,共 4 节。
「代理框架中的 MCP」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 MCP Academy 课中编写并运行代码吗?
能。每节 MCP Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。
此课程中的所有课时
- MCP 与函数调用
- 代理框架中的 MCP
- 使用 A2A 实现代理间通信
- MCP 下一步的发展方向