enable_mcp_server
enable_mcp_server
Expose this agent’s @tool functions as a Model Context Protocol (MCP) server
endpoint. Adds a /mcp route that speaks JSON-RPC 2.0, allowing external MCP clients
(Claude Desktop, other agents, etc.) to discover and invoke the same tools.
This method only registers the /mcp HTTP route. It does not automatically
add the endpoint to the agent’s SWML output. To include the MCP server in your
SWML document for native tool discovery, also call
add_mcp_server() pointing at the agent’s own /mcp URL.
This method exposes your agent’s tools as an MCP server. To connect your agent
to an external MCP server as a client, use
add_mcp_server().
Parameters
None.
Returns
AgentBase — Returns self for method chaining.