Files
doc-forge/docs/wiki/05_development/04_mcp_guide.md
Vishesh 'ironeagle' Bangotra 4b0fdfaf85 docs(wiki): align wiki structure with Aetoskia AGENTS.md guidelines
- Renamed `02_architecture.md` to `02_components.md` to match the standard component page naming convention.
- Updated `docs/mkdocs.wiki.yml` to reflect renamed pages and fix navigation label acronym casing (GSDFC, MCP, MkDocs).
- Updated `index.md` to include the mandatory doc model blockquote, standardize section headers with emojis, and accurately map the `Documentation Structure` table to the navigation menu.
- Standardized all wiki pages (`01_overview.md`, `02_components.md`, `03_conventions.md`, `04_iterative_workflow.md`, and `05_development/*`) by:
  - Adding horizontal rules (`---`) between major sections.
  - Applying emoji-prefixed H2 headings for recognizable section types.
  - Appending `## Related` or `## ➡️ Read Next` footers with standard relative cross-links.
  - Adjusting H1 headers to match guide anatomy (e.g., `# Library Overview` on the overview page).
2026-09-14 23:30:45 +05:30

2.0 KiB
Raw Permalink Blame History

MCP Guide

Doc-forge can export a machine-readable MCP bundle from a project's GSDFC docstrings and serve that bundle over the Model Context Protocol (MCP). The bundle is self-contained: readers can derive the full API reference — signatures, docstrings, and structure — for the documented project.


🚀 Building the bundle

doc-forge build --mcp --module docforge

This writes structured JSON into docs/mcp/:

  • index.json — project metadata and module count
  • nav.json — module list with docs://modules/{module} resource URIs
  • modules/{dotted.path}.json — per-module serialized documentation

🚀 Serving the bundle

doc-forge serve --mcp --module docforge

The MCPServer (in docforge/servers/mcp_server.py) exposes:

Resource Description
docs://index Project metadata
docs://nav Navigation structure
docs://modules/{module} Individual module documentation

The server also registers a single diagnostic tool, ping, and is read-only. Missing resources are returned as structured error dictionaries rather than exceptions. The default transport is streamable-http; stdio and sse are supported via MCPServer.run.


📦 Bundle contents

Each module resource contains:

  • path — dotted module path
  • docstring — the raw GSDFC module docstring
  • objects — a recursive mapping of public symbols with name, kind, path, signature, and docstring, plus nested members

Because the bundle is generated from docstrings, the quality of the bundle equals the quality of the project's GSDFC docstrings. For docforge itself, the GSDFC specification is carried in modules/docforge.json via the docforge/__init__.py package docstring, making the bundle self-documenting.