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).
Before installation, ensure you have:
git clone https://github.com/Sreedeep-SS/docret-mcp-server.git
cd docret-mcp-server
On macOS/Linux:
python3 -m venv env
source env/bin/activate
On Windows:
python -m venv env
.\env\Scripts\activate
pip install -r requirements.txt
Or with UV:
uv sync
Create a .env
file in the root directory with your Serper API key:
SERPER_API_KEY=your_serper_api_key_here
Start the MCP server with:
python main.py
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.
Configure your AI assistant to interact with the server using this configuration:
{
"servers": [
{
"name": "Documentation Retrieval Server",
"command": "python /path/to/main.py"
}
]
}
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",
}
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.
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"
]
}
}
}
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.
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.