Expand description
MCP (Model Context Protocol) service — UUID-keyed tool registry
This service provides an MCP-compliant interface for AI coding assistants (Claude Code, Cursor, etc.) to interact with hyprstream via:
- HTTP/SSE transport (for web clients with streaming)
- ZMQ control plane (for internal service communication)
§Architecture
Tools are registered in a HashMap<Uuid, ToolEntry>, announced and called by UUID.
Sync tools return JSON via ZMQ REQ/REP. Streaming tools use StreamHandle
(DH + SUB + HMAC verify) to bridge ZMQ streams to MCP SSE.
§Token Authentication
The service reads HYPRSTREAM_TOKEN from environment (stdio) or
Authorization: Bearer <token> header (HTTP) and validates:
- JWT signature via Ed25519
- Token expiration
- Backend services enforce authorization via Casbin policies
Structs§
- McpConfig
- Configuration for McpService
- McpService
- MCP service implementation — UUID-keyed tool registry
- Tool
Call Context - Context passed to handler — carries auth + optional ServiceContext
- Tool
Registry - UUID-keyed tool registry
Enums§
- Tool
Result - Handler return type — sync or streaming
Constants§
- SERVICE_
NAME - Service name for registration