Skip to main content

Static documentation generator for MCP servers — like Swagger UI, but for MCP

Project description

mcpdocs

Static documentation generator for MCP servers — like Swagger UI, but for MCP.

mcpdocs introspects running Model Context Protocol (MCP) servers via SSE and generates a beautiful, searchable static documentation site. It helps developers and users understand the tools, resources, and prompts available in an MCP server.

Features

  • 🔍 Auto-Introspection: Connects to any running MCP server via SSE URL to discover its capabilities.
  • 🛠️ Full Support: Documents Tools, Resources, Resource Templates, and Prompts.
  • 🎨 Beautiful UI: Clean, responsive, and searchable documentation with dark mode support.
  • 🚀 FastAPI Integration: Easily mount auto-generated docs on your existing FastAPI application.
  • 📦 Static Output: Generates pure HTML/CSS that can be hosted anywhere (GitHub Pages, S3, etc.).
  • 🤖 CI/CD Ready: CLI-first design for automated documentation workflows.

Installation

Note: The repository is named mcpdocs, but the PyPI package is published as mcpdocs-gen.

pip install mcpdocs-gen

To use the FastAPI integration:

pip install "mcpdocs-gen[fastapi]"

Usage

1. Command Line Interface (CLI)

The CLI tool is named mcpdocs. To generate documentation, you provide the SSE URL of your running server.

Basic Example:

mcpdocs generate --url "http://localhost:8000/sse"

Custom Output Directory:

mcpdocs generate --url "http://localhost:8000/sse" --output "./static-docs"

CLI Reference

Flag Shortcut Description
--url -u (Required) The SSE URL of the running MCP server.
--output -o Where to save the HTML (default: ./site).
--timeout -t Seconds to wait for server responses (default: 30.0).

2. FastAPI Integration

You can serve the documentation site directly from your FastAPI application.

from fastapi import FastAPI
from mcpdocs.integrations.fastapi import setup_mcpdocs

app = FastAPI()

setup_mcpdocs(
    app,
    url="http://localhost:8000/sse",
    mount_path="/docs/mcp",
    output_dir=".mcpdocs-cache"
)

Python API Reference (setup_mcpdocs)

Parameter Type Description
app FastAPI Your FastAPI application instance.
url str The SSE URL of the running MCP server.
mount_path str URL path where docs will be served (default: /mcpdocs).
output_dir str Local path to store static files (default: .mcpdocs-static).
timeout float Seconds to wait for server responses (default: 30.0).
auto_regenerate bool If True, regenerates docs on app startup (default: True).

3. Inspect (JSON dump)

Dump the raw server spec as JSON — useful for CI or debugging:

mcpdocs inspect --url "http://localhost:8000/sse"

How it works

  1. Introspection: mcpdocs connects to the provided SSE URL.
  2. Connection: It establishes a JSON-RPC connection over the SSE transport.
  3. Discovery: It queries the server for all available tools, resources, and prompts.
  4. Rendering: It generates a standalone static website using Jinja2 templates.

Security

Only run mcpdocs against trusted MCP servers. The generated documentation does not include sensitive configuration details of the server.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpdocs_gen-0.1.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpdocs_gen-0.1.2-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file mcpdocs_gen-0.1.2.tar.gz.

File metadata

  • Download URL: mcpdocs_gen-0.1.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpdocs_gen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b9695eb672c0c86766c3583e03d9a788775065b9ffccc1a18e0d113004f721a6
MD5 ff78ab66beed56b03418dbfa43a442fc
BLAKE2b-256 672e7351bbdd724df1b1e1426dd22b957245eb30b3ea36831b37724f1e031963

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpdocs_gen-0.1.2.tar.gz:

Publisher: publish.yml on smytsyk/mcpdocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpdocs_gen-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mcpdocs_gen-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpdocs_gen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b47bc8f61126336333bef61adae1cc52f510391bc99df558e4e70739141b0290
MD5 c3ca096a5f337379dc4317ad9dc865e2
BLAKE2b-256 62a57a0c015e2bc3997e9cb5f4d634f134d955e01548e192ad49fefa3e22aa34

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpdocs_gen-0.1.2-py3-none-any.whl:

Publisher: publish.yml on smytsyk/mcpdocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page