fastapi-mcp-docs
Embed an interactive MCP documentation UI inside a FastAPI app (inspired by MCP Inspector), mounted at /mcp-docs.
Install
pip install fastapi-mcp-docs
For tests:
pip install "fastapi-mcp-docs[test]"
Usage
from fastapi import FastAPI
from fastapi_mcp_docs import mount_mcp_docs
app = FastAPI()
# `mcp` can be a FastMCP/MCP server object that exposes tools (and optionally prompts/resources)
# and supports tool calling via `call_tool(...)` / `call(...)`.
mcp = ...
mount_mcp_docs(app, mcp, docs_url="/mcp-docs", mcp_url="/mcp")
Then open:
GET /mcp-docsfor the UIGET /mcp-docs/schemafor discovered tools/prompts/resourcesPOST /mcp-docs/callto call a tool from the UIGET /mcp-docs/configto export anmcp.jsonsnippet for clients
Notes on compatibility
fastapi-mcp-docs aims to work with different MCP server implementations by using light introspection:
- Discovery: tries
list_tools()/tools,list_prompts()/prompts,list_resources()/resources - Calling: tries
call_tool(name, arguments)thencall(name, arguments)
If your server uses different method/attribute names, you can wrap it in a small adapter that provides the above methods.
Example app
Run:
pip install "fastapi-mcp-docs[example]"
python -m uvicorn examples.app:app --reload
Then open http://localhost:8000/mcp-docs.
Publishing to PyPI
This repository includes an automatic publishing workflow that runs on GitHub Releases.
- Create a new GitHub Release (e.g.
v0.1.0) and the workflow will build and publish to PyPI. - Configure one of the following:
- Trusted Publishing (recommended): enable GitHub Actions trusted publishing for the
fastapi-mcp-docsproject on PyPI. - API token: add
PYPI_API_TOKENas a repository secret.
- Trusted Publishing (recommended): enable GitHub Actions trusted publishing for the
Metadata
Release files for fastapi-mcp-docs 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastapi_mcp_docs-0.1.1.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_mcp_docs-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / fastapi_mcp_docs-0.1.1.tar.gz
| Download URL | fastapi_mcp_docs-0.1.1.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5154d29a40fda031a70c1176a672e80b59181e8e281a2a29a95c899a6890a6c2
|
|
BLAKE2b-256 checksum How to use checksums |
693efebf99ac0a3b79d640e8f329914ae9c513f4b6ccaf65fd983d42fa0f4e25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.
Transparency logRelease files / fastapi_mcp_docs-0.1.1-py3-none-any.whl
| Download URL | fastapi_mcp_docs-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05b6dfa28f465fbdbc79289535d66fb2bd1e6ed9cb24bc5635da3139a9ac2acc
|
|
BLAKE2b-256 checksum How to use checksums |
410d54f8a752d563c5e5c86c58ef8f493b8e082efde9f5eca5fb12aec436fb7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.
Transparency log