DeepPlan MCP
<p align="center">
<img src="https://deepplan.dev/favicon.svg" width="80" height="80" alt="DeepPlan Logo" />
</p>
<h1 align="center">DeepPlan MCP</h1>
<p align="center">
<strong>Architectural Intelligence Engine for AI-Powered Development</strong>
</p>
<p align="center">
Turn vague plans into production-ready architecture blueprints โ<br/>
reviewed by a Council of AI Architects before you write a single line of code.
</p>
<p align="center">
<a href="https://www.npmjs.com/package/deepplan-mcp"><img src="https://img.shields.io/npm/v/deepplan-mcp?color=blue&label=npm" alt="npm version" /></a>
<a href="https://github.com/gapgapweiqi/deepplan-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License" /></a>
<a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP Compatible" /></a>
<a href="https://deepplan.dev"><img src="https://img.shields.io/badge/deepplan.dev-website-black" alt="Website" /></a>
</p>
---
## Why DeepPlan?
Every AI coding assistant can generate code โ but **architecture is where projects succeed or fail.** DeepPlan catches design flaws, security gaps, and performance bottlenecks *before* they become expensive rewrites.
| | Without DeepPlan | With DeepPlan |
|---|---|---|
| **Planning** | AI gives generic, shallow plans | 4 expert architects analyze in parallel |
| **Quality** | No guardrails โ hallucination drift | Constitution enforces architectural correctness |
| **Perspective** | Single viewpoint | Security + Performance + UX/DX + DevOps |
| **Output** | Vague suggestions | Numbered, executable steps for your AI agent |
```
Your Draft Plan โ ๐ Security ยท โก Performance ยท ๐จ UX/DX ยท ๐ง DevOps โ ๐ Lead Architect โ Blueprint
```
---
## Works With
DeepPlan uses the **Model Context Protocol (MCP)** โ it works with any MCP-compatible client, not just IDEs:
| | Client | Use Case |
|---|---|---|
| ๐ฅ๏ธ | **Cursor, Windsurf, VS Code Copilot** | Architecture review while coding |
| ๐ป | **Claude Code** | Terminal-based planning and brainstorming |
| ๐ค | **Claude Desktop, ChatGPT** | Conversational architecture consulting |
| ๐ง | **Custom MCP Clients** | Build your own AI-powered architecture tools |
| ๐ก | **CI/CD & Automation** | Automated architecture linting in pipelines |
---
## Quick Start
### Cursor
Add to `~/.cursor/mcp.json`:
```json
{
"mcpServers": {
"deepplan": {
"command": "npx",
"args": ["-y", "deepplan-mcp"],
"env": {
"DEEPPLAN_API_KEY": "dpk_your-key-here"
}
}
}
}
```
### Windsurf
Add to your Windsurf MCP configuration:
```json
{
"mcpServers": {
"deepplan": {
"command": "npx",
"args": ["-y", "deepplan-mcp"],
"env": {
"DEEPPLAN_API_KEY": "dpk_your-key-here"
}
}
}
}
```
### Claude Code
```bash
claude mcp add deepplan -- npx -y deepplan-mcp --api-key=dpk_your-key-here
```
### VS Code (Copilot)
Add to `.vscode/mcp.json`:
```json
{
"servers": {
"deepplan": {
"command": "npx",
"args": ["-y", "deepplan-mcp"],
"env": {
"DEEPPLAN_API_KEY": "dpk_your-key-here"
}
}
}
}
```
> **Get your API key** at [deepplan.dev/api-keys](https://deepplan.dev/api-keys) โ free tier included.
---
## Use Cases
### ๐๏ธ Starting a New Project
> *"Build me a SaaS with Stripe billing and multi-tenant auth"*
Get a complete architecture blueprint โ data model, API design, auth flow, deployment strategy โ reviewed by 4 experts before writing a single line of code.
### ๐ Major Refactoring
> *"Migrate our REST API to GraphQL"*
Get expert analysis of migration risks, breaking changes, edge cases, and a step-by-step execution plan your AI coding assistant can follow.
### ๐ก๏ธ Security Review
> *"Review this authentication flow for vulnerabilities"*
Get a Security Architect's threat model: injection vectors, data exposure risks, and concrete mitigations tied to your tech stack.
### โก Performance Audit
> *"Optimize this data pipeline that's hitting 5s response times"*
Get bottleneck analysis with specific optimizations: caching strategy, query patterns, cold start reduction โ all for your actual stack.
### ๐งฉ API Design
> *"Design a public REST API for our platform"*
Get DX analysis, versioning strategy, error handling patterns, rate limiting architecture, and documentation structure.
### ๐ Architecture Review in CI/CD
> *"Automatically review architecture decisions in pull requests"*
Integrate DeepPlan into your pipeline to catch architectural anti-patterns before they reach production.
---
## Tools
### `upgrade_architecture_blueprint`
Send a draft plan to the Council of Architects for expert-level review.
| Parameter | Required | Description |
|-----------|----------|-------------|
| `draft_plan` | Yes | The architecture plan text to upgrade |
| `tech_stack` | No | e.g. `"SvelteKit, Cloudflare Workers, D1"` |
| `context_constraints` | No | e.g. `"Must run on Edge Runtime"` |
| `model_choice` | No | AI model for the Lead Architect synthesis |
**Returns:** A structured blueprint with Architecture Directives, Edge Cases, Constraints, Patterns, and numbered Next Steps your AI agent can execute immediately.
### `auto_select_personas`
Analyze a plan and recommend which expert personas are most relevant.
| Parameter | Required | Description |
|-----------|----------|-------------|
| `draft_plan` | Yes | The plan to analyze |
| `available_personas` | No | Custom persona list (defaults to 4 built-in experts) |
---
## The Constitution
Every council session enforces **architectural guardrails** called "The Constitution" โ rules that prevent AI hallucination drift and ensure high-quality output:
- **Terminology Precision** โ Flags misused architectural terms (e.g., "fetch" for a DB query โ should be "query")
- **Clean Architecture Metrics** โ Enforces low coupling, high cohesion, correct dependency direction
- **No Code Output** โ Experts focus on WHAT and WHY, never HOW in code
- **Tech Stack Awareness** โ All recommendations must reference your actual stack
- **Impact Prioritization** โ Most critical findings first, no filler
---
## Built-in Expert Personas
| Persona | Focus Areas |
|---------|-------------|
| ๐ **Security Architect** | Auth, data exposure, injection, CORS, API abuse, secrets management |
| โก **Performance Engineer** | Latency, caching, token cost, cold starts, DB queries, concurrency |
| ๐จ **UX/DX Designer** | Integration smoothness, error clarity, onboarding, config simplicity |
| ๐ง **DevOps Engineer** | Deploy strategy, CI/CD, monitoring, disaster recovery, scaling |
| ๐ **Lead Architect** | Synthesizes all expert reports into a unified, executable blueprint |
> Want domain-specific experts? Create custom personas at [deepplan.dev](https://deepplan.dev) โ available via proxy mode.
---
## Modes
### Proxy Mode (Recommended)
Uses your DeepPlan API key (`dpk_...`). Requests are analyzed by **DeepPlan Scout** (expert analysis) and synthesized by **DeepPlan Architect** (blueprint generation).
```
DEEPPLAN_API_KEY=dpk_your-key-here
```
Premium features via proxy mode:
- Custom personas and councils
- Advanced orchestration (debate mode, AI+IDE refinement)
- AI-powered search context (Librarian)
- Usage tracking and credit management
### Direct Mode (Fallback)
Uses your own OpenRouter API key. The council runs locally with 4 built-in expert personas. No DeepPlan account needed.
```
OPENROUTER_API_KEY=sk-or-v1-your-key-here
```
---
## Configuration
| Variable | Description |
|----------|-------------|
| `DEEPPLAN_API_KEY` | DeepPlan API key โ enables proxy mode with full features |
| `OPENROUTER_API_KEY` | OpenRouter key โ enables direct mode (fallback) |
| `DRAFT_PLAN_MAX_LENGTH` | Max input characters (default: `8000`) |
Configuration priority: **CLI args** > **environment variables** > **`.env` file**
```bash
npx deepplan-mcp --api-key=dpk_your-key-here
```
---
## Extend & Build
DeepPlan is designed to be extended. The open-source core gives you building blocks to create your own architectural intelligence:
- **Custom Personas** โ Add domain-specific experts (Database Architect, ML Engineer, etc.) in `src/prompts/personas.ts`
- **Search Providers** โ Plug in your own search backend by implementing the `SearchProvider` interface in `src/search/types.ts`
- **Custom Constitutions** โ Define your team's architectural standards and coding conventions
- **Pipeline Integration** โ Use as a pre-commit hook, CI/CD step, or automated PR reviewer
- **Build Your Own Client** โ The MCP protocol means any client can connect โ build custom tools on top of DeepPlan
---
## Architecture
```
โโโโโโโโโโโโโโโโโโโ stdio โโโโโโโโโโโโโโโโ
โ MCP Client โโโโโโโโโโโโโโโบโ DeepPlan โ
โ โ MCP โ MCP Server โ
โ โข AI IDEs โ Protocol โ (this repo) โ
โ โข CLI Tools โ โโโโโโโโฌโโโโโโโโ
โ โข Custom Apps โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
โ โ
Proxy Mode Direct Mode
โ โ
โโโโโโโโผโโโโโโโ โโโโโโโโโโผโโโโโโโโโ
โ DeepPlan API โ โ OpenRouter โ
โ deepplan.dev โ โ API โ
โ โ โ โ
โ โข Scout โ โ โข 4 built-in โ
โ (analysis) โ โ personas โ
โ โข Architect โ โ โข Basic council โ
โ (synthesis)โ โ โ
โ โข Debate โ โ โ
โ โข AI Search โ โ โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
```
---
## Premium Features
The open-source client provides full council functionality with 4 built-in personas. For teams and power users, [deepplan.dev](https://deepplan.dev) offers:
| Feature | Open Source | DeepPlan Pro |
|---------|:----------:|:------------:|
| 4 Built-in Experts | โ
| โ
|
| Custom Personas | โ | โ
|
| Council Builder | โ | โ
|
| Debate Mode (Pro/Con) | โ | โ
|
| AI Search (Librarian) | โ | โ
|
| Chair Persona | โ | โ
|
| Constitution Editor | โ | โ
|
| Usage Dashboard | โ | โ
|
---
## Development
```bash
# Clone
git clone https://github.com/gapgapweiqi/deepplan-mcp.git
cd deepplan-mcp
# Install
npm install
# Dev (with hot reload)
npm run dev
# Build
npm run build
# Type check
npm run typecheck
```
---
## Contributing
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
---
## License
[MIT](LICENSE) โ use it however you want.
---
<p align="center">
Built with โค๏ธ by <a href="https://deepplan.dev">DeepPlan</a>
</p>
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one recommends personas, the other runs the full architecture review. The auto_select_personas description explicitly states it does not run the council, preventing confusion.
Both names use snake_case with verb-led patterns (auto_select_personas, upgrade_architecture_blueprint). The 'auto_' prefix on the first is a minor deviation, but overall the convention is consistent and readable.
Two tools is on the thin side for a server whose workflow involves selecting personas and then running a review. It covers the core actions but feels under-scoped for a full architecture-review domain.
The server lacks a way to pass selected personas into the upgrade tool, creating a dead end for auto_select_personas. It also offers no way to iterate on or retrieve previous reviews, though the core review operation is present.