aw_agents.adapters.mcp¶
MCP (Model Context Protocol) adapter for AW agents.
This adapter wraps any AgentBase subclass to expose it as an MCP server for use with
Claude Desktop. The server is built by py2mcp (the fleet’s MCP surface adapter, the
same builder every other fleet MCP server goes through): each agent tool becomes one
function whose signature is derived from the tool’s JSON schema, and
py2mcp.mk_mcp_server() turns those functions into a FastMCP server.
Functions
|
Generate an MCP server script for an agent. |
Classes
|
Adapter to expose an AgentBase as an MCP server. |
- class aw_agents.adapters.mcp.MCPAdapter(agent, server_name, **server_options)[source]¶
Bases:
objectAdapter to expose an AgentBase as an MCP server.
Usage:
agent = YourAgent() adapter = MCPAdapter(agent, server_name="your-agent") adapter.run_sync()adapter.serveris thepy2mcp(FastMCP) server;adapter.toolsthe functions it serves, one per agent tool.