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:
| Transport | Use case | Default port |
|---|---|---|
stdio | Claude Code, Cursor, Windsurf, local IDE integrations | N/A (stdin/stdout) |
sse | Cloud-hosted agents (Manus, custom orchestrators) | 8100 |
streamable-http | Modern HTTP-based MCP clients | 8100 |
Installation
# 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
| Variable | Required | Default | Description |
|---|---|---|---|
DOCUMINT_API_KEY | Yes | -- | API key for authenticating with the Documint API |
DOCUMINT_API_URL | No | https://api-production-285b.up.railway.app | Base URL of the Documint REST API |
DOCUMINT_MCP_TRANSPORT | No | stdio | Transport protocol: stdio, sse, or streamable-http |
DOCUMINT_MCP_HOST | No | 127.0.0.1 | Bind host for SSE/HTTP transports |
DOCUMINT_MCP_PORT | No | 8100 | Bind port for SSE/HTTP transports |
DOCUMINT_DOCS_ROOT | No | . | 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):
{
"mcpServers": {
"documint": {
"command": "uvx",
"args": ["documint-mcp"],
"env": {
"DOCUMINT_API_KEY": "dm_live_xxxx"
}
}
}
}
Claude Code
Add to ~/.claude/claude.json:
{
"mcpServers": {
"documint": {
"command": "uvx",
"args": ["documint-mcp"],
"env": {
"DOCUMINT_API_KEY": "dm_live_xxxx"
}
}
}
}
Or configure via the CLI:
claude mcp add documint -- uvx documint-mcp
Cursor
Open Settings > MCP Servers and add:
{
"documint": {
"command": "uvx",
"args": ["documint-mcp"],
"env": {
"DOCUMINT_API_KEY": "dm_live_xxxx"
}
}
}
Windsurf
Add to your Windsurf MCP configuration (~/.windsurf/mcp.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:
{
"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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
offset | integer | No | 0 | Pagination offset |
limit | integer | No | 20 | Maximum items to return |
Example response
{
"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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_id | string | Yes | -- | Project ID from documint_list_projects |
offset | integer | No | 0 | Pagination offset |
limit | integer | No | 20 | Maximum items to return |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
[
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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:
- Haiku structured diff report
- Stale section detection
- Sonnet surgical patch generation
- Haiku verification
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
finding_id | string | Yes | Finding ID from documint_get_findings |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
finding_id | string | Yes | Finding ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
artifact_key | string | Yes | Artifact key from documint_list_artifacts |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
finding_id | string | Yes | Finding ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
artifact_id | string | Yes | Artifact ID |
Example response
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID |
Example response
{
"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 Template | Name | MIME Type | Description |
|---|---|---|---|
claude-md://{project_id} | CLAUDE.md | text/markdown | Curated system-prompt insert for Claude-family LLMs |
agents-md://{project_id} | AGENTS.md | text/markdown | AI agent roles, permissions, and task boundaries |
llms-txt://{project_id} | llms.txt | text/plain | Documentation index per the llmstxt.org specification |
mint-binary://{project_id}/{artifact_id} | .mint binary | application/octet-stream | Binary .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:
- Call
documint_list_projectsto discover available projects and their IDs. - Call
documint_statuswith the project_id to check whether the project has drift. - If drift_status is unknown or stale, call
documint_check_driftto trigger a fresh scan. - Call
documint_get_findingsto list all open drift findings. - For each finding, call
documint_get_symbol_diffto understand what changed. - Call
documint_get_patchto get (or generate) the AI-drafted fix. - Review the patch's
preview_markdownwith the user. - If approved, call
documint_approve_patchto open a GitHub PR.
Tips:
- Use
documint_get_claude_mdat session start for project context. - Use
documint_get_coverageto understand documentation completeness. - Use
documint_watch_artifactto 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:
# 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:
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:
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
- Confirm the MCP server is running:
documint-mcp --transport stdioshould start without errors. - Check that your IDE's MCP configuration points to the correct command (
uvx documint-mcpor the full path to thedocumint-mcpbinary). - 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.0is set if the client is connecting from a different machine. - Confirm the
DOCUMINT_API_KEYis valid and the API atDOCUMINT_API_URLis 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_TOKENor configure Clerk JWT verification (see API Reference). - API tokens can be created via
POST /workspaces/{workspace_id}/tokens.