Navigation
MCP Documentation Search Server: Smart Resolution & Async Power - MCP Implementation

MCP Documentation Search Server: Smart Resolution & Async Power

MCP Documentation Search Server: FastMCP-powered engine unifying Next.js, Tailwind, Framer Motion docs with smart name resolution and async processingβ€”supercharge dev research. πŸ”πŸš€

✨ Developer Tools
4.3(126 reviews)
189 saves
88 comments

Ranked in the top 4% of all AI tools in its category

About MCP Documentation Search Server

What is MCP Documentation Search Server: Smart Resolution & Async Power?

This server is a unified interface enabling AI systems to efficiently search across multiple framework and library documentation sources. Built with FastMCP, it resolves library name variations and leverages asynchronous processing to deliver fast, accurate results through a single access point.

How to Use MCP Documentation Search Server: Smart Resolution & Async Power?

Initialization requires cloning the repository, setting up a virtual environment, and installing dependencies. Use the async get_docs() function with library names and queries. The system automatically handles name variations like "framer", "framer-motion", or "motion" for Framer Motion documentation searches.

MCP Documentation Search Server Features

Key Features of MCP Documentation Search Server: Smart Resolution & Async Power?

  • Intelligent Name Resolution: Recognizes 10+ library name variations (e.g., "langchain", "lc", "langc" for LangChain)
  • Async Processing: Parallelizes web requests and content fetching for 3x faster response times
  • Robust Search: Uses DuckDuckGo integration with site-specific targeting for precise results
  • Fail-Safe Design: Includes timeout management, input validation, and automatic retry mechanisms

Use Cases of MCP Documentation Search Server: Smart Resolution & Async Power?

Primary use cases include:

  • Developers needing rapid access to LangChain, Next.js, or Tailwind CSS docs
  • AI agents requiring cross-framework comparisons
  • Automated documentation crawlers for knowledge bases
  • Debugging scenarios where multiple library versions need simultaneous consultation

MCP Documentation Search Server FAQ

FAQ from MCP Documentation Search Server: Smart Resolution & Async Power?

  • Q: How do I add a new library?
    Update config.py with the library's URL and common aliases
  • Q: Why am I getting timeout errors?
    Increase the HTTP_TIMEOUT value in configuration settings
  • Q: Can I customize search depth?
    Adjust MAX_SEARCH_RESULTS parameter for result quantity control
  • Q: Does it handle typos in library names?
    Built-in normalization handles common misspellings and abbreviation variations

Content

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:

  • πŸ” 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
git clone <repository-url>
cd mcp-server
  1. Set Up Virtual Environment
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix or MacOS:
source .venv/bin/activate
  1. Install Dependencies
pip install -r requirements.txt
  1. 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 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:

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:

  1. Add the documentation URL in config.py:
DOCS_URLS = {
    "new-library": "https://docs.new-library.com",
    # ... existing entries
}
  1. 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:

  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 for the core functionality
  • DuckDuckGo for search capabilities
  • pytest for testing framework
  • All supported documentation providers

Related MCP Servers & Clients