Initialize MCP - AI Development Assistant
Complete guide to the MCP AI Development system with intelligent startup, multi-agent orchestration, and learning pipelines
🚀 Initialize MCP - AI Development Assistant
The most advanced AI development memory and learning system.
📋 Quick Start
At the Start of Each Task
mcp_init({ task: "your task description" })
This displays the MCP Dashboard with:
- System health check
- Quick stats
- Mode selection (auto-selects after 5 seconds)
After Making Decisions
log_decision({
type: "implementation",
question: "What was decided?",
chosen: "What was chosen",
reasoning: "Why this choice",
confidence: 0.9
})
🎯 MCP Init Dashboard
Features
| Feature |
Description |
| Health Check |
Verifies backend, MCP, database connectivity |
| Quick Stats |
Decisions, embeddings, coverage %, golden count |
| Mode Selection |
Quick Task vs Multi-Agent Orchestration |
| Auto-Select |
Defaults to recommended mode after 5 seconds |
| Task Detection |
Auto-suggests mode based on task complexity |
| Recent Context |
Shows last 3 decisions |
| Pending Outcomes |
Reminds about decisions needing feedback |
Dashboard Display
┌────────────────────────────────────────────────────────────────────┐
│ 🤖 GoGrab AI Development Assistant │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ │
│ 📊 System Status: ✅ Backend (42ms) ✅ MCP v1.0.0 │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ Decisions │ Embeddings │ Coverage │ Golden │ │
│ │ 9,962 │ 6,202 │ 62% │ 200 │ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
│ │
│ 🎯 Session: 10.7 │
│ │
│ ▶ [1] 🚀 Quick Task (recommended) │
│ [2] 🎭 Multi-Agent Orchestration │
│ [3] 🔍 Search Past Decisions │
│ [4] 📈 View Learning Stats │
│ │
│ 💡 Recent Context: │
│ • Data architecture standardization │
│ • Multi-agent orchestration analysis │
│ • MCP init dashboard implementation │
│ │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ │
│ 💬 Reply 1, 2, 3, 4 — or say "go" for Quick Task │
│ Default: [1] 🚀 Quick Task │
│ │
└────────────────────────────────────────────────────────────────────┘
Mode Selection
| Mode |
Shortcut |
When to Use |
| 🚀 Quick Task |
1 or ENTER |
Bug fixes, simple tasks, questions |
| 🎭 Orchestrated |
2 |
Complex features, refactoring, migrations |
| 🔍 Search |
3 |
Find similar past decisions before starting |
| 📈 Stats |
4 |
View learning statistics and patterns |
Smart UX
- 5-second auto-select: Proceeds with default if no response
- Double ENTER: Quick confirm for default selection
- Task complexity detection: Analyzes task → suggests appropriate mode
🔧 Available MCP Tools
Core Tools
| Tool |
Purpose |
When to Use |
mcp_init |
Initialize session with dashboard |
START of each task |
preflight |
Get intelligent context (~100 tokens) |
Before complex decisions |
log_decision |
Record a decision for learning |
After making decisions |
find_similar |
Search past decisions |
Need more context |
report_outcome |
Report success/failure |
After testing |
Advanced Tools
| Tool |
Purpose |
select_mode |
Execute mode from dashboard |
get_stats |
Comprehensive system statistics |
get_conventions |
Learned codebase conventions |
add_convention |
Add a new convention |
get_pending_outcomes |
Decisions needing feedback |
get_lifecycle_status |
Decision lifecycle tracking |
transfer_intelligence |
Cross-tier learning |
predict_outcome |
ML-based outcome prediction |
mine_patterns |
Extract patterns from decisions |
📊 3-Tier Data Architecture
Data Flow
┌─────────────────────────────────────────────────────────────────┐
│ TIER 1: RAW DECISIONS │
│ ai-agents.decisions │
│ (9,962 documents) │
└─────────────────────────┬───────────────────────────────────────┘
│ Auto-embed
▼
┌─────────────────────────────────────────────────────────────────┐
│ TIER 2: VECTOR EMBEDDINGS │
│ ai-memory.agent_embeddings │
│ (6,202 documents - 62% coverage) │
└─────────────────────────┬───────────────────────────────────────┘
│ Promote (high confidence, outcomes)
▼
┌─────────────────────────────────────────────────────────────────┐
│ TIER 3: GOLDEN DECISIONS │
│ ai-agents.golden_decisions │
│ ai-memory.golden_embeddings │
│ (200 documents each) │
└─────────────────────────────────────────────────────────────────┘
Databases
| Database |
Collections |
Purpose |
ai-agents |
decisions, golden_decisions, agent_patterns |
Primary decision storage |
ai-memory |
agent_embeddings, golden_embeddings |
Vector search & embeddings |
ai-mcp-dev |
sessions, mcp_config, trigger_states |
mcp-gograb-ai service data (MCP configuration) |
Cross-Reference Field
All collections use originalDecisionId for linking:
// Find embedding for a decision
decisions._id = "abc123"
agent_embeddings.originalDecisionId = "abc123"
golden_decisions.originalDecisionId = "abc123"
golden_embeddings.originalDecisionId = "abc123"
🧠 Intelligence Pyramid
Context Loading Priority
┌─────────────┐
│ CORE RULES │ ← Always loaded (~20 items, ~500 tokens)
│ Priority 1 │
└──────┬──────┘
│
┌──────▼──────┐
│ PATTERNS │ ← Loaded for matching categories
│ Priority 2 │
└──────┬──────┘
│
┌──────▼──────┐
│ SIMILAR │ ← Vector search for specific query
│ Priority 3 │
└──────┬──────┘
│
┌──────▼──────┐
│ WORKING │ ← Current session memory
│ MEMORY │
└─────────────┘
Token Budget
| Component |
Budget |
Content |
| Core Rules |
~500 tokens |
Critical patterns (always) |
| Patterns |
~300 tokens |
Category-specific patterns |
| Similar |
~200 tokens |
Top 3-5 similar decisions |
| Working Memory |
~100 tokens |
Current session summaries |
| Total |
~1,100 tokens |
Efficient context loading |
🎭 Multi-Agent Orchestration
Agent Types
| Agent |
Specialization |
When Used |
initializer |
Setup, scaffolding |
First session, project setup |
planner |
Design, architecture |
Planning, design steps |
executor |
Implementation |
General coding tasks |
reviewer |
Testing, validation |
Review, verification steps |
specialist |
Domain-specific |
UI, API, database, security |
Orchestration Flow
Task: "Implement user authentication"
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 1. DECOMPOSITION │
│ Task → [Setup Auth Module] → [Implement Login] → │
│ [Add Guards] → [Test & Verify] │
└─────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 2. AGENT SELECTION │
│ Step 1: initializer (setup) │
│ Step 2: specialist/security (login) │
│ Step 3: executor (guards) │
│ Step 4: reviewer (testing) │
└─────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 3. EXECUTION │
│ Each step creates session → decisions → outcomes │
└─────────────────────────────────────────────────────────────┘
API Endpoints
| Endpoint |
Method |
Purpose |
/ai-api/orchestration/plan |
POST |
Create execution plan |
/ai-api/orchestration/active |
GET |
List active orchestrations |
/ai-api/orchestration/:id/status |
GET |
Get orchestration status |
/ai-api/orchestration/:id/progress |
POST |
Update progress |
🔄 Adaptive Learning Triggers
Trigger Types
| Trigger |
Condition |
Action |
| Volume |
N decisions in category |
Pattern extraction |
| Repetition |
Same question 3x |
Immediate pattern |
| Performance |
Success rate drops |
Anti-pattern detection |
| Confidence |
Avg confidence drops |
Meta-learning |
| Novelty |
New category detected |
Accelerated learning |
Learning Jobs
| Job Type |
Purpose |
PATTERN_EXTRACTION |
Create patterns from decision clusters |
ANTI_PATTERN_DETECTION |
Identify failure modes |
RULE_PROMOTION |
Promote patterns to core rules |
META_LEARNING |
Adjust trigger effectiveness |
📁 File Structure
MCP Source
MCP/mcp-development-ai/src/
├── server.ts # Main server & tool registration
├── config/
│ └── constants.ts # Configuration values
├── storage/
│ ├── file-storage.ts # File persistence
│ ├── memory-store.ts # In-memory store
│ └── docs-data-integration.ts # Session data integration
├── tools/
│ ├── mcp-init.ts # 🆕 Init dashboard
│ ├── preflight.ts # Context loading
│ ├── log-decision.ts # Decision logging
│ ├── find-similar.ts # Semantic search
│ └── ... # Other tools
└── services/
├── decision-lifecycle-manager.ts
└── outcome-validator.ts
Session Data
sessions/
├── sessionID.json # Current session tracking
├── sessions-history/
│ ├── session-9.json
│ └── session-10.json
└── schemas/
├── session-manifest.schema.json
└── session-manifest.template.json
Local Cache
.cursor/ai-memory/
├── current-session.json # Hot session data
├── working-memory.json # Quick summaries
├── conventions.json # Learned conventions
└── sessions/
└── session-9.json # Historical cache
🔗 Backend API Endpoints
Infrastructure
| Endpoint |
Purpose |
GET /ai-api/infrastructure/health |
System health check |
POST /ai-api/infrastructure/decisions |
Create decision |
POST /ai-api/infrastructure/decisions/vector-search |
Semantic search |
POST /ai-api/infrastructure/decisions/hybrid-search |
Keyword + vector |
POST /ai-api/infrastructure/decisions/promote |
Promote to golden |
GET /ai-api/infrastructure/pipeline/stats |
Pipeline statistics |
Embeddings
| Endpoint |
Purpose |
POST /ai-api/infrastructure/embeddings/generate |
Generate embedding |
POST /ai-api/infrastructure/embeddings/backfill |
Batch generate |
Migration/Cleanup
| Endpoint |
Purpose |
POST /ai-api/infrastructure/standardize/add-original-decision-id |
Add cross-reference |
POST /ai-api/infrastructure/cleanup/drop-unused-collections |
Remove unused |
📅 Date Standardization
Standard Fields
All collections use consistent date fields:
| Field |
Type |
Purpose |
timestamp |
Date |
Primary event time (filterable) |
displayDate |
String |
Human-readable (e.g., "Dec 17, 2025, 10:51 AM") |
createdAt |
Date |
Document creation (Mongoose auto) |
updatedAt |
Date |
Last modification (Mongoose auto) |
Shared Utility
import { formatDisplayDate, createTimestampFields } from '@app/shared/date.utils';
// Format for display
formatDisplayDate(new Date()) // "Dec 17, 2025, 10:51 AM"
// Create all timestamp fields
createTimestampFields() // { timestamp, displayDate, createdAt, updatedAt }
⚡ Quick Reference Commands
Terminal Commands
# Check backend health
curl -s "http://localhost:3001/ai-api/infrastructure/health" | jq '.'
# Get pipeline stats
curl -s "http://localhost:3001/ai-api/infrastructure/pipeline/stats" | jq '.'
# Check session
cat sessions/sessionID.json
# Session manager status
node tools/scripts/database/session-manager.js status
MCP Tool Calls
// Initialize session
mcp_init({ task: "Fix authentication bug" })
// Get context before decision
preflight({ task: "How to structure auth module" })
// Log decision
log_decision({
type: "architecture",
question: "How to structure auth?",
chosen: "Separate service + guards",
reasoning: "Better testability and separation of concerns",
confidence: 0.9,
files: ["auth.service.ts", "auth.guard.ts"]
})
// Report outcome
report_outcome({
decisionId: "dev_1765995218122_xhpxjtq",
wasSuccessful: true,
rating: 5,
feedback: "Works perfectly"
})
🚨 Troubleshooting
Common Issues
| Issue |
Solution |
| MCP not connecting |
Restart MCP server, check backend is running |
| Session not updating |
Check sessions/sessionID.json exists |
| Decisions not syncing |
Verify backend at localhost:3001 |
| Embeddings not generating |
Check OPENAI_API_KEY is set |
Health Check
# Full system check
curl -s "http://localhost:3001/ai-api/infrastructure/health" | jq '.'
# Expected output:
{
"status": "healthy",
"databases": {
"ai-agents": { "status": "healthy" },
"ai-memory": { "status": "healthy" },
"ai-mcp-dev": { "status": "healthy" }
},
"stats": {
"decisions": 9962,
"embeddings": 6202,
"sessions": 0
}
}
📈 System Statistics (Current)
| Metric |
Value |
| Total Decisions |
9,962 |
| Embeddings |
6,202 (62% coverage) |
| Golden Decisions |
200 |
| Golden Embeddings |
200 (100% coverage) |
| Sessions |
10 (current) |
| Session ID |
10.7 |
🔮 Future Enhancements
Last Updated: December 17, 2025 - Session 10.7