Skip to main content

Module mcp_http

Module mcp_http 

Source
Expand description

HTTP MCP Endpoints for Smart Tree Daemon

Provides MCP (Model Context Protocol) over HTTP instead of stdio. This enables multiple AIs to connect simultaneously and share context through the daemon’s central brain.

Endpoints:

  • GET /mcp/sse - SSE endpoint for MCP (Claude Code compatible)
  • POST /mcp/message - Send JSON-RPC message (for SSE clients)
  • POST /mcp/initialize - Initialize MCP session
  • GET /mcp/tools/list - List available tools
  • POST /mcp/tools/call - Execute a tool
  • GET /mcp/resources/list - List resources
  • GET /mcp/prompts/list - List prompts

~ The Custodian watches all operations through here ~

Structs§

Capabilities
ClientInfo
McpInitializeRequest
McpInitializeResponse
PromptCapabilities
ResourceCapabilities
ServerInfo
ToolCallRequest
ToolCapabilities

Functions§

create_mcp_context
Create a new shared MCP context
mcp_initialize
POST /mcp/initialize - Initialize MCP session
mcp_message_handler
POST /mcp/message - Receive JSON-RPC messages from SSE clients
mcp_prompts_list
GET /mcp/prompts/list - List available prompts
mcp_resources_list
GET /mcp/resources/list - List available resources
mcp_router
Create the MCP HTTP router
mcp_sse_handler
GET /mcp/sse - Server-Sent Events endpoint for MCP
mcp_tools_call
POST /mcp/tools/call - Execute an MCP tool
mcp_tools_list
GET /mcp/tools/list - List available MCP tools

Type Aliases§

SharedMcpContext
Shared MCP context for HTTP handlers