Overview

The Documint MCP server exposes documentation drift detection, patch generation, and project management as Model Context Protocol tools. Any MCP-compatible agent can call these tools to discover stale documentation, review AI-generated fixes, and open pull requests -- all without leaving the coding environment.

The server ships as part of the documint-mcp Python package and supports three transports:

TransportUse caseDefault port
stdioClaude Code, Cursor, Windsurf, local IDE integrationsN/A (stdin/stdout)
sseCloud-hosted agents (Manus, custom orchestrators)8100
streamable-httpModern HTTP-based MCP clients8100

Installation

bash
# Install from PyPI
pip install documint-mcp

# Or run directly without installing
uvx documint-mcp

Requires Python 3.11+. The package includes both the MCP server (documint-mcp) and the REST API server (documint-server).

Configuration

Environment variables

VariableRequiredDefaultDescription
DOCUMINT_API_KEYYes--API key for authenticating with the Documint API
DOCUMINT_API_URLNohttps://api-production-285b.up.railway.appBase URL of the Documint REST API
DOCUMINT_MCP_TRANSPORTNostdioTransport protocol: stdio, sse, or streamable-http
DOCUMINT_MCP_HOSTNo127.0.0.1Bind host for SSE/HTTP transports
DOCUMINT_MCP_PORTNo8100Bind port for SSE/HTTP transports
DOCUMINT_DOCS_ROOTNo.Root directory for local .mint file lookups

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{
  "mcpServers": {
    "documint": {
      "command": "uvx",
      "args": ["documint-mcp"],
      "env": {
        "DOCUMINT_API_KEY": "dm_live_xxxx"
      }
    }
  }
}

Claude Code

Add to ~/.claude/claude.json:

json
{
  "mcpServers": {
    "documint": {
      "command": "uvx",
      "args": ["documint-mcp"],
      "env": {
        "DOCUMINT_API_KEY": "dm_live_xxxx"
      }
    }
  }
}

Or configure via the CLI:

bash
claude mcp add documint -- uvx documint-mcp

Cursor

Open Settings > MCP Servers and add:

json
{
  "documint": {
    "command": "uvx",
    "args": ["documint-mcp"],
    "env": {
      "DOCUMINT_API_KEY": "dm_live_xxxx"
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration (~/.windsurf/mcp.json):

json
{
  "mcpServers": {
    "documint": {
      "command": "uvx",
      "args": ["documint-mcp"],
      "env": {
        "DOCUMINT_API_KEY": "dm_live_xxxx"
      }
    }
  }
}

Self-hosted API

If you are running the Documint API locally (see the self-hosted guide), point the MCP server at your local instance:

json
{
  "mcpServers": {
    "documint": {
      "command": "uvx",
      "args": ["documint-mcp"],
      "env": {
        "DOCUMINT_API_KEY": "your_local_token",
        "DOCUMINT_API_URL": "http://127.0.0.1:8000"
      }
    }
  }
}

Tools (15)

documint_list_projects

List all Documint projects connected to this API key.

Parameters

NameTypeRequiredDefaultDescription
offsetintegerNo0Pagination offset
limitintegerNo20Maximum items to return

Example response

json
{
  "total": 2,
  "offset": 0,
  "limit": 20,
  "items": [
    {
      "id": "proj_abc123",
      "name": "My API",
      "slug": "my-api",
      "github_repo": "acme/my-api",
      "onboarding_status": "connected"
    }
  ]
}

documint_list_artifacts

List all artifact definitions for a project. Each artifact maps source files to a documentation file.

Parameters

NameTypeRequiredDefaultDescription
project_idstringYes--Project ID from documint_list_projects
offsetintegerNo0Pagination offset
limitintegerNo20Maximum items to return

Example response

json
{
  "total": 3,
  "offset": 0,
  "limit": 20,
  "items": [
    {
      "artifact_key": "api-reference",
      "title": "API Reference",
      "artifact_type": "api_reference",
      "doc_paths": ["content/docs/api-reference.md"],
      "source_patterns": ["src/**/*.py"]
    }
  ]
}

documint_get_findings

List open documentation drift findings for a project. A finding means source code changed but the corresponding documentation was not updated.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
[
  {
    "id": "finding_xyz789",
    "artifact_id": "api-reference",
    "severity": "high",
    "summary": "add_memory() gained a new required parameter `ttl` not documented",
    "has_breaking_changes": true,
    "changed_symbols": ["add_memory", "MemoryConfig"],
    "suggested_actions": ["Update parameter table", "Add ttl usage example"]
  }
]

documint_check_drift

Trigger a fresh documentation drift scan for a project. Compares current source code AST signatures (SHA-256 of symbol hashes via tree-sitter) against tracked documentation.

This is an async operation. After triggering, call documint_get_findings to retrieve the results once the scan completes (typically 5-30 seconds).

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "job_id": "job_drift_abc",
  "status": "completed",
  "findings_count": 3,
  "scanned_at": "2026-03-24T14:30:00Z"
}

documint_get_patch

Get (or generate on demand) the AI-drafted documentation patch for a specific drift finding. If no patch exists yet, triggers the 4-step AI chain:

  1. Haiku structured diff report
  2. Stale section detection
  3. Sonnet surgical patch generation
  4. Haiku verification

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID
finding_idstringYesFinding ID from documint_get_findings

Example response

json
{
  "id": "patch_001",
  "preview_markdown": "## add_memory\n\n```python\ndef add_memory(content: str, ttl: int = 3600) -> str:\n```\n\n| Parameter | Type | Default | Description |\n|---|---|---|---|\n| content | str | -- | Memory content |\n| ttl | int | 3600 | Time-to-live in seconds |",
  "summary": "Added ttl parameter documentation to add_memory()",
  "rationale": "The ttl parameter was added in commit abc123 but not reflected in the API reference.",
  "confidence_score": 0.95,
  "ai_provider": "anthropic",
  "chain_steps_used": 4,
  "citations": ["src/memory/store.py:42-58"]
}

Tip: Always read preview_markdown before calling documint_approve_patch so you can show the user what will be committed.


documint_approve_patch

Approve an AI-drafted patch and open a GitHub pull request with the documentation fix.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID
finding_idstringYesFinding ID

Example response

json
{
  "id": "pr_456",
  "branch_name": "documint/fix-add-memory-ttl",
  "title": "docs: add ttl parameter to add_memory()",
  "url": "https://github.com/acme/my-api/pull/42",
  "state": "open"
}

Warning: Approval is irreversible -- it creates a real GitHub PR. Always call documint_get_patch first and present the preview to the user for review.


documint_get_mint

Get the .mint file (machine-readable documentation) for a specific artifact. The .mint format is a structured JSON representation optimized for LLM consumption: it includes symbol inventory, section graph, cross-references, and verification metadata.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID
artifact_keystringYesArtifact key from documint_list_artifacts

Example response

json
{
  "artifact_key": "api-reference",
  "symbols": [
    {
      "name": "add_memory",
      "kind": "function",
      "signature": "def add_memory(content: str, ttl: int = 3600) -> str",
      "documented": true
    }
  ],
  "sections": [...],
  "verified_at": "2026-03-24T14:30:00Z"
}

documint_get_claude_md

Get the CLAUDE.md context file for a project. This is a curated system-prompt insert that helps Claude-family LLMs understand the project's conventions, key modules, and coding patterns.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "content": "# CLAUDE.md\n\n## Project Overview\n\nThis project uses FastAPI...",
  "project_id": "proj_abc123"
}

documint_get_agents_md

Get the AGENTS.md guide for a project. Describes AI agent roles, tool permissions, escalation rules, and task boundaries for multi-agent setups.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "content": "# AGENTS.md\n\n## Roles\n\n- Analysis Agent: ...",
  "project_id": "proj_abc123"
}

documint_get_llms_txt

Get the llms.txt index file for a project (per the llmstxt.org specification). A plain-text index of all project documentation with short summaries and URLs, optimized for LLM context windows.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "content": "# My API\n\n> API for memory management\n\n## Docs\n\n- [API Reference](https://docs.example.com/api): REST endpoints\n- [SDK Guide](https://docs.example.com/sdk): Getting started",
  "project_id": "proj_abc123"
}

documint_get_symbol_diff

Get a detailed symbol-level diff for a specific drift finding. Shows exactly what changed in source code signatures vs. what the documentation says.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID
finding_idstringYesFinding ID

Example response

json
{
  "finding_id": "finding_xyz789",
  "project_id": "proj_abc123",
  "artifact_id": "api-reference",
  "changes": [
    {
      "symbol_name": "add_memory",
      "change_type": "PARAM_ADDED",
      "severity": "BREAKING",
      "before": "def add_memory(content: str) -> str",
      "after": "def add_memory(content: str, ttl: int = 3600) -> str"
    }
  ]
}

Change types: ADDED, REMOVED, PARAM_ADDED, PARAM_REMOVED, RETURN_CHANGED, SIGNATURE_CHANGED

Severity levels: BREAKING, ADDITIVE, COSMETIC


documint_status

Get a health summary for a project. Use this at the start of a session to decide whether to run documint_check_drift or go straight to documint_get_findings.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "project_id": "proj_abc123",
  "name": "My API",
  "open_findings": 3,
  "last_scan": "2026-03-24T14:30:00Z"
}

documint_watch_artifact

Returns the current drift status, last symbol hash, and staleness age for an artifact. Use this to check if documentation is stale before proposing changes.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID
artifact_idstringYesArtifact ID

Example response

json
{
  "artifact_id": "api-reference",
  "verification_status": "stale",
  "latest_source_ref": "abc123",
  "latest_doc_ref": "def456",
  "is_stale": true,
  "doc_paths": ["content/docs/api-reference.md"],
  "source_paths": ["src/documint_mcp/server.py"]
}

documint_get_coverage

Returns a documentation coverage report for a project -- what percentage of symbols are documented per artifact.

Parameters

NameTypeRequiredDescription
project_idstringYesProject ID

Example response

json
{
  "project_id": "proj_abc123",
  "artifacts": [
    {
      "id": "api-reference",
      "name": "API Reference",
      "documented": 18,
      "total": 20,
      "percentage": 90.0
    }
  ],
  "overall": {
    "documented": 45,
    "total": 52,
    "percentage": 86.5
  }
}

Resources (4)

MCP resources provide read-only access to project content via URI templates.

URI TemplateNameMIME TypeDescription
claude-md://{project_id}CLAUDE.mdtext/markdownCurated system-prompt insert for Claude-family LLMs
agents-md://{project_id}AGENTS.mdtext/markdownAI agent roles, permissions, and task boundaries
llms-txt://{project_id}llms.txttext/plainDocumentation index per the llmstxt.org specification
mint-binary://{project_id}/{artifact_id}.mint binaryapplication/octet-streamBinary .mint artifact file (base64-encoded)

Reading a resource

Resources are resolved by the MCP client. For example, to read the CLAUDE.md for project proj_abc123:

Resource URI: claude-md://proj_abc123

The .mint binary resource reads from the local filesystem at $DOCUMINT_DOCS_ROOT/.documint/{artifact_id}.mint. Run documint publish first to generate these files.


Prompt

documint_workflow

Title: Documint Drift-Fix Workflow

A step-by-step guide for using Documint to find and fix documentation drift. Accepts an optional project_id parameter to scope the instructions.

Steps:

  1. Call documint_list_projects to discover available projects and their IDs.
  2. Call documint_status with the project_id to check whether the project has drift.
  3. If drift_status is unknown or stale, call documint_check_drift to trigger a fresh scan.
  4. Call documint_get_findings to list all open drift findings.
  5. For each finding, call documint_get_symbol_diff to understand what changed.
  6. Call documint_get_patch to get (or generate) the AI-drafted fix.
  7. Review the patch's preview_markdown with the user.
  8. If approved, call documint_approve_patch to open a GitHub PR.

Tips:

  • Use documint_get_claude_md at session start for project context.
  • Use documint_get_coverage to understand documentation completeness.
  • Use documint_watch_artifact to check staleness of specific artifacts.

SSE transport for cloud agents

For cloud-hosted agents that cannot use stdio, run the MCP server with SSE transport:

bash
# Via environment variables
DOCUMINT_API_KEY=dm_live_xxxx \
DOCUMINT_MCP_TRANSPORT=sse \
DOCUMINT_MCP_PORT=8100 \
documint-mcp

# Via CLI flags
documint-mcp --transport sse --port 8100 --host 0.0.0.0

Cloud agents connect via:

  • SSE endpoint: GET http://your-host:8100/sse
  • Message endpoint: POST http://your-host:8100/messages/

Embedding in an existing FastAPI app

You can mount the MCP server as a sub-application on an existing FastAPI or Starlette app:

python
from documint_mcp.mcp_server import mount_on_fastapi

app = create_app()
mount_on_fastapi(app, "/mcp-sse")

# Clients connect via:
#   SSE:      GET  /mcp-sse/sse
#   Messages: POST /mcp-sse/messages/

For the streamable-http transport:

python
from documint_mcp.mcp_server import get_streamable_http_app

app.mount("/mcp", get_streamable_http_app())

Troubleshooting

"DOCUMINT_API_KEY environment variable not set"

The MCP server requires a valid API key. Set DOCUMINT_API_KEY in your MCP configuration's env block, or export it in your shell before running documint-mcp.

Tools are not appearing in my IDE

  1. Confirm the MCP server is running: documint-mcp --transport stdio should start without errors.
  2. Check that your IDE's MCP configuration points to the correct command (uvx documint-mcp or the full path to the documint-mcp binary).
  3. Restart the IDE after changing MCP configuration.

Connection timeout with SSE transport

  • Verify the port is not blocked by a firewall.
  • Check that --host 0.0.0.0 is set if the client is connecting from a different machine.
  • Confirm the DOCUMINT_API_KEY is valid and the API at DOCUMINT_API_URL is reachable.

"No .mint file found" from the mint-binary resource

Run documint publish in your project root to generate .mint files under .documint/. The resource reads from $DOCUMINT_DOCS_ROOT/.documint/.

Patch generation is slow

The first call to documint_get_patch for a finding triggers the 4-step AI chain (Haiku diff, stale detection, Sonnet patch, Haiku verify). This typically takes 10-30 seconds. Subsequent calls return the cached patch instantly.

Self-hosted API returns 401

  • For local development with DEBUG=true, authentication is optional from localhost.
  • For production, set AUTH_TOKEN or configure Clerk JWT verification (see API Reference).
  • API tokens can be created via POST /workspaces/{workspace_id}/tokens.