Skip to main content
Glama
README.md
# πŸ“š LiveDocs MCP

> **Give your AI the docs it actually needs β€” fresh from the source, every time.**

![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&logoColor=white)
![FastMCP](https://img.shields.io/badge/FastMCP-4.x-blueviolet)
![License](https://img.shields.io/badge/License-MIT-green)
![Libraries](https://img.shields.io/badge/Libraries-45%2B-orange)
![Deploy](https://img.shields.io/badge/Deploy-Render-46E3B7?logo=render)

---

## πŸ”Ž The Problem

Every AI engineer has hit this wall:

> _"Claude is giving me the LangChain v0.1 API but we're on v0.3"_
> _"Why is the OpenAI example broken β€” oh, they changed the client in v1.0"_
> _"The CrewAI docs changed again, my code is outdated"_

LLMs are trained on a **snapshot of the internet**. Documentation moves fast. Your AI assistant doesn't.

**LiveDocs MCP bridges that gap.** It connects Claude (or any MCP-compatible AI) directly to official documentation websites in real time β€” no stale training data, no hallucinated APIs.

---

## ✨ Features

| Feature                    | Description                                                    |
| -------------------------- | -------------------------------------------------------------- |
| πŸ”΄**Live Docs**            | Fetches directly from official docs β€” always current           |
| πŸ“¦**45+ Libraries**        | Every major AI engineering library covered                     |
| ⚑**Smart Cache**          | 24-hour TTL cache β€” fast repeat queries, no wasted API calls   |
| πŸ”**Multi-Library Search** | Compare docs across frameworks side-by-side                    |
| πŸ’»**Code Extraction**      | Hunts for code-block-rich pages automatically                  |
| πŸ”’**Version-Aware**        | Pin to a specific version (e.g.`v0.2`, `2.1.0`)                |
| πŸ”‘**BYOK**                 | Bring Your Own Serper API key per request                      |
| 🌐**Remote-Ready**         | Deploy as HTTP/SSE server β€” share one URL with your whole team |

---

## πŸ“¦ Supported Libraries (45+)

<details>
<summary><strong>πŸ€– LLM Providers</strong></summary>

| Key         | Library       | Description                             |
| ----------- | ------------- | --------------------------------------- |
| `openai`    | OpenAI        | GPT-4o, embeddings, DALLΒ·E, Whisper     |
| `anthropic` | Anthropic     | Claude API β€” messages, tool use, vision |
| `groq`      | Groq          | Ultra-fast LLM inference                |
| `mistral`   | Mistral AI    | Mixtral, Mistral-7B                     |
| `cohere`    | Cohere        | Command R, Embed, Rerank                |
| `together`  | Together AI   | Open-source model inference             |
| `replicate` | Replicate     | Run open-source models via API          |
| `google_ai` | Google Gemini | Gemini Pro, Flash, embeddings           |

</details>

<details>
<summary><strong>πŸ”— LLM Frameworks</strong></summary>

`langchain` Β· `langgraph` Β· `langsmith` Β· `llama_index` Β· `haystack` Β· `dspy`

</details>

<details>
<summary><strong>πŸ•΅οΈ Agent Frameworks</strong></summary>

`crewai` Β· `autogen` Β· `semantic_kernel` Β· `smolagents` Β· `pydantic_ai`

</details>

<details>
<summary><strong>πŸ—„οΈ Vector Databases</strong></summary>

`pinecone` Β· `weaviate` Β· `chromadb` Β· `qdrant` Β· `milvus` Β· `pgvector`

</details>

<details>
<summary><strong>🧠 ML Models & Embeddings</strong></summary>

`huggingface` Β· `sentence_transformers`

</details>

<details>
<summary><strong>πŸ“Š Observability & MLOps</strong></summary>

`langsmith` Β· `weights_biases` Β· `mlflow`

</details>

<details>
<summary><strong>🌐 Web Frameworks</strong></summary>

`fastapi` Β· `pydantic` Β· `django` Β· `flask`

</details>

<details>
<summary><strong>πŸ’Ύ Databases & ORMs</strong></summary>

`sqlalchemy` Β· `supabase` Β· `prisma` Β· `redis`

</details>

<details>
<summary><strong>🐍 Python & DevOps</strong></summary>

`uv` Β· `ruff` Β· `pytest` Β· `docker` Β· `pandas` Β· `polars`

</details>

---

## πŸ› οΈ MCP Tools Reference

| Tool                                                  | Description                              |
| ----------------------------------------------------- | ---------------------------------------- |
| `get_docs(query, library, version?, serper_api_key?)` | Fetch live docs for any library          |
| `search_docs_multi(query, libraries[])`               | Search across multiple libraries at once |
| `get_code_examples(query, library, language?)`        | Targeted code snippet extraction         |
| `list_libraries(category?)`                           | Browse all 45+ supported libraries       |
| `cache_stats()`                                       | View cache hits / entries / TTL          |

---

## πŸš€ Quick Start

### Option 1 β€” Remote Server (Recommended β€” no install needed)

Add this to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "live-docs": {
      "url": "https://live-docs-mcp.onrender.com/sse"
    }
  }
}
```

> **Config file location:**
>
> - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
> - Windows: `%APPDATA%\Claude\claude_desktop_config.json`

---

### Option 2 β€” Local (Self-Hosted)

**Prerequisites:** Python 3.11+, [uv](https://docs.astral.sh/uv)

```bash
# 1. Clone
git clone https://github.com/NoumanZahid-85/live-docs-mcp.git
cd live-docs-mcp

# 2. Install dependencies
uv sync

# 3. Configure
cp .env.example .env
# Edit .env and add your SERPER_API_KEY (free at https://serper.dev)

# 4. Test the CLI client
uv run python mcp_client.py
# > Library: openai
# > Query: streaming chat completion
```

**Claude Desktop config (local stdio):**

```json
{
  "mcpServers": {
    "live-docs": {
      "command": "uv",
      "args": ["run", "python", "mcp_server.py"],
      "cwd": "/absolute/path/to/live-docs-mcp",
      "env": {
        "SERPER_API_KEY": "your_serper_api_key"
      }
    }
  }
}
```

---

## 🌐 Deploy Your Own Instance

### Render (Free Tier)

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)

1. Fork this repo
2. Connect to [Render](https://render.com) β†’ **New Web Service** β†’ select your fork
3. Set environment variable `SERPER_API_KEY` in the Render dashboard
4. Render auto-detects `render.yaml` and deploys

Your server will be live at `https://your-service.onrender.com/sse`.

---

## πŸ—οΈ Architecture

```mermaid
graph TD
    A[Claude / AI Client] -->|MCP Protocol| B[LiveDocs MCP Server]

    B --> C{Cache Hit?}
    C -->|Yes - 24h TTL| D[Return Cached Result]
    C -->|No| E[Serper Google Search API]

    E --> F[Top 5 Doc URLs]
    F --> G[Concurrent HTTP Fetch]
    G --> H[trafilatura HTML β†’ Text]
    H --> I[Code Block Extraction]
    I --> J[Cache + Return]

    B --> K[list_libraries]
    B --> L[cache_stats]

    subgraph Tools
        B --> M[get_docs]
        B --> N[search_docs_multi]
        B --> O[get_code_examples]
    end
```

---

## πŸ”‘ API Keys

| Key              | Purpose                   | Free Tier               | Get It                                       |
| ---------------- | ------------------------- | ----------------------- | -------------------------------------------- |
| `SERPER_API_KEY` | Google search via Serper  | βœ… 2,500 searches/month | [serper.dev](https://serper.dev)             |
| `GROQ_API_KEY`   | LLM answers in CLI client | βœ… Generous free tier   | [console.groq.com](https://console.groq.com) |

---

## πŸ’‘ Example Prompts

Once connected in Claude, try:

```
"Search the LangChain docs for how to use structured output with tool calling"

"Compare how LangChain and LlamaIndex implement document chunking"

"Get me a code example for streaming with the OpenAI Assistants API"

"What changed in CrewAI v0.7?"

"List all supported vector database libraries"
```

---

## πŸ—‚οΈ Project Structure

```
live-docs-mcp/
β”œβ”€β”€ mcp_server.py      # πŸš€ Production MCP server (5 tools)
β”œβ”€β”€ mcp_client.py      # πŸ–₯️ Interactive CLI client
β”œβ”€β”€ libraries.py       # πŸ“‹ Registry of 45+ libraries
β”œβ”€β”€ cache.py           # ⚑ TTL in-memory cache
β”œβ”€β”€ utils.py           # πŸ”§ HTML extractor + code parser
β”œβ”€β”€ render.yaml        # 🌐 One-click Render deployment
β”œβ”€β”€ pyproject.toml     # πŸ“¦ Dependencies (uv)
β”œβ”€β”€ .env.example       # πŸ”‘ Environment variable template
└── README.md
```

---

## 🀝 Contributing

Want to add a library? Edit `libraries.py` β€” it takes 5 lines:

```python
"your_library": {
    "site": "docs.your-library.com",
    "description": "Short description of the library",
    "category": "llm_frameworks",   # see existing categories
    "aliases": ["yl", "yourlib"],   # optional short names
},
```

Then open a PR. ✨

---

## πŸ“„ License

MIT β€” free to use, modify, and deploy.

---

<p align="center">Built with ❀️ for AI engineers who are tired of stale docs.</p>

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a generally clear role: single-library docs, multi-library search, code examples, library listing, and cache stats. The only minor overlap is between get_docs and get_code_examples, but the descriptions explicitly differentiate them by focusing on prose/docs versus code-rich pages.

Naming Consistency4/5

Most tools follow a verb_noun pattern: get_docs, search_docs_multi, get_code_examples, list_libraries. cache_stats breaks the pattern by being noun_noun, and search_docs_multi's suffix is slightly irregular, but overall the naming is predictable and readable.

Tool Count5/5

Five tools is well-scoped for a documentation-fetching server. Each tool serves a distinct and useful purpose without redundancy or bloat, and the count feels appropriate for the narrow but valuable domain.

Completeness5/5

The tool surface covers the core documentation workflows: fetching live docs, searching across libraries, retrieving code examples, discovering supported libraries, and inspecting cache health. No obvious dead ends or missing critical operations for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues