mcp.servers.http_server¶
HTTP-based MCP server for haive using FastAPI and SSE transport.
Attributes¶
Functions¶
|
Perform a calculation. |
|
Echo back a message. |
|
Get the current server time. |
|
Get system information. |
|
Handle SSE connections for MCP protocol. |
|
Health check endpoint. |
|
Get help using this MCP server. |
|
Server information endpoint. |
|
List all available tools. |
|
Root endpoint. |
|
Run the HTTP MCP server. |
|
Get server information as a resource. |
|
Get server status. |
Module Contents¶
- async mcp.servers.http_server.calculate(operation: str, a: float, b: float) float ¶
Perform a calculation.
- Parameters:
operation – One of ‘add’, ‘subtract’, ‘multiply’, ‘divide’
a – First number
b – Second number
- Returns:
Result of the calculation
- async mcp.servers.http_server.handle_sse(request: fastapi.Request)¶
Handle SSE connections for MCP protocol.
- async mcp.servers.http_server.health()¶
Health check endpoint.
- async mcp.servers.http_server.info()¶
Server information endpoint.
- async mcp.servers.http_server.root()¶
Root endpoint.
- mcp.servers.http_server.run_server(host: str = '0.0.0.0', port: int = 8000)¶
Run the HTTP MCP server.
- mcp.servers.http_server.app¶
- mcp.servers.http_server.logger¶
- mcp.servers.http_server.mcp¶
- mcp.servers.http_server.sse_transport = None¶