PRDforge
Enables Claude to read and write product requirement documents section by section via 33 MCP tools, drastically reducing token consumption by loading only relevant sections and summaries instead of the full document.
README
PRD Forge
Stop feeding your entire spec to Claude every time you change one paragraph.

PRD Forge splits your product requirements into independently addressable sections stored in PostgreSQL, then gives Claude surgical read/write access through 33 MCP tools. The result: edits that used to burn ~15,000 tokens now cost 500-2,000 — an 85-95% reduction in context per operation.
The Problem
Every AI-assisted PRD workflow today has the same bottleneck: Claude needs the full document loaded into context to make a single edit. A 20-page spec means ~15K tokens of context consumed on every interaction — even if you're only changing one section.
How PRD Forge Solves It
Each section stores both its full content and a short summary (1-3 sentences). When Claude reads a section, it gets:
- Full content for the target section
- Only summaries of related (dependent) sections
- Inline comments and revision history
Real example: Reading data-model (820 words, ~1,200 tokens) loads summaries of tech-stack (~60 tokens) and pipeline (~60 tokens). Total: ~1,320 tokens instead of ~15,000.
Features
- 33 MCP tools — read, write, search, import/export, manage dependencies, track revisions, resolve comments
- Multi-user auth — Better Auth (email/password + Google OAuth), 5 roles (owner/admin/editor/commenter/viewer), org-scoped access control
- Real-time collaboration — WebSocket presence, live section updates across clients
- Project templates — start with Blank, SaaS MVP, Mobile App, or API Design — pre-built section structures with starter content
- Dependency-aware context — sections know what they depend on; Claude automatically gets upstream summaries
- Full revision history — every content change creates a revision, roll back to any point
- Google Docs-style comments — inline comments anchored to specific text, threaded replies
- AI chat — streaming chat panel with Claude (Anthropic API or CLI), tool-calling into your PRD
- Dependency graph — interactive SVG visualization of section relationships
- Token stats — dashboard showing per-section token usage
- Next.js frontend — React 19, Tailwind v4, shadcn/ui, dark/light theme
- One command install —
./install.shhandles Docker, MCP config, validation
Architecture
graph LR
A[Claude.ai / Claude Code / Claude Desktop] <-->|MCP Protocol| B[MCP Server<br/>FastMCP/Python<br/>:8080]
B <-->|asyncpg| C[(PostgreSQL 16<br/>sections, revisions<br/>dependencies, comments)]
D[Python API<br/>FastAPI<br/>:8088] <-->|read + write + chat| C
E[Frontend<br/>Next.js 15<br/>:3000] <-->|REST proxy| D
F[Redis 7] <-->|pub/sub, jti| D
A -.->|reads comments| D
Five Docker services:
| Service | Stack | Port | Purpose |
|---|---|---|---|
| PostgreSQL 16 | 15+ tables, 2 views | 5432 | Source of truth |
| MCP Server | FastMCP / Python | 8080 | 34 tools for Claude |
| Python API | FastAPI | 8088 | REST backend (projects, sections, chat, auth, audit) |
| Frontend | Next.js 15, React 19, Tailwind v4, shadcn/ui, Better Auth | 3000 | Web UI |
| Redis 7 | — | 6379 | WebSocket token uniqueness, real-time pub/sub |
Quick Start
cd PRDforge
./install.sh
This single command:
- Pulls pre-built images from ghcr.io (or builds locally if unavailable)
- Starts Docker services (PostgreSQL, MCP server, API, Frontend, Redis)
- Configures your Claude client (Code or Desktop)
- Validates everything works
# Options
./install.sh --claude-code # Non-interactive (HTTP transport)
./install.sh --claude-desktop # Non-interactive (stdio transport)
./install.sh --build # Force local build instead of pulling images
./install.sh --uninstall # Remove config + optionally stop services
POSTGRES_PORT=5433 ./install.sh # Override host PostgreSQL port
If 5432 is already in use, install.sh automatically picks the first free port in 5433-5500.
The stack starts in ~15 seconds. PostgreSQL seeds a sample "SnapHabit" project (12 sections, 12 dependencies) on first boot.
After install, restart your Claude client. Web UI: http://localhost:3000
Configuration
MCP Configuration (Manual)
<details> <summary>Claude Code (HTTP — recommended with Docker)</summary>
Add to ~/.claude/mcp.json (or .claude/mcp.json in project):
{
"mcpServers": {
"prd-forge": {
"type": "http",
"url": "http://localhost:8080/mcp/"
}
}
}
Start services: docker compose up -d
</details>
<details> <summary>Claude Desktop (stdio)</summary>
-
Install Python dependencies:
cd PRDforge/mcp_server python3 -m venv .venv && .venv/bin/pip install -r requirements.txt -
Open Claude Desktop → Settings → Developer → Edit Config:
{ "mcpServers": { "prd-forge": { "command": "/absolute/path/to/PRDforge/mcp_server/.venv/bin/python", "args": ["/absolute/path/to/PRDforge/mcp_server/server.py"], "env": { "DATABASE_URL": "postgresql://prdforge:prdforge@localhost:5432/prdforge" } } } } -
Start postgres:
docker compose up -d postgres -
Restart Claude Desktop (Cmd+Q, reopen)
Note: Claude Desktop does not support HTTP transport. Use stdio (spawns server as subprocess). </details>
<details> <summary>HTTP transport (claude.ai or other MCP clients)</summary>
{
"mcpServers": {
"prd-forge": {
"type": "streamable-http",
"url": "http://localhost:8080/mcp/"
}
}
}
</details>
Chat Configuration
Chat is an experimental feature, disabled by default. Enable per-project in Settings → Experimental Features.
| Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY |
— | Anthropic API key for chat |
ANTHROPIC_MODEL |
claude-haiku-4-5-20251001 |
Model for chat responses |
CHAT_MAX_ATTACHMENTS |
5 |
Max files per chat turn |
CHAT_ATTACHMENT_MAX_BYTES |
200000 |
Max size per file payload |
MCP Tools Reference
See docs/tool-reference.md for workflows and usage examples.
<details> <summary>All 33 MCP Tools</summary>
Project (3)
| Tool | Description |
|---|---|
prd_create_project |
Create project (optional template: saas-mvp, mobile-app, api-design) |
prd_delete_project |
Delete project and all sections (cascades) |
prd_list_projects |
List all projects with section counts |
Sections (9)
| Tool | Description |
|---|---|
prd_create_section |
Create new section with content, tags, type |
prd_delete_section |
Delete section (warns about dependencies) |
prd_duplicate_section |
Copy section with new slug |
prd_list_sections |
List sections — metadata only, no content |
prd_merge_sections |
Merge source into target (content, deps, comments, children) |
prd_move_section |
Change sort_order or parent section |
prd_read_section |
Read full content + dependency context summaries |
prd_reorder_sections |
Reorder sections by slug list |
prd_update_section |
Update fields, auto-revision on content change, atomic comment resolve |
Dependencies (3)
| Tool | Description |
|---|---|
prd_add_dependency |
Add/update dependency link (idempotent) |
prd_remove_dependency |
Remove a dependency link |
prd_suggest_dependencies |
Auto-suggest deps via content similarity (TF-IDF) |
Comments (5)
| Tool | Description |
|---|---|
prd_add_comment |
Add inline comment anchored to selected text |
prd_add_comment_reply |
Add a reply to an inline comment |
prd_delete_comment |
Delete a comment |
prd_list_comments |
List all comments across project with section pointers |
prd_resolve_comment |
Resolve or reopen a comment |
Context & Search (4)
| Tool | Description |
|---|---|
prd_get_changelog |
Recent revision history across all sections |
prd_get_overview |
Project overview with section summaries (~10% of full doc) |
prd_search |
Full-text or tag search across sections |
prd_token_stats |
Token savings statistics for the project |
Revisions (3)
| Tool | Description |
|---|---|
prd_get_revisions |
List revision metadata for a section |
prd_read_revision |
Read a specific historical revision's content |
prd_rollback_section |
Rollback to a previous revision (current saved as backup) |
Import & Export (3)
| Tool | Description |
|---|---|
prd_export_markdown |
Export full document as assembled markdown |
prd_import_markdown |
Import from markdown (configurable heading level or delimiter) |
prd_import_url |
Import from URL (SSRF-protected, Google Docs/GitHub support) |
Settings (2)
| Tool | Description |
|---|---|
prd_get_settings |
Get project settings (merged defaults + overrides) |
prd_update_settings |
Update project settings |
Batch (1)
| Tool | Description |
|---|---|
prd_bulk_status |
Update status for multiple sections at once |
</details>
Inline Comments
Google Docs-style comments anchored to specific text in any section:
- In the UI — select text → click "+ Comment" → write your note → Save
- Via MCP —
prd_add_comment(project, section, anchor_text, body) - Claude scans comments —
prd_list_commentsreturns all open comments - Resolve after implementing —
prd_resolve_commentor click "Resolve" in the UI
Development
# Run backend tests (requires postgres running)
docker compose up -d postgres
pip install -r tests/requirements.txt
pytest tests/ -x -v
# Frontend type checking and lint
cd frontend && yarn typecheck && yarn lint && yarn test --run
# Smoke tests (requires full stack)
docker compose up -d
pytest tests/test_smoke.py -v
# Record demo video
pip install -r scripts/requirements.txt
playwright install chromium
python scripts/record_demo.py
Project structure:
PRDforge/
├── docker-compose.yml
├── frontend/ # Next.js 15 app (React 19, Tailwind v4, shadcn/ui)
├── api/ # FastAPI backend (REST, chat, auth, WebSocket)
├── mcp_server/ # FastMCP server (34 tools, stdio + HTTP)
├── shared/ # Shared Python modules (settings, constants, templates)
├── db/ # PostgreSQL schema migrations (13 files)
├── tests/ # pytest test suite
├── scripts/ # Demo recording, utilities
└── docs/ # Tool reference, data model, scaling guide
Security & Deployment
PRD Forge ships with Better Auth (email/password + Google OAuth) and role-based access control. Sign-up is closed after the first user is created — new users are invited via organization member management.
Localhost-only by default:
- All ports bound to
127.0.0.1— not accessible from LAN - No TLS — acceptable only for localhost
- Database credentials are defaults (
prdforge/prdforge)
For production deployment:
- Put behind a reverse proxy with TLS (nginx, Caddy, Traefik)
- Change database credentials in
.env - Set
BETTER_AUTH_SECRETto a strong random value - See docs/scaling.md for detailed guidance
- Do NOT bind ports to
0.0.0.0or expose via tunnels without auth
Data Model
15+ tables, 2 views. See docs/data-model.md for the full ER diagram, dependency types, tags, statuses, and the SnapHabit example.
Backup & Restore
# Export as markdown
curl http://localhost:8088/api/projects/snaphabit/export > backup.md
# PostgreSQL dump
docker exec prdforge-postgres-1 pg_dump -U prdforge prdforge > backup.sql
# Full reset (destroys all data)
docker compose down -v && docker compose up -d
Contributing
See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。