FastAPI Docs MCP Server
Provides real-time access to FastAPI documentation, including tools for fetching pages by path, searching with alias support, listing all available pages, extracting code examples, comparing approaches, and retrieving best practices.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastAPI Docs MCP ServerHow do I set up CORS in FastAPI?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: DevDocs MCP Server
Tools
Tool | Description |
| Fetch any documentation page by path |
| Search docs by keyword (with alias support) |
| List all available documentation pages |
| Get just the code examples, no prose |
| Compare different approaches side-by-side |
| 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 syncUsage
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.pyDevelopment
# 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.pyHow It Works
The server fetches documentation directly from the official FastAPI website:
Sitemap-based discovery — Uses
sitemap.xmlto find all available pagesReal-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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaredthivener/fastapi-docs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server