Expose and consume tools via the Model Context Protocol.
The Model Context Protocol (MCP) is an open standard for sharing tools between AI systems. AFK supports both exposing your tools via an MCP server and consuming tools from external MCP servers.
from afk.mcp import MCPStorestore = MCPStore()await store.connect("https://tools.example.com:3001")
2
Discover available tools
Copy
tools = await store.list_tools()for t in tools: print(f"{t.name}: {t.description}")
3
Attach to an agent
Copy
from afk.agents import Agentagent = Agent( name="assistant", model="gpt-5.2-mini", instructions="Use available tools to help the user.", tools=tools, # ← MCP tools work like local tools)
MCP tools are transparent. Once attached to an agent, MCP tools behave
exactly like local tools — same validation, same policy gates, same telemetry.
The agent doesn’t know (or care) whether a tool is local or remote.