Documentation Retrieval (Python Libraries) MCP server

Retrieves up-to-date documentation for Python libraries including LangChain, LlamaIndex, and OpenAI through targeted web searches and HTML content extraction.
Back to servers
Provider
S.S.Sreedeep
Release date
Mar 23, 2025
Language
Python
Stats
1 star

This MCP server enables AI assistants to access up-to-date documentation for Python libraries like LangChain, LlamaIndex, and OpenAI. By dynamically fetching content from official documentation sources, it ensures AI applications always have access to the latest information through the Model Context Protocol (MCP).

Prerequisites

Before installation, ensure you have:

  • Python 3.8 or higher
  • UV for Python Package Management (or pip)
  • A Serper API key (for web searches)
  • Claude Desktop or Claude Code (for testing)

Installation

Clone the Repository

git clone https://github.com/Sreedeep-SS/docret-mcp-server.git
cd docret-mcp-server

Create and Activate a Virtual Environment

On macOS/Linux:

python3 -m venv env
source env/bin/activate

On Windows:

python -m venv env
.\env\Scripts\activate

Install Dependencies

pip install -r requirements.txt

Or with UV:

uv sync

Configuration

Create a .env file in the root directory with your Serper API key:

SERPER_API_KEY=your_serper_api_key_here

Running the Server

Start the MCP server with:

python main.py

Usage

Searching Documentation

To retrieve documentation on specific topics within supported libraries:

from main import get_docs

result = await get_docs("memory management", "openai")
print(result)

This returns extracted text from relevant documentation pages.

Integrating with AI Assistants

Configure your AI assistant to interact with the server using this configuration:

{
  "servers": [
    {
      "name": "Documentation Retrieval Server",
      "command": "python /path/to/main.py"
    }
  ]
}

Adding Support for Additional Libraries

The server currently supports LangChain, LlamaIndex, and OpenAI. To add other libraries, update the docs_urls dictionary in main.py:

docs_urls = {
    "langchain": "python.langchain.com/docs",
    "llama-index": "docs.llamaindex.ai/en/stable",
    "openai": "platform.openai.com/docs",
    "new-library": "new-library-docs-url.com",
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later