Skip to main content
Glama
rkratky

DocsHub MCP Server

by rkratky

DocsHub MCP Server

An MCP server that provides AI clients with access to developer documentation via llms.txt files. Exposes tools, resources, and prompts.

Prerequisites

You must have uv installed on your machine. (macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh)

Related MCP server: MCP LLMS-TXT Documentation Server

Configuration

DocsHub loads its project list from a docs_config.yaml file. Sources are tried in this order:

  1. DOCSHUB_CONFIG environment variable — set to a local file path or a remote https:// URL pointing to a raw YAML file (e.g. a file hosted in a GitHub repository)

  2. docs_config.yaml in the working directory

  3. ~/.config/docshub/docs_config.yaml — user-level config

  4. Bundled default — the docs_config.yaml in the DocsHub repo (used automatically as a fallback when no other config is found)

The YAML format:

projects:
  - name: "FastAPI"
    description: "FastAPI official documentation"
    llms_txt_url: "https://fastapi.tiangolo.com/llms.txt"

Using a remote config from a GitHub repository:

Set DOCSHUB_CONFIG to the raw file URL:

DOCSHUB_CONFIG=https://raw.githubusercontent.com/ORG/docshub/main/docs_config.yaml

You can pass this to any AI client as an environment variable in its MCP server configuration (see Client Setup below).

Environment variables

Variable

Default

Description

DOCSHUB_CONFIG

(none)

Local file path or https:// URL to the config file.

DOCSHUB_CONFIG_RELOAD_INTERVAL

900

Seconds between config reload checks. The server polls this source in the background and notifies clients when the project list changes. Set to 0 to disable polling entirely.

DOCSHUB_CACHE_TTL

1800

Seconds to cache fetched documentation in memory. Subsequent tool calls within the TTL window are served instantly without a network round-trip. Set to 0 to disable caching.


Client Setup

MCP server configuration

Claude Desktop, VS Code Cline, and GitHub Copilot CLI use the same JSON format. Add this block to the mcpServers object in each client's config file (see per-client instructions below):

{
  "mcpServers": {
    "docshub": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/rkratky/docshub",
        "docshub"
      ]
    }
  }
}

To load a remote docs_config.yaml, add an env key:

{
  "mcpServers": {
    "docshub": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/rkratky/docshub",
        "docshub"
      ],
      "env": {
        "DOCSHUB_CONFIG": "https://raw.githubusercontent.com/ORG/docshub/main/docs_config.yaml"
      }
    }
  }
}

Claude Desktop

  1. Open your configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. Add the configuration block above to the mcpServers object.

  3. Completely quit and restart Claude Desktop.


VS Code — Cline extension

  1. Open VS Code and open the Cline extension sidebar.

  2. Click the MCP Servers icon → Configure MCP Servers to open cline_mcp_settings.json.

  3. Add the configuration block above to the mcpServers object.

  4. Save. Cline automatically restarts the server.


GitHub Copilot (VS Code)

GitHub Copilot in VS Code uses VS Code's native MCP configuration, which has a slightly different format.

Option A — User settings (available across all workspaces):

  1. Open VS Code user settings: Ctrl+,Open Settings (JSON) (top-right icon).

  2. Add the following:

{
  "mcp": {
    "servers": {
      "docshub": {
        "type": "stdio",
        "command": "uvx",
        "args": [
          "--from", "git+https://github.com/rkratky/docshub",
          "docshub"
        ]
      }
    }
  }
}

Option B — Workspace settings (scoped to a single project):

Create or edit .vscode/mcp.json in your project root:

{
  "servers": {
    "docshub": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/rkratky/docshub",
        "docshub"
      ]
    }
  }
}

After saving, open GitHub Copilot Chat — the docshub tools will be available automatically.


Claude Code

Run this command once to register the server at user scope:

claude mcp add --scope user docshub -- \
  uvx --from git+https://github.com/rkratky/docshub docshub

To use a remote docs_config.yaml, set the environment variable before running the command or add it to your shell profile:

export DOCSHUB_CONFIG=https://raw.githubusercontent.com/ORG/docshub/main/docs_config.yaml

GitHub Copilot CLI

Edit ~/.copilot/mcp-config.json (created automatically by the CLI the first time you run it; you can also create it manually) and add the configuration block above to the mcpServers object.

To use a remote docs_config.yaml, add an env key to the server entry:

{
  "mcpServers": {
    "docshub": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/rkratky/docshub",
        "docshub"
      ],
      "env": {
        "DOCSHUB_CONFIG": "https://raw.githubusercontent.com/ORG/docshub/main/docs_config.yaml"
      }
    }
  }
}

The config file location can be changed by setting the COPILOT_HOME environment variable.


Usage

DocsHub exposes three types of MCP primitives: tools (called automatically by the AI), resources (attached to context on demand), and prompts (predefined conversation starters).

Tools

The AI calls these automatically when you ask about documentation:

Tool

Description

list_available_docs

Lists configured projects. Always called first to discover what's available.

get_project_docs

Fetches documentation for a project. Tries llms-full.txt first (complete docs); falls back to llms.txt (an index of page URLs) if unavailable.

read_doc_page

Fetches a specific page by URL. Only needed when get_project_docs returned an llms.txt index.

Example: "Check the docs for FastAPI and show me how to write a route."

Performance note: fetched documentation is cached in memory for 30 minutes by default (DOCSHUB_CACHE_TTL); set to 0 to disable caching. The server also polls the config source in the background every 15 minutes (DOCSHUB_CONFIG_RELOAD_INTERVAL) and notifies connected clients when the project list changes, so doc sets can be added or removed without restarting the server; set to 0 to disable polling.

Resources

Resources provide structured access to the documentation registry and content. Attach them to your conversation context when you want to ground the AI in a specific project's docs.

URI

Description

docshub://projects

JSON list of all configured projects with names and descriptions.

docshub://project/{name}/docs

Raw documentation content for the named project.

Prompts

Prompts are predefined conversation starters for common documentation tasks. How to invoke them depends on your AI client (look for a prompt/slash-command picker or similar):

Prompt

Arguments

Description

query_docs

project_name, question

Answer a specific question using a project's documentation.

summarize_project

project_name

Produce a structured overview of a project's docs.

Available Tools

3 tools
get_project_docsFetch Project DocumentationA
Read-onlyIdempotent

Fetch documentation for a project.

Automatically tries llms-full.txt first, which returns the complete documentation in a single response — no further calls needed. If llms-full.txt is unavailable, falls back to llms.txt and returns an index of URLs; use read_doc_page with those URLs to retrieve individual pages.

Call list_available_docs first to get valid project names.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_nameYesExact project name as returned by list_available_docs.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.9/5.0
Behavior5/5

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

Even with readOnlyHint and idempotentHint annotations, the description adds valuable behavioral detail: it discloses the automatic fallback mechanism, the two possible return modes (complete documentation vs. URL index), and the dependency on a prior list_available_docs call. This goes well beyond the annotations.

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 and well-structured: a clear opening sentence, followed by two short paragraphs explaining fallback and prerequisite. Every sentence contributes meaningful information without verbosity.

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

Completeness5/5

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

The tool is simple (one parameter) and the description explains both the primary behavior and the fallback path, including what to do with the fallback output. It covers the full call flow and the relationship to sibling tools, and the presence of an output schema further reduces the need to elaborate on return values.

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

Parameters4/5

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

The single parameter is well-documented in the schema ('Exact project name as returned by list_available_docs'), and the description reinforces this by stating to call list_available_docs first. Since schema coverage is 100%, the description adds modest but useful reinforcement.

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 fetches documentation for a project, with the specific verbs 'Fetch' and 'tries'. It also distinguishes itself from siblings by explaining the llms-full.txt vs llms.txt fallback and referencing read_doc_page and list_available_docs.

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

Usage Guidelines5/5

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

Explicitly instructs to call list_available_docs first to get valid project names. Also describes when the fallback to llms.txt applies and directs the user to read_doc_page for individual pages, making the when-to-use and alternatives explicit.

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

list_available_docsList Available DocsA
Read-onlyIdempotent

List all configured documentation projects.

Always call this first to discover available project names before using get_project_docs. Pass the exact value of the name field to get_project_docs.

Returns: List of dicts with name and description keys. Returns an empty list if no projects are configured.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior4/5

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

With readOnlyHint, openWorldHint, and idempotentHint already declared, the description adds useful context about the return format (list of dicts with 'name' and 'description') and the empty-list behavior. It does not contradict annotations and provides extra value beyond the structured hints.

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 compact and well-organized into three clear sections: the action, usage directive, and return value. Every sentence earns its place with no redundancy or filler, and key information appears upfront.

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

Completeness5/5

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

For a zero-parameter, read-only tool with an output schema, the description fully explains what the tool does, how to use it in the broader workflow, and what the expected output looks like. It covers all necessary context within its simple scope.

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

Parameters4/5

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

The tool takes zero parameters, and the schema confirms this with an empty properties object. The baseline for no-parameter tools is 4, and the description appropriately focuses on output semantics rather than parameter details, so no additional parameter information is needed.

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 states a specific action ('List all configured documentation projects') and clearly differentiates from sibling tools by explicitly naming get_project_docs and instructing to call this first. The verb and resource are specific, making the tool's purpose unmistakable.

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

Usage Guidelines5/5

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

Explicitly provides when-to-use guidance ('Always call this first') and describes the exact workflow for passing the result to get_project_docs. This is a clear directive that leaves no ambiguity about the tool's role relative to alternatives.

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

read_doc_pageRead Documentation PageA
Read-onlyIdempotent

Fetch the Markdown content of a specific documentation page.

Use URLs obtained from get_project_docs when it returns an llms.txt index. Do not call this if get_project_docs already returned complete documentation. Only URLs from configured project hosts are permitted.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesHTTPS URL of a documentation page from an llms.txt index.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnlyHint and idempotentHint annotations, the description adds key behavioral context: it fetches Markdown content, requires URLs from an llms.txt index, and enforces a security restriction on allowed hosts. This gives the agent a fuller picture of expected inputs and constraints without contradicting annotations.

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 compact and front-loaded with the core action. Every sentence adds value: the first defines what it does, the second gives sourcing guidance, and the third provides a critical security constraint. No wasted words.

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

Completeness5/5

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

Given the simple single-parameter schema, complete schema coverage, and presence of an output schema, the description fully covers all essential context: when to call, what it fetches, and host restrictions. The tool is uncomplicated, and the description is complete for an agent to invoke it correctly.

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

Parameters4/5

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

The schema already describes the 'url' parameter as an HTTPS URL from an llms.txt index, so the description does not need to repeat it. However, it adds provenance guidance by explicitly telling the agent to use URLs obtained from get_project_docs, which is valuable semantic context beyond the schema.

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 Markdown content for a specific documentation page, using an explicit verb and resource. It differentiates from siblings by referencing get_project_docs and specifying the page-level granularity, distinguishing this from listing or retrieving entire doc sets.

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

Usage Guidelines5/5

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

The description gives explicit usage guidance: use URLs from get_project_docs when it returns an llms.txt index, do not call if complete documentation was already returned, and only permitted host URLs. This clearly indicates when to use the tool and when not to, fulfilling the dimension.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedget_project_docs
    • First observedlist_available_docs
    • First observedread_doc_page

TDQS

A4.9/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a distinct, non-overlapping role in the documentation workflow: listing projects, fetching project docs (full or index), and reading individual pages. The descriptions clearly define when to use each tool.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_available_docs, get_project_docs, read_doc_page. This is predictable and easy for an agent to interpret.

Tool Count5/5

With 3 tools, the server is tightly scoped to its purpose of retrieving documentation. Each tool is essential to the workflow, and there is no redundancy or excess.

Completeness5/5

The tool set covers the full lifecycle of fetching documentation: discover projects, retrieve either full content or an index, and then fetch specific pages. The fallback mechanism ensures no dead ends for users.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.
    1,033
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that exposes the llms.txt file and its referenced local or external resources from a project root to provide context for AI models. It automatically parses documentation links and URLs to make them accessible as additional MCP resources.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Generic MCP server that exposes Markdown documentation to LLMs, enabling them to search and answer questions about any software documentation.
    MIT