fractafrag/services/api/app/middleware
John Lightner cf591424a1 M2: MCP server live + hot score ranking
MCP Server (8 tools):
- browse_shaders: search by title, tags, type, sort (trending/new/top)
- get_shader: full details + GLSL source by ID
- get_shader_versions: version history with change notes
- get_shader_version_code: GLSL code from any specific version
- submit_shader: create new shader (published or draft)
- update_shader: push revisions with change notes, auto-versions
- get_trending: top-scored shaders
- get_desire_queue: open community requests

MCP resource: fractafrag://platform-info with shader format guide

Auth: Internal service token (Bearer internal:mcp-service) allows MCP
server to write to the API as the system user. No user API keys needed
for the MCP→API internal path.

Transport: Streamable HTTP on port 3200 via FastMCP SDK.
Stateless mode with JSON responses.

Hot Score Ranking:
- Wilson score lower bound with 48-hour time decay
- Recalculated on every vote (up/down/remove)
- Feed sorts by score for trending view

Connection config for Claude Desktop:
{
  "mcpServers": {
    "fractafrag": {
      "url": "http://localhost:3200/mcp"
    }
  }
}
2026-03-24 22:56:03 -05:00
..
__init__.py M0: Foundation scaffold — Docker Compose, DB schema, FastAPI app, all service stubs 2026-03-24 20:45:08 -05:00
auth.py M2: MCP server live + hot score ranking 2026-03-24 22:56:03 -05:00
rate_limit.py M0: Foundation scaffold — Docker Compose, DB schema, FastAPI app, all service stubs 2026-03-24 20:45:08 -05:00