"""Public contract for the mcp_server plugin. Exposes tool definitions and schemas for other plugins. """ from __future__ import annotations from app.plugins.builtins.contracts import get_contract_registry from app.plugins.builtins.mcp_server.schemas import ( McpServerConfig, McpToolDefinition, McpToolExecuteRequest, McpToolExecuteResponse, McpToolListResponse, McpToolParameter, ) from app.plugins.builtins.mcp_server.tool_definitions import ( TOOL_DEFINITIONS, TOOL_HANDLERS, get_all_tool_names, get_tool_definition, ) class McpServerContract: """Public API surface for the mcp_server plugin.""" contract_name = "mcp_server" # ─── tool_definitions ─── ToolDefinitions = TOOL_DEFINITIONS ToolHandlers = TOOL_HANDLERS get_tool_definition = staticmethod(get_tool_definition) get_all_tool_names = staticmethod(get_all_tool_names) # ─── schemas ─── McpToolDefinition = McpToolDefinition McpToolExecuteRequest = McpToolExecuteRequest McpToolExecuteResponse = McpToolExecuteResponse McpToolListResponse = McpToolListResponse McpToolParameter = McpToolParameter McpServerConfig = McpServerConfig # ─── self-registration ─── _contract = McpServerContract() get_contract_registry().register("mcp_server", _contract) __all__ = [ "McpServerContract", "McpToolDefinition", "McpToolParameter", "McpServerConfig", ]