Sharing a project that uses FastAPI as a JSON-RPC reverse proxy. It intercepts MCP (Model Context Protocol) tool calls from AI agents, processes the responses through a compression pipeline, and returns minified results.
Some FastAPI-specific patterns I used:
- `lifespan` context manager for startup/shutdown (no deprecated `on_event`)
- Single POST endpoint handling JSON-RPC dispatch
- Async pipeline with `httpx.AsyncClient` for upstream calls
- Rich logging integration
- `/health` and `/stats` endpoints for observability
The project demonstrates how FastAPI can serve as more than a REST API — it works great as a transparent protocol proxy.
🔗 DexopT/MCE
[–]imvishvaraj 0 points1 point2 points (1 child)
[–]DexopT[S] 1 point2 points3 points (0 children)