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
pip install mcpdocs
To use the FastAPI integration:
pip install "mcpdocs[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
- Introspection:
mcpdocsconnects to the provided SSE URL. - Connection: It establishes a JSON-RPC connection over the SSE transport.
- Discovery: It queries the server for all available tools, resources, and prompts.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpdocs_gen-0.1.1.tar.gz.
File metadata
- Download URL: mcpdocs_gen-0.1.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f99d46f04fd59bc98d2c8687dee0883c9a4e36ea0fd94181f6c239ad0b944f9
|
|
| MD5 |
5e28982d9853f394fb8659fe0140cd46
|
|
| BLAKE2b-256 |
ddd87e58ee56c3e0e9debb68a3c3585dd54cc663745420e34403f05e0c6f610d
|
Provenance
The following attestation bundles were made for mcpdocs_gen-0.1.1.tar.gz:
Publisher:
publish.yml on smytsyk/mcpdocs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpdocs_gen-0.1.1.tar.gz -
Subject digest:
8f99d46f04fd59bc98d2c8687dee0883c9a4e36ea0fd94181f6c239ad0b944f9 - Sigstore transparency entry: 1155056420
- Sigstore integration time:
-
Permalink:
smytsyk/mcpdocs@7b6410ca62cfe066e05b2b32046bfba6281eba85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/smytsyk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b6410ca62cfe066e05b2b32046bfba6281eba85 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcpdocs_gen-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcpdocs_gen-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ffce39a5ebe01dc52faa736d7e5a4a52bd3276e8aeca2d1c227ec4222b10647
|
|
| MD5 |
aeac44c98195b594a244c710826a055f
|
|
| BLAKE2b-256 |
42304c2738105c631d28f4f1e5345a3010879be4d3edadd03df56701b5bf4c72
|
Provenance
The following attestation bundles were made for mcpdocs_gen-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on smytsyk/mcpdocs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpdocs_gen-0.1.1-py3-none-any.whl -
Subject digest:
0ffce39a5ebe01dc52faa736d7e5a4a52bd3276e8aeca2d1c227ec4222b10647 - Sigstore transparency entry: 1155056437
- Sigstore integration time:
-
Permalink:
smytsyk/mcpdocs@7b6410ca62cfe066e05b2b32046bfba6281eba85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/smytsyk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b6410ca62cfe066e05b2b32046bfba6281eba85 -
Trigger Event:
release
-
Statement type: