https://github.com/PicardRaphael/mcp-server-documentation
๐ FastMCP-powered documentation search engine that provides unified access to multiple framework docs (Next.js, Tailwind, Framer Motion, etc.) with intelligent name resolution and async processing.
https://github.com/PicardRaphael/mcp-server-documentation
developer-tools documentation-search documentation-tools duckduckgo fastmcp python-async
Last synced: 2 months ago
JSON representation
๐ FastMCP-powered documentation search engine that provides unified access to multiple framework docs (Next.js, Tailwind, Framer Motion, etc.) with intelligent name resolution and async processing.
- Host: GitHub
- URL: https://github.com/PicardRaphael/mcp-server-documentation
- Owner: PicardRaphael
- Created: 2025-03-17T09:44:55.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-17T10:19:49.000Z (8 months ago)
- Last Synced: 2025-03-17T11:31:03.341Z (8 months ago)
- Topics: developer-tools, documentation-search, documentation-tools, duckduckgo, fastmcp, python-async
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mcp-servers - **mcp-server-documentation** - ๐ FastMCP-powered documentation search engine that provides unified access to multiple framework docs (Next.js, Tailwind, Framer Motion, etc.) with intelligent name resolution and async processing. `python` `developer-tools` `documentation-search` `documentation-tools` `duckduckgo` `pip install git+https://github.com/PicardRaphael/mcp-server-documentation` (๐ค AI/ML)
- awesome-mcp-servers - **mcp-server-documentation** - ๐ FastMCP-powered documentation search engine that provides unified access to multiple framework docs (Next.js, Tailwind, Framer Motion, etc.) with intelligent name resolution and async processing. `python` `developer-tools` `documentation-search` `documentation-tools` `duckduckgo` `pip install git+https://github.com/PicardRaphael/mcp-server-documentation` (AI/ML)
README
# 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](https://js.langchain.com/docs) - JavaScript/TypeScript LangChain documentation
- [LangGraph](https://langchain-ai.github.io/langgraphjs) - LangGraph.js documentation
- [Next.js](https://nextjs.org/docs) - Next.js framework documentation
- [Tailwind CSS](https://tailwindcss.com/docs) - Utility-first CSS framework
- [FastMCP](https://docs.fastmcp.com) - FastMCP documentation
- [Framer Motion](https://motion.dev/docs/) - 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
1. **Clone the Repository**
```bash
git clone
cd mcp-server
```
2. **Set Up Virtual Environment**
```bash
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix or MacOS:
source .venv/bin/activate
```
3. **Install Dependencies**
```bash
pip install -r requirements.txt
```
4. **Run the Server**
```bash
python main.py
```
## ๐ป Usage
### Basic Usage
```python
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:
```python
# 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 retrieval
- `test_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 function `get_docs`
### Running Tests
To run all tests:
```bash
python -m pytest
```
To run specific test modules:
```bash
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:
```bash
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:
1. Add the documentation URL in `config.py`:
```python
DOCS_URLS = {
"new-library": "https://docs.new-library.com",
# ... existing entries
}
```
2. Add common aliases:
```python
LIBRARY_ALIASES = {
"new-lib": "new-library",
# ... existing entries
}
```
### HTTP Settings
Modify in `config.py`:
```python
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:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Ensure all tests pass
6. Submit a pull request
### Adding New Libraries
1. Update `DOCS_URLS` in `config.py`
2. Add relevant aliases in `LIBRARY_ALIASES`
3. Test the integration
4. Update documentation
5. Submit a pull request
## ๐ Troubleshooting
Common issues and solutions:
- **TimeoutError**: Increase `HTTP_TIMEOUT` in `config.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](https://fastmcp.com) for the core functionality
- [DuckDuckGo](https://duckduckgo.com) for search capabilities
- [pytest](https://docs.pytest.org/) for testing framework
- All supported documentation providers