What this snippet demonstrates
AFK agents can consume tools from external MCP (Model Context Protocol) servers just like local tools. This snippet shows how to connect to an MCP server, discover available tools, and attach them to an agent — all with the same validation, policy gates, and telemetry as local tools.
Connect, discover, and attach
Using the Agent’s built-in MCP support
For simpler setups, pass MCP server refs directly to the agent:
Combine your own tools with external MCP tools:
Apply policy rules to MCP-sourced tools just like local tools:
MCP tools are transparent. Once attached to an agent, they go through the
same validation, policy gates, sanitization, and telemetry as local tools. The
agent doesn’t know whether a tool is local or remote.
What to read next