The Documentation MCP Server is an implementation of the Model Context Protocol that allows Claude to search and access documentation from popular libraries like LangChain, LlamaIndex, and OpenAI during conversations. This tool enables Claude to provide more accurate and relevant information by searching through documentation in real-time.
uv
package managercurl -LsSf https://astral.sh/uv/install.sh | sh
# Clone or download the project
cd documentation
# Create and activate virtual environment
uv venv
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install dependencies
uv pip install -e .
Create a .env
file in the project directory with your Serper API key:
SERPER_API_KEY=your_serper_api_key_here
You can get a Serper API key by signing up at https://serper.dev.
Edit your Claude Desktop configuration file at:
/C:/Users/[Your Username]/AppData/Roaming/Claude/claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following to the mcpServers
section:
"documentation": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/YOUR/documentation",
"run",
"main.py"
]
}
Replace /ABSOLUTE/PATH/TO/YOUR/documentation
with the absolute path to your project directory.
Restart Claude Desktop to apply the new configuration.
Once connected, you can ask Claude to search through documentation using natural language:
"Can you look up information about vector stores in LangChain documentation?"
Claude will use the get_docs
tool to search for relevant information and provide you with documentation excerpts.
The get_docs
tool accepts the following parameters:
query
: The search term (e.g., "vector stores", "embedding models")library
: Which library to search (langchain, llama-index, or openai)max_chars
: Maximum characters to return (default: 1000)If you encounter issues with the MCP server:
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.