Skip to main content
Glama

web-docs-mcp

Local MCP server for Kilo Code / Cline / Claude Desktop — free web search + library docs fetcher with local-first caching.

Features

  • šŸ” web_search — Free DuckDuckGo HTML search (no API key required)

  • 🌐 fetch_url — Fetch any URL and convert to clean markdown (cached locally)

  • šŸ“š lib_docs — Auto-fetch README/docs from npm, PyPI, crates.io, Go, or GitHub

  • šŸ“– search_docs — Language & API documentation search biased to official docs (MDN, docs.python.org, etc.)

  • šŸ“‚ list_docs — Browse and search your local docs/ folder first (local-first approach)

Related MCP server: Basic MCP Tools

Installation

npm install
npm run build

Usage

As MCP Server

Add to your MCP client configuration (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "web-docs-mcp": {
      "command": "node",
      "args": ["/path/to/web-docs-mcp/build/index.js"],
      "env": {
        "DOCS_DIR": "/path/to/your/docs",
        "CACHE_TTL_HOURS": "168",
        "DEFAULT_SAVE_TO_DOCS": "true"
      }
    }
  }
}

Direct Execution

# Development mode
npm run dev

# Production mode
npm run start

# Build
npm run build

# Clean build artifacts
npm run clean

Configuration

All settings are configurable via environment variables:

Variable

Default

Description

DOCS_DIR

./docs

Directory where fetched markdown docs are saved

CACHE_DIR

./.cache/web-docs

Directory for TTL cache (raw HTML + fetched markdown)

CACHE_TTL_HOURS

168 (7 days)

Cache time-to-live in hours

HTTP_TIMEOUT_MS

20000

HTTP timeout per request in milliseconds

USER_AGENT

Chrome-like UA

User-Agent sent to upstream servers

DEFAULT_SAVE_TO_DOCS

true

Default behavior for saving docs to docs/ folder

DISABLE_CACHE

false

Disable caching (useful for debugging)

GITHUB_TOKEN

none

Optional GitHub token to lift rate limits

Tools

Free web search via DuckDuckGo HTML. Returns a list of {title, url, snippet}.

{
  query: string,      // Search query
  limit?: number      // Number of results (default: 8, max: 20)
}

fetch_url

Fetch a single URL and return clean markdown. Handles HTML (via turndown+GFM), JSON (pretty-printed), and plain text.

{
  url: string,                    // URL to fetch
  save?: boolean,                 // Save to docs/ folder (default: true)
  subdir?: string                 // Subdirectory under docs/ (optional)
}

lib_docs

Fetch README/docs for a library by name. Tries npm → PyPI → crates.io → Go → GitHub automatically.

{
  name: string,                   // Library name (e.g., "react", "numpy", "serde", "owner/repo")
  save?: boolean,                 // Save to docs/libraries/ (default: true)
  subdir?: string                 // Custom subdirectory (optional)
}

search_docs

Language & API documentation search. Biases results to official docs sites. LOCAL-FIRST: searches your docs/ folder first.

{
  query: string,                  // Search query
  language?: string,              // Programming language (e.g., "python", "rust", "go")
  fetch_top?: boolean,            // Fetch full markdown of top result (default: false)
  save?: boolean,                 // Save fetched content (default: true)
  subdir?: string                 // Subdirectory under docs/api/ (optional)
}

list_docs

Browse and search the local docs/ folder. Three modes:

  1. No args = list all saved docs

  2. { query } = keyword search across docs/

  3. { path } = read full body of a specific doc by relative path or slug

{
  query?: string,                 // Keyword search (optional)
  path?: string                   // Relative path to specific doc (optional)
}

Directory Structure

web-docs-mcp/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts          # Main entry point
│   ā”œā”€ā”€ config.ts         # Configuration & env vars
│   ā”œā”€ā”€ lib/              # Core utilities
│   │   ā”œā”€ā”€ anubis.ts     # Anubis PoW solver (anti-bot bypass)
│   │   ā”œā”€ā”€ cache.ts      # Local caching logic
│   │   ā”œā”€ā”€ ddg.ts        # DuckDuckGo search
│   │   ā”œā”€ā”€ fetcher.ts    # HTTP fetching
│   │   ā”œā”€ā”€ html-to-md.ts # HTML to markdown conversion
│   │   └── ...
│   └── tools/            # MCP tool implementations
│       ā”œā”€ā”€ web_search.ts
│       ā”œā”€ā”€ fetch_url.ts
│       ā”œā”€ā”€ lib_docs.ts
│       ā”œā”€ā”€ search_docs.ts
│       └── list_docs.ts
ā”œā”€ā”€ docs/                 # Saved documentation (created on demand)
│   ā”œā”€ā”€ libraries/        # Library READMEs
│   ā”œā”€ā”€ api/              # API documentation
│   ā”œā”€ā”€ guides/           # Tutorials & how-tos
│   └── ...
ā”œā”€ā”€ .cache/               # TTL cache (auto-managed)
ā”œā”€ā”€ build/                # Compiled JavaScript
└── package.json

Supported Ecosystems

  • npm — JavaScript/TypeScript packages

  • PyPI — Python packages

  • crates.io — Rust crates

  • pkg.go.dev — Go modules

  • GitHub — Any repository (owner/repo format)

Local-First Approach

This server implements a local-first strategy:

  1. All fetched content is cached with configurable TTL

  2. search_docs checks your local docs/ folder before going to the web

  3. Subsequent calls return cached results in <5ms instead of re-fetching

  4. Perfect for offline work or rate-limited environments

Requirements

  • Node.js >= 18.17

  • npm or yarn

License

MIT

Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

Troubleshooting

Empty search results from DuckDuckGo

The User-Agent might be blocked. Try setting a custom one:

export USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"

Rate limiting on GitHub

Add a GitHub token to lift the 60 req/hour anonymous limit:

export GITHUB_TOKEN=your_token_here

Cache issues

To disable cache temporarily:

export DISABLE_CACHE=true

Or clean the cache:

npm run clean

Available Tools

5 tools
fetch_urlA

Fetch a single URL and return clean markdown. Handles HTML (via turndown+GFM), JSON (pretty-printed), and plain text. Cached locally. Optionally saves to docs/.md with YAML frontmatter (source URL, fetch date, content type).

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute http(s) URL to fetch.
nameNo
saveNo
subdirNo
refreshNo
no_anubisNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. It does mention caching locally, content type handling, and optional saving to docs/<slug>.md with YAML frontmatter. However, it omits details about side effects like overwriting files, the meaning of 'refresh' and 'no_anubis', and potential rate limits or errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary function, and every detail (content type handling, caching, saving) earns its place. It is efficient and well-structured without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description should provide more operational context. It explains the core workflow and optional save, but lacks details on refresh behavior, the no_anubis flag, file overwrite semantics, and return format nuances. It is sufficient for basic use but has notable gaps for a moderately complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 17% (only 'url' has a description). The description partially compensates by mentioning the save feature (docs/<slug>.md) which relates to 'save', 'name', and 'subdir', but it does not explicitly explain these parameters or cover 'refresh' and 'no_anubis'. Thus, it adds some meaning but not enough to fully compensate for the undocumented parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches a single URL and returns clean markdown, with specific handling for HTML, JSON, and plain text. It distinguishes from siblings like web_search by focusing on direct URL fetching rather than searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for fetching a specific URL when you have one, but it does not explicitly state when to use it over siblings or provide exclusion criteria. No alternatives are named, so usage guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lib_docsA

Fetch README/docs for a library by name. Tries npm → PyPI → crates.io → Go → GitHub automatically. Accepts react, numpy, serde, owner/repo, etc. Optionally saves to docs/libraries/.md.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesLibrary name. Examples: `react`, `express`, `numpy`, `serde`, `github.com/gin-gonic/gin`, `owner/repo`.
saveNo
refreshNo
versionNo
ecosystemNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses key behavioral traits: the automatic fallback sequence across package registries and the optional side effect of saving to a file. Since no annotations are provided, this adds meaningful context beyond the schema, though it omits failure handling and return behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally concise at two sentences, with the main purpose stated first and supplementary details following. Every word contributes useful information; no redundant or vague language.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description leaves significant gaps: there is no output schema, yet the return value (does it return content or just save to file?) is not explained. The `refresh`, `version`, and `ecosystem` parameters are completely undocumented, and the empty enum for ecosystem is confusing. The description covers only the basic use case.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds value for the `name` parameter (format examples) and the `save` parameter (destination path), but schema coverage is low (20%) and the remaining parameters (refresh, version, ecosystem) are not explained in either schema or description. The description does not fully compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Fetch' and the resource 'README/docs for a library by name', with concrete examples like `react` and `owner/repo`. It differentiates itself from sibling tools (web_search, fetch_url, search_docs, list_docs) by focusing specifically on library documentation retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: use this tool when you need docs for a specific library, with automatic ecosystem detection. It does not explicitly state exclusions or alternative tools, but the intended usage is evident from the phrasing and examples.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_docsA

Browse and search the local docs/ folder. Three modes: (1) no args = list all saved docs, (2) { query } = keyword search across docs/, (3) { path } = read the full body of a specific doc by relative path or slug. Use this BEFORE going to the web — your project may already have the docs you need.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo
limitNo
queryNo
subdirNo

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses three behavioral modes and states that path 'read the full body' of a doc. It does not mention effects of limit or subdir, but the read-only nature is implied. No annotations are provided, so this description carries the burden and mostly succeeds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with purpose and modes. The first sentence is dense but efficient; the second adds practical guidance. Every sentence earns its place, though the structure could be slightly clearer.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the core functionality and gives usage guidance, but lacks explanation for limit and subdir parameters, and does not position itself relative to search_docs. For a 4-param tool with no output schema and no annotations, this is a notable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description explains 'query' and 'path' parameters but omits 'limit' and 'subdir', leaving their semantics unresolved. It partially compensates for the missing schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool browses and searches the local docs/ folder and enumerates three distinct modes (list all, keyword search, read by path). It differentiates from web tools with 'before going to the web', but does not explicitly distinguish it from the sibling search_docs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to use this before going to the web, implying local docs should be checked first. However, it does not mention when not to use it or how it compares to sibling search_docs, leaving some ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_docsA

Language & API documentation search. Biases DuckDuckGo results to official docs sites (MDN, docs.python.org, pkg.go.dev, doc.rust-lang.org, etc.). Set fetch_top=true to retrieve the full markdown of the top hit instead of just the result list. LOCAL-FIRST: searches your docs/ folder first; only falls back to the web if no local match.

ParametersJSON Schema
NameRequiredDescriptionDefault
saveNo
queryYesWhat to look up, e.g. `Array.prototype.map` or `asyncio.gather`.
targetNo
fetch_topNo
local_onlyNo
skip_localNo

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the burden. It discloses the local-first search behavior, web fallback, bias toward official docs, and the effect of fetch_top=true. However, it does not mention potential side effects or explain the behavior of all parameters (e.g., save, target), which leaves some opacity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the core purpose, and includes only essential details (official docs, local-first, fetch_top). No filler or redundant statements.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters and no output schema, the description should explain return values and remaining parameters. It partially explains the difference between result list and markdown via fetch_top, but does not cover the behavior of local_only/skip_local/save or define the return structure sufficiently. Gaps remain for a complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 17%, so the description must compensate. It does add semantic clarity for fetch_top and implies meaning for local behavior, but it does not explicitly explain local_only, skip_local, save, or target. The addition of fetch_top semantics is helpful but incomplete for such low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it's a search tool for 'Language & API documentation' and differentiates itself from siblings by detailing a bias toward official docs and a local-first approach. The verb+resource is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context on when the tool is appropriate (language/API documentation lookups) and describes the local-first behavior with web fallback. It does not explicitly list exclusions or alternatives, but the context is strong enough to guide selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
Disambiguation4/5

Most tools have clear boundaries: fetch_url retrieves a specific URL, lib_docs fetches library docs by name, list_docs works with local files. The main overlap is between web_search and search_docs, both performing web searches, though search_docs is specifically biased to official documentation and is local-first, which distinguishes it. Descriptions are detailed enough to disambiguate in practice.

Naming Consistency4/5

All names use lowercase snake_case with an underscore, and most follow a verb_noun pattern (fetch_url, search_docs, list_docs). However, web_search is noun_verb order and lib_docs is noun_noun, which are minor deviations from the dominant pattern. Overall the style is consistent and readable.

Tool Count5/5

Five tools is a well-scoped size for a documentation reference server. Each tool serves a clear function: web search, URL fetching, library-specific fetching, docs search, and local docs browsing. This is within the ideal 3-15 range and there is no bloat.

Completeness5/5

The tool set covers the full workflow for web documentation research: searching the web, fetching pages, retrieving library docs, searching with docs bias, and managing local saved docs. The optional saving via fetch_url and lib_docs, plus list_docs for browsing, avoids dead ends. No critical gaps are evident for the documented purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    A self-hosted MCP server providing private web search, web page fetching, and current date/time tools, powered by a bundled SearXNG instance for API-key-free local search.
    2
  • A
    license
    Not graded
    quality
    C
    maintenance
    A fully local MCP server that provides web search via self-hosted SearXNG and page-to-markdown conversion (static and JS-rendered), all aggregated behind a single endpoint for use with AI assistants.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server enabling local-first web search, fetch, extract, and caching with citeable excerpts, no API key required. Supports research workflows for agents and apps.
    18
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Aleksandrr/web-docs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server