Add your description here
Project description
MCP Documentation Search Server
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.
๐ Features
-
๐ Multi-Library Support: Search documentation across multiple libraries:
- LangChain - JavaScript/TypeScript LangChain documentation
- LangGraph - LangGraph.js documentation
- Next.js - Next.js framework documentation
- Tailwind CSS - Utility-first CSS framework
- FastMCP - FastMCP documentation
- Framer Motion - Animation library for React
-
๐ Intelligent Search
- Smart name resolution for library variations
- DuckDuckGo-powered search for accurate results
- Site-specific search targeting
-
โก Performance Features
- Asynchronous processing
- Efficient web request handling
- Parallel content fetching
-
๐ก๏ธ Robust Error Handling
- Network timeout management
- Invalid input validation
- HTTP error handling
- Request failure recovery
๐ Requirements
- Python 3.8+
- pip or uv package manager
- Virtual environment (recommended)
๐ Quick Start
- Clone the Repository
git clone <repository-url>
cd mcp-server
- Set Up Virtual Environment
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix or MacOS:
source .venv/bin/activate
- Install Dependencies
pip install -r requirements.txt
- Run the Server
python main.py
๐ป Usage
Basic Usage
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"
)
Library Name Variations
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")
๐งช Testing
The project includes a comprehensive test suite to ensure reliability and correctness. Tests are organized into three main categories:
Test Structure
-
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 services
-
Integration Tests: Test how components work together
test_main.py: Tests for the main API functionget_docs
Running Tests
To 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
Test Coverage
The tests cover:
- โ Library name normalization and validation
- โ URL retrieval for different libraries
- โ Web search functionality
- โ Content fetching and error handling
- โ Documentation search integration
- โ API input validation and error handling
- โ Alias resolution for different library name formats
Asynchronous Testing
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.
๐๏ธ Project Structure
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
๐ง Configuration
Supported Libraries
To add a new library:
- Add the documentation URL in
config.py:
DOCS_URLS = {
"new-library": "https://docs.new-library.com",
# ... existing entries
}
- Add common aliases:
LIBRARY_ALIASES = {
"new-lib": "new-library",
# ... existing entries
}
HTTP Settings
Modify in config.py:
HTTP_TIMEOUT = 30.0 # Timeout in seconds
MAX_SEARCH_RESULTS = 2 # Number of search results to fetch
๐ค Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Adding New Libraries
- Update
DOCS_URLSinconfig.py - Add relevant aliases in
LIBRARY_ALIASES - Test the integration
- Update documentation
- Submit a pull request
๐ Troubleshooting
Common issues and solutions:
- TimeoutError: Increase
HTTP_TIMEOUTinconfig.py - No Results: Try different search terms or verify the library name
- HTTP Errors: Check your internet connection and the documentation URL
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- FastMCP for the core functionality
- DuckDuckGo for search capabilities
- pytest for testing framework
- All supported documentation providers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_picardraphael_mcp_server_documentation-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_picardraphael_mcp_server_documentation-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d68164d02a97c17be06a5d70245ea0c62a0f0deec54c85c3e612aa1a1c8f22
|
|
| MD5 |
53648c2b2f0d51998585999bed5f7fb5
|
|
| BLAKE2b-256 |
c8a2544c20bd9f6f24770b9a74cc3005edf7d9ba3bd763837c85203ddb34753d
|
File details
Details for the file iflow_mcp_picardraphael_mcp_server_documentation-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_picardraphael_mcp_server_documentation-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fdc70ff5da4ab2983f241c27a860d99fd10834e43458135ec1b63c831aeca26
|
|
| MD5 |
50a6fa453b72548bc1df8af3fcabfb7d
|
|
| BLAKE2b-256 |
7661bcd56d5b95c56e7a06f4553c5a27f6b8de3ffa22f42d0f071b300c0b7972
|