skip to main content
Browse documentation

Syncanix with FastAPI

Make a FastAPI service agent-ready: what discovery reads, how to run it, and how to ship the chat surface and MCP server.

FastAPI composes routers with prefixes at two levels โ€” on the APIRouter itself and again at include_router. Discovery folds both in, within and across files.

What discovery reads

Discovery is static โ€” it reads your source, not your traffic. It composes full request paths across files, so mounted prefixes are part of every extracted route:

# main.py
app.include_router(orders_router, prefix="/api")

# orders.py
orders_router = APIRouter(prefix="/orders")

@orders_router.get("/{order_id}")          # โ†’ GET /api/orders/{order_id}
@orders_router.post("/{order_id}/refund")  # โ†’ POST /api/orders/{order_id}/refund
Representative routes the extractor composes โ€” full paths, prefixes included.

The extractor composes APIRouter(prefix=โ€ฆ) with include_router(โ€ฆ, prefix=โ€ฆ) within and across files โ€” including nested aggregator chains โ€” so decorated path operations are catalogued under their fully-composed paths.

Run discovery

From the repository root, run the init command. It detects the framework automatically, asks for consent before any LLM enrichment, and writes a deterministic catalog:

$ npx syncanix init
โœ“ detected framework
โœ“ scanned routes
โœ“ wrote .syncanix/catalog.json
โ†’ review your capabilities in the dashboard

Review the catalog

The catalog at .syncanix/catalog.json lists every capability discovery found โ€” method, path, and the enriched description your users will see. Review it like code before uploading: it is the contract your chat surface and MCP server expose.

Ship the surface

Once the catalog is uploaded, embed the widget for in-app chat and connect the per-tenant MCP server for Claude, ChatGPT, and Cursor. Every write action stays permission-gated, confirmed, and audited.

Next steps