Top Level Namespace

Defined in:

Constant Summary

Config = CrystalDoc::Config.from_yaml(File.read("./config.yml"))
MCP_CHANNELS = {} of String => Channel(String)

── MCP (Model Context Protocol) ──────────────────────────────────── SSE transport — required by MCP spec for real-time communication

The MCP SSE transport works as follows:

  1. Client opens an SSE connection to GET /mcp
  2. Server sends the endpoint the client should POST to
  3. Client POSTs JSON-RPC 2.0 messages to that endpoint
  4. Server writes JSON-RPC responses as SSE "message" events
MCP_CHANNELS_MUTEX = Mutex.new
RATE_LIMITER = CrystalDoc::RateLimiter.new(max_tokens: 60.0, refill_rate: 1.0)

── MCP rate limiter ─────────────────────────────────────────────────

REPO_DB = DB.open(Config.postgres_url)