MAOTO - MCP Server
__all__ = ['MCPServer']
module-attribute
MCPServer(app, settings=None)
Initialize the MCP server with the given FastAPI app.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
FastAPI
|
The FastAPI application to mount the MCP server to |
required |
settings
|
MCPSettings
|
MCP-specific settings. If not provided, will use default settings. |
None
|
Source code in maoto_agent/mcp/server.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
server
property
Get the underlying MCP server instance.
settings
property
Get the MCP settings instance.
add_tool(func)
Add a custom tool to the MCP server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func
|
callable
|
The function to add as a tool |
required |
Source code in maoto_agent/mcp/server.py
31 32 33 34 35 36 37 38 39 40 |
|