Get the FREE Ultimate OpenClaw Setup Guide →

docs

This is a lightweight, plug-and-play MCP server that empowers any LLM to dynamically search and retrieve up-to-date documentation from popular AI libraries such as LangChain, LlamaIndex, and OpenAI.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rohitkrish46-docs-mcp-server uv --directory path_to_repository run main.py \
  --env SERPER_API_KEY="your_serper_api_key"

How to use

This MCP server provides a get_docs tool for querying documentation content from LangChain, LlamaIndex, and OpenAI. It integrates web search and HTML content extraction to fetch up-to-date docs and exposes a simple interface that LLMs can call in real time, enabling dynamic retrieval of relevant sections and examples from popular libraries. The server uses Serper for web search and BeautifulSoup for clean content extraction, returning concise, readable documentation text suitable for tool-assisted reasoning and response generation. You can use the tool to pull library specifics, usage patterns, and API references as you build or prompt LLMs.

To use the tool within an agent or orchestration environment, call the get_docs tool with two parameters: the search query and the target library (langchain, llama-index, or openai). For example, a request like get_docs("LangChain vector store", "langchain") will return the most relevant documentation passages related to vector stores from LangChain. The results can be fed back to the LLM for clarification, summarization, or code snippet extraction, enabling real-time, context-rich responses during planning or troubleshooting.

How to install

Prerequisites:

  • Python 3.8+ (recommended) and an environment-friendly setup (virtualenv/venv)
  • Internet access to install dependencies and access Serper API

Step-by-step installation:

  1. Clone the repository:
git clone https://github.com/your-username/mcp-docs-search.git
cd mcp-docs-search
  1. Create and activate a virtual environment (uv is used as the MCP runner):
# On macOS/Linux
python3 -m venv .venv
source .venv/bin/activate

# On Windows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
  1. Install dependencies (as described in README):
uv add "mcp[cli]" httpx
uv pip install beautifulsoup4
  1. Set up environment variables (serper API key):
# Create a .env file in the repository root
echo "SERPER_API_KEY=your_serper_api_key" > .env
  1. Run the MCP server (using uv as configured):
uv run main.py
  1. Optional: verify inspector/debug workflow if needed (as described in the debugging section):
npx @modelcontextprotocol/inspector uv run main.py

Note: Adjust the directory path in the MCP config to point to your repository location if required.

Additional notes

Tips and common issues:

  • Ensure SERPER_API_KEY is set and valid; without it, web searches will fail.
  • When running with uv, your working directory should contain main.py and the expected project structure.
  • If you modify the code paths or dependencies, update the MCP config accordingly (the command and directory args).
  • Claude Desktop integration examples assume a specific config; adapt the directory value to where your repo actually resides.
  • If you encounter network-related errors, verify that your environment allows outbound HTTP requests and that Serper API quota is not exhausted.
  • For debugging, the inspector command can help trace how queries are processed and what results are produced.

Related MCP Servers

Sponsor this space

Reach thousands of developers