Compile FastAPI OpenAPI Apps into Stateless MCP Servers, /llms.txt v2 & Lighthouse ard.json in 5 Seconds
Compile FastAPI app.openapi() into Stateless MCP 2026-07-28 tools, <=50KB /llms.txt v2, and Chrome Lighthouse ard.json v0.91 in 5s with zero wrappers.
Scan Your Website AI-Readiness Inline (0β100)
Enter your domain to inspect live /llms.txt, ACP/UCP & MCP 2026-07-28 blockers right here on this pageβand unlock your compiled 7-file bundle + git apply .patch in 1 click.
embed.js)
β Zero CWV / SEO speed impact
β Works on Shopify, WordPress, Webflow & Next.js
Production Route Metadata (LP26 β SpecPulse AI v3.4.0, Sprint #8)
| Metadata Field | Production Value | |
|---|---|---|
| Canonical Slug | /fastapi-openapi-to-mcp-server-llms-txt-generator | |
SEO Title (59 chars) | `FastAPI to MCP Server, llms.txt & ard.json CLI \ | SpecPulse` |
Meta Description (154 chars) | Compile FastAPI app.openapi() into Stateless MCP 2026-07-28 tools, <=50KB /llms.txt v2, and Chrome Lighthouse ard.json v0.91 in 5s with zero wrappers. | |
| Target Keywords | fastapi to mcp server, fastapi llms.txt generator, fastapi /.well-known/ard.json | |
| Release Version | https://specpulse.dev/cli.mjs & specpulse/action@v3.4 (2026-11-18) |
Zero-Wrapper FastAPI Quickstart (5 Seconds β Free $0 Sandbox, Pro $29/mo or $290/yr Save 2 Months, Team $99/mo or $990/yr)
Turn any FastAPI application into a complete fastapi to mcp server bundle, a Chrome Lighthouse llms.txt manifest (<= 50KB), and a validated fastapi /.well-known/ard.json catalog without mounting stateful ASGI wrappers or rewriting Pydantic route decorators:
curl -fsSL https://specpulse.dev/api/v1/scan?url=https://yourdomain.com
curl -fsSL https://specpulse.dev/cli.mjs -o specpulse.mjs && node specpulse.mjs ./openapi.json
Direct Self-Serve Activation & Stripe Checkout CTAs:
- Launch Free Browser & CLI Sandbox (
$0/moβ No Login, Runs In-Memory) β Instant 50-endpoint audit, 5-artifact download, and Shields.io README compliance badge. - Activate Pro Monthly (
$29/movia Stripe Checkout) or Activate Pro Annual ($290/yrβ$24.17/moeq., 2 Months Free) β Automated GitHub Push-to-PR sync up to 10 repositories, edge/llms-full.txthosting, and 60-second MCPisError: trueprobes. - Activate Team Monthly (
$99/movia Stripe Checkout) or Activate Team Annual ($990/yrβ$82.50/moeq., 2 Months Free) β Multi-service FastAPI monorepo governance, custom edge domains, and RBAC policy gates. - Billing is powered by Stripe Checkout Sessions with Stripe Link one-click autofill, duplicate-proof Stripe Subscription Proration when switching monthly to annual, and automated 100% Stripe Refunds within 7 days (
< 5builds).
Why Naive FastAPI-to-MCP Converters Break in Production
FastAPI automatically emits OpenAPI 3.1 schemas from Python type hints and Pydantic models at /openapi.json. While runtime wrappers like FastMCP's FastAPI integration and fastapi-mcp are helpful for local prototyping, even the FastMCP OpenAPI documentation and Speakeasy's OpenAPI-to-MCP engineering guide warn against naively mirroring raw REST endpoints to LLM clients in production:
- Auto-Generated
operation_idCollisions: Without explicitoperation_idoverrides on every route, FastAPI's default schema generator emits verbose identifiers such asget_user_users__user_id__get, which runtime converters truncate at double underscores (__) into ambiguousget_user_userstool names (FastMCP FastAPI Docs). - ASGI Lifespan &
.well-knownCORS Conflicts: Mounting a stateful MCP sub-application inside FastAPI requires manualcombine_lifespanswiring and conflicts with top-levelCORSMiddleware, frequently causingHTTP 404orOPTIONSpreflight failures on.well-knowndiscovery routes (FastMCP FastAPI Docs). - 14,200-Token Context Bloat & Zero Discovery Files: Dumping 50 raw REST routes into
tools/listburns14,200+startup tokens per coding session and still leaves your domain missing/llms.txt(llms.txtv2 Spec),/.well-known/ard.json(Chrome Lighthouseard.jsonAudit), and MCPSEP-2127Server Cards. - Unprotected Non-Idempotent
POSTReplays: Exposing FastAPIPOSTendpoints directly as MCP tools without idempotency keys leaves order, billing, and database mutations vulnerable to the November 16, 2026 OpenAI Responses API duplicate MCP write bug, where an approved native MCP write followed by a programmatic read executeswrite -> read -> writetwice under the sameapproval_request_id.
Before vs. After: Handwritten / Wrapper Setup vs. SpecPulse v3.4 FastAPI Adapter
| Engineering Dimension | Manual FastAPI Wrappers & Hand-Rolled Routes | SpecPulse v3.4 (--framework fastapi) |
|---|---|---|
| Schema Extraction | Requires booting live Uvicorn server or mounting runtime ASGI middleware (FastAPI OpenAPI Docs) | Zero-server AST + app.openapi() introspection in 5s (0 Python route edits) |
| MCP Tool Naming | Truncated get_user_users__user_id__get collisions (FastMCP FastAPI Guide) | Deterministic verb-noun normalization (users_get_by_id) + /healthz & /metrics auto-exclusion |
| Protocol Transport | Legacy stateful SSE or manual combine_lifespans session state | Stateless MCP 2026-07-28 Streamable HTTP (POST server/discover, 405 on GET) |
| Duplicate Write Safety | Vulnerable to write -> read -> write replays (OpenAI Bug #1416736) | Auto-injected RFC 8941 Idempotency-Key (400/409/422) + approval_request_id dedupe |
| Agent Startup Context | 14,200 tokens across 50 endpoints on every session start | 280 tokens (-98.0%) via AAIF SKILL.md progressive disclosure |
| Lighthouse Agentic Audit | Manual /llms.txt & missing ard.json (N/A or schema fail) | 1.0 Pass on Lighthouse ard.json v0.91 & llms.txt v2 (<= 50KB) |
| Prompt Cache & Recon Hardening | Unsorted JSON keys + exposed .map / internal staging URLs | RFC 8785 JCS prefix hoisting + GTIG Q4 2026 & OWASP LLM01/LLM02 scrubbing |
| Total Engineering Cost | 16β24 hours initial build + manual drift fixes every sprint | $0 Free Sandbox; $29/mo ($290/yr) Pro; $99/mo ($990/yr) Team |
What One 5-Second Command Generates for Your FastAPI Repo
Running the fastapi llms.txt generator and MCP compiler inspects app.main:app in an isolated subprocess without opening network ports:
curl -fsSL https://specpulse.dev/api/v1/scan?url=https://yourdomain.com
curl -fsSL https://specpulse.dev/cli.mjs -o specpulse.mjs && node specpulse.mjs ./openapi.json
--framework fastapi \
--app app.main:app \
--fqdn api.acme.dev \
--out ./generated/agent-artifacts
SpecPulse v3.4 deterministically emits 5 synchronized artifacts plus a zero-dependency FastAPI static router (generated/agent_artifacts_router.py):
/llms.txt(<= 50KB) &/llms-full.txt: Structured to the August 2026llms.txtv2 specification with H1 project identity, summary blockquote, grouped H2 endpoint capabilities, andLink: </llms.txt>; rel="describedby"response headers./.well-known/ard.json(ARD v0.91): Passes the Chrome Lighthouseard.jsonconformance suite (1.0score) with domain-anchoredurn:air:api.acme.dev:mcp:core-apiidentifiers, strictXOR(url, data)location definitions,application/mcp-server-card+jsonmedia types, and3curatedrepresentativeQueriesper resource (ARD v0.91 Spec).mcp-server.json(Stateless MCP2026-07-28): Full JSON Schema2020-12tool definitions (MCP2026-07-28Tools Spec) withx-mcp-headerparameter mirroring,readOnlyHint/idempotentHint/destructiveHintannotations, and compositeidempotency_keyenforcement./.well-known/mcp-server.json&/mcp/server-card(SEP-2127): Pre-connection HTTP discovery metadata conforming to MCPSEP-2127Server Cards (FinalExtensions Track SEP;Betaextension lifecycle inmodelcontextprotocol/ext-server-card), intentionally omitting dynamictools/resources/promptsprimitives for runtime authorization safety./.well-known/skills/index.json&<tag>/SKILL.md: Tag-partitioned AAIF Agent Skills (< 500lines and< 5,000tokens per file per Agent Skills Best Practices) so Claude Code, Cursor, and Codex load~60tokens of YAML frontmatter at startup instead of your entire OpenAPI schema.
Mount All Discovery Routes in FastAPI Without Lifespan or CORS Conflicts
from fastapi import FastAPI
from generated.agent_artifacts_router import specpulse_discovery_router
app = FastAPI(title="Acme Payments API", version="3.4.0")
# Serves /llms.txt, /.well-known/ard.json, /mcp/server-card, and /.well-known/skills/index.json
# Includes RFC 8615 Cache-Control, Vary: Accept, and Access-Control-Allow-Origin: * on public cards
app.include_router(specpulse_discovery_router)
Copy-Paste GitHub Actions Workflow (specpulse/action@v3.4)
Keep /llms.txt, /.well-known/ard.json, and mcp-server.json continuously synchronized on every FastAPI pull request. Following GitHub Actions Workflow Syntax and Google Cloud GTIG Q4 2026 security guidance, specpulse/action@v3.4 requires zero id-token OIDC permissions:
name: Sync FastAPI MCP & Agent Discovery Artifacts
on:
push:
branches: [main]
paths:
- "app/**/*.py"
- "pyproject.toml"
pull_request:
paths:
- "app/**/*.py"
permissions:
contents: read
pull-requests: write
jobs:
specpulse-fastapi-sync:
runs-on: ubuntu-latest
steps:
- name: Checkout FastAPI Repository
uses: actions/checkout@v4
- name: Set up Python 3.12 & Project Dependencies
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install FastAPI App Dependencies
run: pip install -e .
- name: Compile FastAPI OpenAPI -> MCP 2026-07-28, ard.json v0.91 & /llms.txt
uses: specpulse/action@v3.4
with:
framework: "fastapi"
app_import: "app.main:app"
fqdn: "api.acme.dev"
mode: "auto-pr"
inject_idempotency_rfc8941: "true"
scrub_sourcemaps_and_secrets: "true"
mcp_probe_url: "https://api.acme.dev/mcp"
specpulse_api_key: ${{ secrets.SPECPULSE_API_KEY }}
Transparent Search & Compliance Expectations
Per the Google Search Central AI Optimization Guide, publishing /llms.txt or /.well-known/ard.json does not boost Google Search organic rankings. SpecPulse v3.4 is engineered strictly for AI coding agents, Chrome Lighthouse Agentic Browsing audits, pre-connection MCP SEP-2127 discovery, and deterministic Stateless MCP 2026-07-28 tool execution.
Pricing & Instant Stripe Checkout
| Plan | Price | Included Capabilities | Direct Activation CTA |
|---|---|---|---|
| Free Sandbox | $0 / mo | Instant CLI & in-memory browser compile (up to 50 FastAPI endpoints), all 5 agent artifacts, Lighthouse ard.json v0.91 lint scorecard | Run Free Sandbox (/playground) |
| Pro | $29 / mo or $290 / yr (2 months free β $24.17/mo eq.) | Up to 10 GitHub repos with specpulse/action@v3.4 auto-PR sync, hosted edge /llms-full.txt, 4-depth isError: true MCP monitoring | Checkout Pro Monthly ($29/mo) Β· Checkout Pro Annual ($290/yr) |
| Team | $99 / mo or $990 / yr (2 months free β $82.50/mo eq.) | Unlimited FastAPI microservices, unified multi-repo ard.json catalog, custom edge domains, directional contract-drift PR gates, team RBAC | Checkout Team Monthly ($99/mo) Β· Checkout Team Annual ($990/yr) |
Structured Data (SoftwareApplication + FAQPage JSON-LD)
Stop Losing AI Search Buyers to Competitors β Go Live in 60 Seconds
No sales demos, zero lock-in, instant 1-click cancellation β’ Save 2 months on Annual plans (Pro $290/yr Β· Agency $2,990/yr)
<script src="https://specpulse.dev/embed.js" data-site="your-domain-com" defer></script>