Package Exports
- webdocs-mcp-server
- webdocs-mcp-server/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webdocs-mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ WebDocs MCP Server
AI-Powered Documentation Search & Retrieval System
A Model Context Protocol (MCP) server that fetches real-time documentation from popular libraries and frameworks using web search.
๐ Features
- ๐ Real-time Documentation Search - Fetches the latest docs from official sources
- ๐ Multiple Library Support - Langchain, Llama-Index, OpenAI, UV, and Qubrid
- ๐งน Clean Content Extraction - Removes HTML noise and returns readable text
- ๐ Source Attribution - Every piece of content includes its source URL
- โก Fast & Async - Built with async/await for optimal performance
- ๐ค MCP Compatible - Works seamlessly with Claude Desktop and other MCP clients
Claude Desktop Usage Demo Screenshots

๐ฆ Supported Libraries
| Library | Documentation Site |
|---|---|
| ๐ฆ Langchain | python.langchain.com/docs |
| ๐ฆ Llama-Index | docs.llamaindex.ai/en/stable |
| ๐ค OpenAI | platform.openai.com/docs |
| ๐ฆ UV | docs.astral.sh/uv |
| ๐ฏ Qubrid | docs.qubrid.com |
๐ ๏ธ Installation
Quick Start (Recommended - NPM)
The easiest way to use this MCP server is via npx:
npx -y webdocs-mcp-serverThis requires:
- Node.js 16+ installed
- UV package manager (installation guide)
Manual Installation (For Development)
Prerequisites
- Python 3.10 or higher
- UV package manager
Setup
Clone the repository
git clone <your-repo-url> cd Docu_MCP
Install dependencies
uv syncSet up environment variables
Create a
.envfile in the project root:SERPER_API_KEY=your_serper_api_key_here GROQ_API_KEY=your_groq_api_key_here
๐ API Keys Setup
1. Serper API Key (Required)
The Serper API is used for web search functionality.
- Visit serper.dev
- Sign up for a free account
- Navigate to your dashboard
- Copy your API key
- Add it to your
.envfile
2. Groq API Key (Optional)
Currently reserved for future LLM integration features.
- Visit console.groq.com
- Sign up and get your API key
- Add it to your
.envfile
๐ Usage
Option 1: Using the MCP Client (Python)
Test the server directly with the included client:
uv run mcp_client.pyExample output:
Available Tools: ['get_docs']
[Documentation content with sources...]You can customize the query in mcp_client.py:
query = "How to setup ComfyUI AI ML Template?"
library = "qubrid"
res = await session.call_tool(
"get_docs",
arguments={"user_query": query, "library": library}
)Option 2: Using Claude Desktop
Step 1: Configure Claude Desktop
Open your Claude Desktop config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
๐ Recommended: NPM Installation (Remote)
Add this configuration to use the published npm package:
{
"mcpServers": {
"WebDocs": {
"command": "npx",
"args": ["-y", "webdocs-mcp-server"],
"env": {
"SERPER_API_KEY": "your_serper_api_key_here",
"GROQ_API_KEY": "your_groq_api_key_here"
}
}
}
}๐ป Alternative: Local Development
If you're developing locally, use this configuration:
{
"mcpServers": {
"WebDocs": {
"command": "C:\\Users\\YOUR_USERNAME\\.local\\bin\\uv.EXE",
"args": ["--directory", "D:\\Path\\To\\Docu_MCP", "run", "mcp_server.py"],
"env": {
"SERPER_API_KEY": "your_serper_api_key_here",
"GROQ_API_KEY": "your_groq_api_key_here"
}
}
}
}โ ๏ธ Important:
- For NPM method: Just add your API keys
- For local method: Replace
YOUR_USERNAMEandD:\\Path\\To\\Docu_MCPwith your actual paths!
Step 2: Restart Claude Desktop
- Completely close Claude Desktop
- Reopen Claude Desktop
- The WebDocs tool should now be available
Step 3: Use the Tool
In Claude Desktop, you can ask:
"Use the WebDocs tool to search for how to create a ReAct agent in Langchain"
Claude will automatically call the get_docs tool with the appropriate parameters.
Option 3: Using MCP Inspector (Debugging)
The MCP Inspector is a powerful tool for testing and debugging your MCP server.
Start the Inspector
npx @modelcontextprotocol/inspector uv --directory "D:\AbhiiiMan Codes\Docu_MCP" run mcp_server.pyThis will:
- Start the MCP server
- Launch a web interface at
http://localhost:5173 - Allow you to interactively test the server
Using the Inspector
- Open your browser to the provided URL
- Click "Connect" to establish connection
- Navigate to "Tools" tab
- Select
get_docstool - Fill in the parameters:
user_query: Your search querylibrary: One oflangchain,llama-index,openai,uv, orqubrid
- Click "Run Tool" to test
Troubleshooting
If port is already in use:
# Find and kill the process using port 6277
netstat -ano | findstr :6277
taskkill /PID <process_id> /F๐ง Available Tools
get_docs
Searches and retrieves documentation content from supported libraries.
Parameters:
user_query(string, required): The search query- Example:
"How to use Langchain with OpenAI"
- Example:
library(string, required): The library to search- Options:
langchain,llama-index,openai,uv,qubrid
- Options:
Returns:
- Text content from documentation with source URLs
Example:
await session.call_tool(
"get_docs",
arguments={
"user_query": "vector store integration",
"library": "langchain"
}
)๐ Project Structure
Docu_MCP/
โโโ ๐ mcp_server.py # Main MCP server implementation
โโโ ๐ mcp_client.py # Test client for the server
โโโ ๐ constants.py # Configuration and constants
โโโ ๐ utils.py # Utility functions (HTML cleaning)
โโโ ๐ test_server.py # Server launch test script
โโโ ๐ .env # Environment variables (create this)
โโโ ๐ pyproject.toml # Project dependencies
โโโ ๐ README.md # This file๐ How It Works
graph LR
A[User Query] --> B[MCP Server]
B --> C[Serper API]
C --> D[Google Search]
D --> E[Documentation URLs]
E --> F[Fetch Content]
F --> G[Clean HTML]
G --> H[Return Text]
H --> I[User/Claude]- Query Construction: Combines library domain with user query
- Web Search: Uses Serper API to search Google
- Content Fetching: Retrieves raw HTML from documentation pages
- Content Cleaning: Extracts readable text using Trafilatura
- Response Formation: Formats content with source attribution
๐ Debugging & Testing
Test Server Launch
Run the test script to verify configuration:
uv run test_server.pyExpected output:
โ
Server process started successfully!
โ
Server is running and accepting connections!Common Issues
| Issue | Solution |
|---|---|
๐ด PORT IS IN USE |
Kill process on port 6277 or use different port |
๐ด SERPER_API_KEY not found |
Check .env file exists and contains valid key |
๐ด program not found |
Use full path to uv.EXE in Claude config |
Enable Debug Logging
Add to your .env:
LOG_LEVEL=DEBUG๐ฏ Example Use Cases
1. Learning New Framework
Query: "Getting started with vector stores"
Library: "langchain"
โ Returns: Setup guides, installation steps, basic examples2. Troubleshooting
Query: "Error handling in async queries"
Library: "llama-index"
โ Returns: Error handling patterns, best practices3. API Reference
Query: "Chat completion parameters"
Library: "openai"
โ Returns: Parameter documentation, examples, limits4. Tool Setup
Query: "Installing UV on Windows"
Library: "uv"
โ Returns: Installation guide, configuration steps๐ค Contributing
Contributions are welcome! Here's how you can help:
- Add More Libraries: Update
constants.pywith new documentation sources - Improve Content Cleaning: Enhance the HTML extraction in
utils.py - Add Features: Implement caching, rate limiting, or semantic search
- Fix Bugs: Report issues or submit pull requests
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- FastMCP - MCP server framework
- Serper - Web search API
- Trafilatura - Web content extraction
- Model Context Protocol - MCP specification
๐ง Support
Having issues? Here's how to get help:
- ๐ Check this README thoroughly
- ๐ Use MCP Inspector for debugging
- ๐ฌ Open an issue on GitHub
Built with โค๏ธ by AbhiiiMan
โญ Star this repo if you find it helpful!