API¶
pico_mcp.decorators ¶
Marker decorators: store the MCP registration on the method; the server factory picks them up when the container builds MCPServer.
tool(*, read_only=None, destructive=None, idempotent=None, open_world=None, **options) ¶
Expose a component method as an MCP tool.
The flags become the standard MCP tool annotations (readOnlyHint...), which clients and approval gateways read to decide how much to trust a call. options go to MCPServer.add_tool (name, description, title...).
Source code in src/pico_mcp/decorators.py
resource(uri, **options) ¶
Expose a component method as an MCP resource; {param} in uri makes a template.
pico_mcp.server ¶
Builds the MCPServer from the @tool/@resource/@prompt methods of every registered component.
Each call resolves the component through the container, so scopes and interceptors apply exactly as for any other caller.
McpServerFactory ¶
Provides the SDK's MCPServer with every marked component method registered.