# DocFlow MCP: Document Workflow Management System for AI Agents

> DocFlow MCP is a document authoring workflow server designed for AI agents. It enforces the complete process of drafting, review, revision, and submission via a state machine, supporting multi-model collaboration and any Markdown document repository.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-22T20:14:44.000Z
- 最近活动: 2026-04-22T20:18:50.967Z
- 热度: 148.9
- 关键词: MCP, 文档工作流, AI 智能体, 状态机, 文档审核, Claude Code, 多模型协作
- 页面链接: https://www.zingnex.cn/en/forum/thread/docflow-mcp-ai
- Canonical: https://www.zingnex.cn/forum/thread/docflow-mcp-ai
- Markdown 来源: floors_fallback

---

## DocFlow MCP: AI Agent-Oriented Document Workflow Management System (Introduction)

DocFlow MCP is an open-source document workflow server designed for AI agents. It enforces a complete document lifecycle (drafting → review → revision → submission) via a state machine, supports multi-model collaboration, and works with any Markdown document repository. Built on Anthropic's MCP (Model Context Protocol), it standardizes interactions between AI models and external tools, enabling compatible LLMs to handle document tasks.

## Background & Design Philosophy

As large language models advance, AI agents increasingly participate in software project documentation. However, AI-generated content requires strict review to ensure accuracy and consistency. DocFlow MCP addresses this need by providing a state machine-driven workflow system for managing the full lifecycle of agent-authored documents. It implements Anthropic's MCP protocol, abstracting document workflows into standardized tool interfaces accessible to any MCP-compatible LLM.

## Core Workflow Design (State Machine Stages)

DocFlow MCP uses a strict state machine to manage document state transitions:
- **Draft**: Agents create drafts (with unique IDs, stored in SQLite for persistence).
- **Review**: Drafts enter review, where an AI sub-agent (via MyLLM gateway) acts as reviewer—supports different models for author and reviewer (e.g., Claude vs Gemini) for diverse perspectives.
- **Revise**: Unapproved drafts return to revision; the system limits iterations via DOCS_MAX_ITERATIONS to avoid loops.
- **Commit/Escalate**: Approved drafts are submitted to the repository; repeated failures or complex cases trigger escalation to humans.

## Technical Architecture Key Features

- **Model Agnosticism**: Uses OpenAI-compatible gateways (default MyLLM) to interact with any supported LLM.
- **Dual-Model Strategy**: Recommended to use different model families for author and reviewer to avoid biases; reviewers have read-only access to code graphs/docs for objectivity.
- **Flexible Repository Support**: Configurable via DOCS_ROOT (document root) and DOCS_SCOPE_MAP (multi-repo mapping) to serve multiple projects.
- **Prompt Version Management**: Audit prompts stored in prompts/ directory (per document type); hashes link prompts to audit results for traceability.

## Use Cases & Integration Scenarios

DocFlow MCP is ideal for:
- **Technical Document Maintenance**: Ensures docs stay in sync with code via workflowed updates.
- **ADR Management**: Provides templates for Architecture Decision Records to standardize decision documentation.
- **Multi-Language Docs**: Leverages model language strengths for cross-language review.
- **Claude Code/OpenCode Integration**: Easy registration via commands to integrate into development environments.

## Configuration & Deployment Guidelines

Key environment variables:
- DOCS_ROOT: Required (document repository absolute path).
- DOCS_REVIEWER_URL: Default http://localhost:4000 (reviewer gateway).
- DOCS_REVIEWER_PROFILE: Default docs-reviewer (model profile).
- DOCS_MAX_ITERATIONS: Default 5 (max revision loops).
- DOCS_REVIEW_TIMEOUT: Default 600s (audit timeout).
Deployment uses uv for Python environment management; state data stored in .docs-state (customizable via DOCS_STATE_DIR).

## Summary & Future Outlook

DocFlow MCP innovates AI-assisted document workflows by combining state machine enforcement with multi-model collaboration. It balances document quality assurance and AI automation, making it a valuable open-source solution for teams exploring AI-driven document management.
