Skip to content

Commit ac40f03

Browse files
feat: add Markdown MCP docs generator (Docusaurus- and pdoc-compatible)
Introduces `scripts/generate_mcp_markdown.py` (exposed via `poe mcp-docs-md`) which introspects the MCP server with `fastmcp inspect` and renders a small set of Markdown files under `docs/mcp-generated/`: - index.md — server overview + counts + TOC - tools.md — one H2 per tool with a GFM parameters table and collapsible input/output JSON schemas - resources.md — concrete resources and resource templates - prompts.md — prompts and their arguments Formatting is modeled on `mcpdocs-gen` (evaluated in PR #1013) but emitted as plain CommonMark + GFM + YAML front-matter + `<details>` blocks, so the pages render correctly in both Docusaurus and `pdoc` without MDX-only components. Every tool/resource/prompt has a stable slug anchor for deep-linking.
1 parent ce1a589 commit ac40f03

4 files changed

Lines changed: 400 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ viztracer_report.json
1111
# Packaged docs
1212
docs/*.zip
1313

14+
# Generated MCP server docs (regenerate via `poe mcp-docs-md`)
15+
docs/mcp-generated/
16+
1417
# Misc
1518
.DS_Store
1619

docs/CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,29 @@ poe mcp-serve-sse # Server-Sent Events transport on localhost:8000
143143

144144
poe mcp-inspect # Show all available MCP tools and their schemas
145145
```
146+
147+
### Generating Markdown docs for the MCP Server
148+
149+
The repo ships a small script that introspects the MCP server via
150+
`fastmcp inspect` and emits a Markdown documentation site under
151+
`docs/mcp-generated/` (git-ignored). The output is designed to be both
152+
Docusaurus-hostable and `pdoc`-compatible — plain CommonMark with YAML
153+
front-matter, no MDX-only components.
154+
155+
```bash
156+
uv sync --group dev
157+
poe mcp-docs-md
158+
```
159+
160+
Four files are produced:
161+
162+
- `index.md` — server overview (name, version, instructions, counts)
163+
- `tools.md` — one section per tool with a parameters table and collapsible
164+
input/output JSON schemas
165+
- `resources.md` — concrete resources + resource templates
166+
- `prompts.md` — prompts and their arguments
167+
168+
Each tool/resource/prompt has a stable slug anchor (e.g.
169+
`tools.md#list_connectors`) so the pages can be deep-linked from Slack, issues,
170+
or other docs. Regenerate after any change to MCP tool signatures, descriptions,
171+
or schemas. The underlying script is at `scripts/generate_mcp_markdown.py`.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ mcp-serve-http = { cmd = "python -c \"from airbyte.mcp.server import app; app.ru
174174
mcp-serve-sse = { cmd = "python -c \"from airbyte.mcp.server import app; app.run(transport='sse', host='127.0.0.1', port=8000)\"", help = "Start the MCP server with SSE transport" }
175175
mcp-inspect = { cmd = "fastmcp inspect airbyte/mcp/server.py:app", help = "Inspect MCP tools and resources (supports --tools, --health, etc.)" }
176176
mcp-tool-test = { cmd = "python -m fastmcp_extensions.utils.test_tool --app airbyte.mcp.server:app", help = "Test MCP tools directly with JSON arguments: poe mcp-tool-test <tool_name> '<json_args>'" }
177+
mcp-docs-md = { cmd = "python scripts/generate_mcp_markdown.py", help = "Generate Markdown docs for the MCP server into docs/mcp-generated/ (Docusaurus- and pdoc-compatible)" }
177178

178179
# Claude Code MCP Testing Tasks
179180
[tool.poe.tasks.test-my-tools]

0 commit comments

Comments
 (0)