Documentation Search
STDIOMulti-library documentation search server enabling AI systems to intelligently search framework documentation sources
Multi-library documentation search server enabling AI systems to intelligently search framework documentation sources
A powerful documentation search server built with FastMCP, enabling AI systems to intelligently search across multiple popular framework and library documentations. This tool ensures that AI models can quickly access and retrieve relevant information from various documentation sources using a unified interface.
📚 Multi-Library Support: Search documentation across multiple libraries:
🔍 Intelligent Search
⚡ Performance Features
🛡️ Robust Error Handling
git clone <repository-url> cd mcp-server
python -m venv .venv # On Windows: .venv\Scripts\activate # On Unix or MacOS: source .venv/bin/activate
pip install -r requirements.txt
python main.py
from main import get_docs # Search Framer Motion documentation result = await get_docs( query="how to animate on scroll", library="framer-motion" ) # Search Next.js documentation result = await get_docs( query="how to use app router", library="next" )
The system intelligently handles various library name formats:
# All these calls will work the same way await get_docs(query="animations", library="framer") await get_docs(query="animations", library="framermotion") await get_docs(query="animations", library="framer-motion") await get_docs(query="animations", library="motion")
The project includes a comprehensive test suite to ensure reliability and correctness. Tests are organized into three main categories:
Unit Tests: Test individual components in isolation
test_utils.py: Tests for library name normalization and URL retrievaltest_services.py: Tests for web search and content fetching servicesIntegration Tests: Test how components work together
test_main.py: Tests for the main API function get_docsTo run all tests:
python -m pytest
To run specific test modules:
python -m pytest tests/test_utils.py python -m pytest tests/test_services.py python -m pytest tests/test_main.py
To run tests with verbose output:
python -m pytest -v
The tests cover:
The project uses a custom run_async helper function to test asynchronous code in a synchronous test environment. This approach allows for testing async functions without requiring complex test setup.
mcp-server/
├── main.py          # Entry point and FastMCP tool definition
├── config.py        # Configuration settings and constants
├── services.py      # Web search and content fetching services
├── utils.py         # Utility functions for library name handling
├── tests/           # Test suite
│   ├── test_utils.py    # Tests for utility functions
│   ├── test_services.py # Tests for web services
│   ├── test_main.py     # Tests for main API
│   └── conftest.py      # Pytest configuration
├── requirements.txt # Project dependencies
└── README.md        # Documentation
To add a new library:
config.py:DOCS_URLS = { "new-library": "https://docs.new-library.com", # ... existing entries }
LIBRARY_ALIASES = { "new-lib": "new-library", # ... existing entries }
Modify in config.py:
HTTP_TIMEOUT = 30.0 # Timeout in seconds MAX_SEARCH_RESULTS = 2 # Number of search results to fetch
We welcome contributions! Here's how you can help:
DOCS_URLS in config.pyLIBRARY_ALIASESCommon issues and solutions:
HTTP_TIMEOUT in config.pyThis project is licensed under the MIT License - see the LICENSE file for details.