helpers/mcp_server.py.dox.md
mcp_server.py helper module.mcp_server.py because this directory is intentionally flat.mcp_server.py owns the runtime implementation.mcp_server.py.dox.md owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.ToolResponse (BaseModel)ToolError (BaseModel)DynamicMcpProxy (no explicit base class)
get_instance()reconfigure(self, token: str)async send_message(message: Annotated[str, Field(description='The message to send to the remote Agent Zero Instance', title='message')], attachments: Annotated[list[str], Field(description='Optional: A list of attachments (file paths or web urls) to send to the remote Agent Zero Instance with the message. Default: Empty list', title='attachments')] | None=..., chat_id: Annotated[str, Field(description='Optional: ID of the chat. Used to continue a chat. This value is returned in response to sending previous message. Default: Empty string', title='chat_id')] | None=..., persistent_chat: Annotated[bool, Field(description='Optional: Whether to use a persistent chat. If true, the chat will be saved and can be continued later. Default: False.', title='persistent_chat')] | None=...) -> Annotated[Union[ToolResponse, ToolError], Field(description='The response from the remote Agent Zero Instance', title='response')]async finish_chat(chat_id: Annotated[str, Field(description='ID of the chat to be finished. This value is returned in response to sending previous message.', title='chat_id')]) -> Annotated[Union[ToolResponse, ToolError], Field(description='The response from the remote Agent Zero Instance', title='response')]async _run_chat(context: AgentContext, message: str, attachments: list[str] | None=...)async mcp_middleware(request: Request, call_next): Middleware to check if MCP server is enabled._PRINTER, SEND_MESSAGE_DESCRIPTION, FINISH_CHAT_DESCRIPTION.agent, asyncio, contextvars, fastmcp, fastmcp.server.http, helpers, helpers.persist_chat, helpers.print_style, initialize, openai, os, pydantic, starlette.exceptions, starlette.middleware, starlette.middleware.base, starlette.requests.PrintStyle, contextvars.ContextVar, FastMCP, mcp_server.tool, Field, settings.get_settings, initialize_agent, AgentContext, ToolError, ToolResponse, context.reset, AgentContext.remove, remove_chat, context.communicate, threading.RLock, self.reconfigure, StreamableHTTPSessionManager, mcp_server._get_additional_http_routes, create_base_app, PrintStyle.error.tests/test_default_prompt_budget.pytests/test_fasta2a_client.pytests/test_ws_security.pyNo child DOX files.