fastapi-docs
Provides semantic search, topic listing and retrieval, code example extraction, and version comparison for FastAPI documentation.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π MCP FastAPI Docs
Intelligent FastAPI Documentation Search via Model Context Protocol (MCP)
A standalone MCP server that provides semantic search, topic exploration, and code ex## οΏ½ Documentation
π Complete Documentation - Full documentation with table of contents
Quick Links
Getting Started
Installation - Set up your environment
Initial Setup - Populate the cache
Quick Start - Run your first queries
Integration Guides
LLM Quick Start - Integrate with AI assistants
Claude Desktop - Claude setup guide
VS Code Setup - VS Code configuration
Development
Testing Guide - Run and write tests
Architecture - Understand the codebase
Contributing - How to contributextraction for FastAPI documentation. Perfect for AI assistants like Claude, Copilot, and other LLM-powered tools.
π Features
οΏ½ Semantic Search - Natural language queries powered by sentence transformers
π Topic Listing - Browse all 104 FastAPI documentation topics
π Topic Retrieval - Get full content for any specific topic
π» Code Examples - Extract code snippets with language and syntax highlighting
π Version Comparison - Compare features across different FastAPI versions
β‘ Fast & Local - Runs entirely on your machine with ChromaDB vector storage
π― Zero Config - Works out of the box with sensible defaults
Related MCP server: FastAPI Docs MCP Server
π― Quick Start
Prerequisites
Python 3.10 or higher
uv (recommended) or pip
Installation
# Clone the repository
git clone https://github.com/yourusername/mcp-fastapi-docs.git
cd mcp-fastapi-docs
# Install dependencies with uv (recommended)
uv sync
# Or with pip
pip install -e .Initial Setup
Populate the cache with FastAPI documentation:
uv run python scripts/populate_cache.pyThis downloads FastAPI docs and builds the vector database (takes 2-3 minutes).
οΏ½ Usage
1. As an MCP Server (Recommended)
Configure your MCP client (Claude Desktop, VS Code, etc.):
{
"mcpServers": {
"fastapi-docs": {
"command": "uv",
"args": ["run", "mcp-fastapi-docs"],
"env": {
"CACHE_DIR": "/absolute/path/to/cache",
"LOG_LEVEL": "INFO"
}
}
}
}See LLM_QUICK_START.md for detailed integration guides.
2. Direct Python API
import asyncio
from mcp_fastapi_docs.server.tools import search_docs, list_topics, get_topic
async def main():
# Search documentation
results = await search_docs("how to use path parameters", version="latest")
# List all topics
topics = await list_topics(version="latest")
# Get specific topic
content = await get_topic("Path Parameters", version="latest")
asyncio.run(main())3. Interactive Testing
# Manual testing
uv run python scripts/test_mcp_manual.py
# Interactive CLI
uv run python scripts/test_interactive.pyπ οΈ Available Tools
The MCP server exposes 6 powerful tools:
Tool | Description | Parameters |
| Semantic search across documentation |
|
| List all available documentation versions | None |
| List all available topics |
|
| Get full content for a topic |
|
| Extract code examples for a feature |
|
| Compare a feature across versions |
|
All tools support version="latest" which automatically resolves to the newest available version.
π Project Structure
mcp-fastapi-docs/
βββ src/mcp_fastapi_docs/
β βββ core/ # Cache, fetcher, processor
β βββ models/ # Pydantic models & config
β βββ search/ # Semantic search engine
β βββ server/ # MCP server & tool registry
β βββ utils/ # Logging utilities
βββ scripts/ # Setup & testing scripts
βββ cache/ # Local documentation & embeddings
βββ docs/ # Documentation guides
βββ tests/ # Pytest test suite
βββ examples/ # Usage examplesπ§ͺ Testing
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/mcp_fastapi_docs --cov-report=html
# Test specific functionality
uv run python scripts/test_search.pySee TESTING.md for comprehensive testing guide.
π VS Code Integration
This project includes VS Code MCP server configuration:
Open workspace in VS Code
MCP server auto-registers via
.vscode/mcp.jsonUse Copilot or other MCP extensions to query FastAPI docs
See .vscode/README_MCP.md for details.
π Learning & Extending
This project is designed as a learning template for building MCP servers:
Self-contained - All components in one repo
Well-documented - Extensive inline comments & guides
Modular design - Easy to adapt for other frameworks
Best practices - Type hints, async/await, proper error handling
Want to build similar servers for Flask or Django? This codebase serves as a complete reference implementation.
οΏ½ Documentation
LLM Quick Start - Get started with LLM integration
LLM Integration Guide - Detailed integration patterns
Quick Test Guide - Testing walkthrough
Testing Guide - Comprehensive test documentation
VS Code Setup - VS Code configuration
π€ Contributing
Contributions are welcome! This project follows standard open-source practices:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π Troubleshooting
Issue: No FastAPI documentation versions available
Solution: Run
uv run python scripts/populate_cache.py
Issue: Import errors or missing dependencies
Solution: Run
uv syncorpip install -e .
Issue: MCP server not responding
Solution: Check logs in
cache/logs/mcp-fastapi-docs.log
π License
MIT License - see LICENSE for details.
π Acknowledgments
FastAPI - The amazing framework this serves
Model Context Protocol - The protocol powering AI integration
ChromaDB - Vector database for semantic search
Sentence Transformers - Embedding models
π Future Plans
Support for multiple FastAPI versions
Incremental cache updates
Full-text search alongside semantic search
Web UI for documentation browsing
API rate limiting and caching strategies
Built with β€οΈ for the FastAPI and AI community
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Ingest, manage, and retrieve documents for RAG-powered AI applications
Provide your AI coding tools with token-efficient access to up-to-date technical documentation forβ¦
Search and read Vector Panda docs: API operations, pricing, storage tiers, measured benchmarks.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch, index, and perform semantic RAG-based searches on API documentation from various sources. It provides tools for hybrid search and collection management, allowing users to access up-to-date documentation from projects like Gemini and FastMCP.-
- AlicenseAqualityBmaintenanceProvides AI assistants with real-time access to FastAPI documentation, enabling search, browsing, code examples, and comparisons.64MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to search and retrieve information from large technical documentation (OpenAPI specs, markdown) via intelligent chunking and semantic search.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to search and read FastAPI documentation through hybrid semantic and keyword retrieval, returning ranked, citable sections and full pages as structured, typed results. All retrieved text is screened by a prompt-injection guard that strips suspicious instructions and flags the results, so only indexed pages can be read and nothing hostile reaches the model.MIT