FastAPI Docs Server
FreeNot checkedProvides AI assistants with real-time access to FastAPI documentation, enabling search, browsing, code examples, and comparisons.
About
Provides AI assistants with real-time access to FastAPI documentation, enabling search, browsing, code examples, and comparisons.
README
🐍 FastAPI Docs MCP Server 🤖
Real-time FastAPI documentation access for AI assistants
An MCP (Model Context Protocol) server that provides real-time access to FastAPI documentation. Use it with Claude, GitHub Copilot, or any MCP-compatible client to instantly query FastAPI docs.
Features
- Real-time documentation — Fetches directly from fastapi.tiangolo.com
- Smart search — Find docs by keyword with common alias support
- Full sitemap access — Browse all available documentation pages
- Code examples — Get just the code, no prose
- Compare approaches — Side-by-side comparisons of different patterns
Tools
| Tool | Description |
|---|---|
get_fastapi_docs(path) |
Fetch any documentation page by path |
search_fastapi_docs(query) |
Search docs by keyword (with alias support) |
list_fastapi_pages() |
List all available documentation pages |
get_fastapi_example(topic) |
Get just the code examples, no prose |
compare_fastapi_approaches(topic) |
Compare different approaches side-by-side |
get_fastapi_best_practices(topic) |
Get combined best practices from multiple pages |
Examples
Once connected, ask your AI assistant:
- "How do I set up CORS in FastAPI?"
- "Show me the FastAPI security documentation"
- "What are FastAPI dependencies?"
- "List all FastAPI tutorial pages"
- "Give me a code example for JWT authentication"
- "Compare sync vs async in FastAPI"
- "What are the best practices for testing in FastAPI?"
Installation
git clone https://github.com/jaredthivener/fastapi-docs-mcp.git
cd fastapi-docs-mcp
uv sync
Usage
With Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"fastapi-docs": {
"command": "uv",
"args": ["run", "--directory", "/path/to/fastapi-docs-mcp", "python", "main.py"]
}
}
}
With VS Code (GitHub Copilot)
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"fastapi-docs": {
"command": "uv",
"args": ["run", "--directory", "/path/to/fastapi-docs-mcp", "python", "main.py"]
}
}
}
With Docker
Build the image locally:
docker build -t fastapi-docs-mcp .
Then use this MCP server config:
{
"servers": {
"fastapi-docs": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"fastapi-docs-mcp"
],
"type": "stdio"
}
}
}
Standalone
uv run python main.py
Development
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Lint
uv run ruff check .
# Format
uv run ruff format .
# Type check
uv run mypy main.py
How It Works
The server fetches documentation directly from the official FastAPI website:
- Sitemap-based discovery — Uses
sitemap.xmlto find all available pages - Real-time fetching — Retrieves current documentation on each request
- Smart extraction — Extracts readable content from HTML pages
- Keyword aliases — Maps common terms (e.g., "auth" → "security")
Content Limits
To keep responses fast and avoid overloading AI context windows, documentation content is truncated to a maximum length (currently 15,000 characters). If a page exceeds that limit, the response ends with a truncation notice and a link to the full page.
License
MIT
Installing FastAPI Docs Server
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/jaredthivener/fastapi-docs-mcpFAQ
Is FastAPI Docs Server MCP free?
Yes, FastAPI Docs Server MCP is free — one-click install via Unyly at no cost.
Does FastAPI Docs Server need an API key?
No, FastAPI Docs Server runs without API keys or environment variables.
Is FastAPI Docs Server hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install FastAPI Docs Server in Claude Desktop, Claude Code or Cursor?
Open FastAPI Docs Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare FastAPI Docs Server with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
