DocAgent

DocAgent

AI-powered document generation suite that creates comprehensive software documentation including requirements, design specs, test strategies, and deployment guides through LangGraph workflows. Integrates with Cursor IDE via MCP to transform project ideas into professional documentation suites.

Category
访问服务器

README

DocAgent - AI-Powered Document Generation Suite

Python FastMCP LangGraph License: MIT

AI-powered document generation suite with LangGraph workflows and Cursor IDE integration via MCP (Model Context Protocol)

DocAgent is a comprehensive document generation system that creates professional software documentation using AI. It integrates seamlessly with Cursor IDE through MCP servers and supports 12 different document types with orchestrated workflows.

🚀 Features

Document Types

  • 📋 Business Requirements (BRD/PRD) - Product and business requirement documents
  • ⚙️ Functional Requirements (FRD) - Detailed functional specifications
  • 🏗️ System Requirements (SRD) - System architecture and requirements
  • 🧪 Technical Requirements (TRD/TDD) - Technical design and test documents
  • 🗄️ Database Design (ERD/API) - Entity relationship diagrams and API specs
  • 🎨 UI/UX Design - Wireframes and design system documentation
  • 📊 Project Planning - Project plans and milestone tracking
  • ✅ Test Strategy - Comprehensive testing documentation
  • 🚀 CI/CD Documentation - Deployment and environment setup
  • 📦 Release Runbooks - Release procedures and rollback plans

Core Capabilities

  • 🔄 LangGraph Workflows - Parallel document generation with conditional logic
  • 🎯 Smart Orchestration - Profile-based generation (Full, Lean, Tech-only, PM-only)
  • 💻 Cursor IDE Integration - Native MCP server integration
  • 🛡️ Safe File Operations - Collision detection and backup systems
  • 📝 Jinja2 Templates - Customizable document templates
  • ⚡ FastMCP v2 - Modern MCP protocol implementation
  • 🔧 CLI Tools - Command-line interface for batch operations

📦 Installation

Prerequisites

  • Python 3.9+
  • Cursor IDE
  • Git

Quick Setup

# Clone the repository
git clone https://github.com/vinnyfds/docagent.git
cd docagent

# Install dependencies
pip install -r requirements.txt

# Create environment file
cp .env.template .env
# Edit .env with your API keys

# Verify installation
python scripts/verify_mcp.py

Cursor IDE Integration

# Install FastMCP
pip install fastmcp

# The MCP servers will be automatically configured in Cursor
# Restart Cursor to load the DocAgent tools

🎯 Quick Start

Using Cursor IDE (Recommended)

  1. Open any file in Cursor
  2. Type / to open command palette
  3. Look for DocAgent tools:
    • ping() - Health check
    • generate_all() - Generate all documents
    • orchestrate_docgen() - Profile-based generation

Using CLI

# Generate all documents
python scripts/cli_generate.py --idea tests/fixtures/idea_sample.json --all

# Generate specific documents
python scripts/cli_generate.py --idea my_idea.json --docs brd_prd frd srd

# Use orchestration profiles
python -c "
from orchestrator.graph import orchestrate_docgen
from docs_agent.state import Idea
import json

with open('tests/fixtures/idea_sample.json') as f:
    data = json.load(f)
    idea = Idea(**data)
    
result = orchestrate_docgen(idea, profile='lean', overwrite=False)
print('Generated:', result)
"

🏗️ Architecture

System Overview

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   Cursor IDE    │◄──►│  FastMCP Server  │◄──►│  LangGraph      │
│                 │    │                  │    │  Workflow       │
│ - Command Palette│    │ - DocGenAgent    │    │                 │
│ - Tools Integration │  │ - Orchestrator   │    │ - Parallel Nodes│
│ - MCP Protocol  │    │ - Tool Registry  │    │ - Conditional   │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌──────────────────┐
                       │  Document Engine │
                       │                  │
                       │ - Jinja2 Templates│
                       │ - Safe File Ops  │
                       │ - Output Manager │
                       └──────────────────┘

Project Structure

docagent/
├── docs_agent/              # Core document generation agent
│   ├── __init__.py         # Package initialization
│   ├── state.py            # Pydantic models (Idea, Context, DocRequest)
│   ├── graph.py            # LangGraph workflow definition
│   ├── server.py           # FastMCP server implementation
│   ├── nodes/              # Document generation nodes
│   │   ├── brd_prd.py      # Business requirements
│   │   ├── frd.py          # Functional requirements
│   │   ├── srd.py          # System requirements
│   │   └── ...             # Other document types
│   ├── prompts/            # Jinja2 templates
│   │   ├── brd_prd.md.jinja
│   │   ├── openapi.yaml.jinja
│   │   └── ...
│   └── utils/              # Utilities
│       ├── render.py       # Template rendering
│       └── safety.py       # Safe file operations
├── orchestrator/           # Orchestration layer
│   ├── graph.py            # Orchestration logic
│   └── server.py           # Orchestrator MCP server
├── scripts/                # CLI and utilities
│   ├── cli_generate.py     # Command-line interface
│   ├── verify_mcp.py       # Installation verification
│   └── test_mcp_servers.py # Server testing
├── tests/                  # Test suite
│   └── fixtures/           # Test data
│       └── idea_sample.json
├── outputs/                # Generated documents
├── .cursor_rules           # Cursor IDE guardrails
├── requirements.txt        # Python dependencies
├── .env.template          # Environment template
└── README.md              # This file

🎮 Usage Examples

Idea Structure

{
  "title": "E-commerce Platform",
  "description": "Modern e-commerce platform with AI recommendations",
  "context": {
    "domain": "E-commerce",
    "stakeholders": ["Product Manager", "Engineering Team", "UX Designer"],
    "timeline": "6 months",
    "budget": "$500K"
  },
  "personas": [
    {"name": "Customer", "description": "Online shoppers"},
    {"name": "Admin", "description": "Platform administrators"}
  ],
  "modules": [
    {"name": "User Management", "description": "User registration and profiles"},
    {"name": "Product Catalog", "description": "Product browsing and search"},
    {"name": "Shopping Cart", "description": "Cart and checkout functionality"}
  ],
  "entities": [
    {"name": "User", "fields": ["id", "email", "profile"]},
    {"name": "Product", "fields": ["id", "name", "price", "inventory"]}
  ],
  "apis": [
    {"name": "User API", "methods": ["GET", "POST", "PUT", "DELETE"]},
    {"name": "Product API", "methods": ["GET", "POST", "PUT"]}
  ]
}

Orchestration Profiles

PROFILES = {
    "full": [
        "brd_prd", "frd", "srd", "trd_tdd", "erd_api", 
        "ui_wireframes", "project_plan", "test_strategy", 
        "cicd_env", "release_runbook"
    ],
    "lean": ["brd_prd", "frd", "srd", "erd_api"],
    "tech_only": ["srd", "trd_tdd", "erd_api", "cicd_env"],
    "pm_only": ["brd_prd", "project_plan", "test_strategy", "release_runbook"]
}

🛠️ Development

Running Tests

# Run verification tests
python scripts/verify_mcp.py

# Test MCP servers
python scripts/test_mcp_servers.py

# Generate sample documents
python scripts/cli_generate.py --idea tests/fixtures/idea_sample.json --all

Code Quality

# Install development dependencies
pip install ruff pytest

# Run linting
ruff check .

# Run tests
pytest -v

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🔧 Configuration

Environment Variables

# Required
OPENAI_API_KEY=your_openai_api_key_here

# Optional
DOCGEN_BUCKET=your_s3_bucket_for_outputs
ALLOW_OVERWRITE=false
LOG_LEVEL=INFO
ENVIRONMENT=development
MCP_HOST=localhost
MCP_PORT=3000

Cursor MCP Setup

The MCP servers are automatically configured for Cursor IDE. Manual configuration:

{
  "mcpServers": {
    "DocGenAgent": {
      "command": "cmd",
      "args": ["/c", "python", "docs_agent/server.py"],
      "cwd": "/path/to/docagent"
    },
    "DocGenOrchestrator": {
      "command": "cmd", 
      "args": ["/c", "python", "orchestrator/server.py"],
      "cwd": "/path/to/docagent"
    }
  }
}

📚 Documentation

🚀 Deployment

AWS Lambda (Coming Soon)

# Package for serverless deployment
npm install -g serverless
serverless deploy

Docker

# Build container
docker build -t docagent .

# Run container
docker run -p 3000:3000 docagent

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Contributors

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📧 Support


🎯 Transform your ideas into comprehensive documentation with AI-powered precision!

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选