Multi-Platform MCP Integration
Complete guide to the unified learning system that works across Cursor, Claude Code, and all AI platforms
๐ Multi-Platform MCP Integration
One learning system. All platforms. Zero duplication.
The MCP Development AI system now supports platform-agnostic learning, enabling Cursor, Claude Code, Claude Desktop, and any future AI tools to share the same intelligent agent system.
๐ฏ Overview
The Problem We Solved
Before Session 16, the MCP system was tightly coupled to Cursor:
- Agent IDs like
cursor-angular-agent - Platform-specific detection
- Decisions isolated to one tool
- No cross-platform learning
The Solution
Platform-Agnostic Architecture where:
- โ
Agents are functional (
angular-agent, notcursor-angular-agent) - โ Platform tracked for analytics, not routing
- โ All platforms share decisions in one unified pool
- โ Cross-platform learning - Cursor decisions improve Claude Code and vice versa
- โ Backwards compatible - Legacy agent IDs still work
๐๏ธ Architecture
Unified Learning System
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PLATFORM-AGNOSTIC MCP SYSTEM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ UNIFIED DECISION DATABASE โ
โ โ
โ โข Platform tracked separately โ
โ โข Agents are functional โ
โ โข Shared learning pool โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โฒ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ โ
โโโโโโผโโโโโ โโโโโโโโผโโโโโโโ โโโโโโโโผโโโโโโโ
โ Cursor โ โ Claude Code โ โ Claude โ
โ โ โ โ โ Desktop โ
โ cursor โ โ claude-code โ โclaude-desktopโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ SHARED AGENT SYSTEM โ
โ โ
โ โข architecture-agent โ
โ โข angular-agent โ
โ โข backend-agent โ
โ โข testing-agent โ
โ โข documentation-agent โ
โ โข orchestrator-agent โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Principles
| Principle | Implementation | Benefit |
|---|---|---|
| Platform-Agnostic Agents | Functional IDs (e.g., angular-agent) |
All platforms use same agents |
| Platform Metadata | Tracked in session.platform |
Analytics without routing impact |
| Shared Decision Pool | One database for all platforms | Cross-platform learning |
| Automatic Detection | Multi-layered platform detection | No manual configuration |
| Legacy Support | normalizeAgentId() function |
Backwards compatible |
๐ง Technical Implementation
Platform Detection
The system automatically detects which AI platform is making requests:
// Multi-layered detection strategy
export function detectPlatform(): PlatformMetadata {
// 1. Environment variables
if (process.env.CLAUDE_CODE_AGENT === 'true') {
return { type: 'claude-code', environment: detectEnvironment() };
}
// 2. Process arguments
const args = process.argv.join(' ');
if (args.includes('claude-code')) {
return { type: 'claude-code' };
}
// 3. Parent process inspection
const execPath = process.env._ || '';
if (execPath.includes('claude') && !execPath.includes('cursor')) {
return { type: 'claude-code' };
}
// 4. Cursor detection
if (isCursor()) {
return { type: 'cursor', environment: 'cursor' };
}
// 5. Fallback
return { type: 'external' };
}
Platform Metadata Structure
interface PlatformMetadata {
type: 'cursor' | 'claude-code' | 'claude-desktop' | 'api' | 'external';
version?: string; // e.g., "claude-code-2.0.75"
model?: string; // e.g., "claude-opus-4-5-20251101"
environment?: string; // e.g., "vscode", "terminal"
clientId?: string; // Unique client identifier
}
Decision Structure with Platform
interface DevelopmentDecision {
id: string;
agentId: string; // NOW: "architecture-agent" (not "cursor-architecture-agent")
session: {
type: PlatformType;
sessionNumber: number;
sessionID: string;
platform: PlatformMetadata; // โจ NEW: Platform tracking
};
type: DecisionType;
question: string;
chosen: string;
reasoning: string;
confidence: number;
// ... rest of decision fields
}
๐ New Features
1. Platform-Agnostic Agent IDs
Before (Session <16):
// Platform-specific IDs
agentId: "cursor-angular-agent"
agentId: "cursor-architecture-agent"
After (Session 16+):
// Functional IDs - work across all platforms
agentId: "angular-agent"
agentId: "architecture-agent"
Migration:
- โ
Automatic via
normalizeAgentId() - โ Legacy IDs still work
- โ No breaking changes
normalizeAgentId('cursor-angular-agent') // โ 'angular-agent'
normalizeAgentId('angular-agent') // โ 'angular-agent'
2. get_platform_info Tool
New MCP tool for platform debugging and analytics:
// Usage
const info = await get_platform_info({ includeHistory: true });
// Returns
{
success: true,
platform: {
type: "claude-code",
version: "2.0.75",
model: "claude-opus-4-5-20251101",
environment: "vscode",
clientId: "cc-session-123"
},
session: {
type: "claude-code",
sessionNumber: 16,
sessionID: "16.8"
},
capabilities: {
sharedLearning: true,
crossPlatformDecisions: true,
legacyAgentIdSupport: true,
platformAgnosticRouting: true
},
supportedPlatforms: [
"cursor",
"claude-code",
"claude-desktop",
"api",
"external"
],
usageHistory: { // Only with includeHistory: true
"cursor": 150,
"claude-code": 45
}
}
3. Enhanced get_stats Tool
Now includes platform breakdown:
const stats = await get_stats();
// Returns (new fields)
{
stats: {
version: "4.0.0",
currentPlatform: "claude-code", // โจ NEW
currentSession: 16,
platforms: { // โจ NEW
"cursor": {
decisionCount: 150,
successRate: 87,
lastActive: "2025-12-28T20:48:03Z"
},
"claude-code": {
decisionCount: 45,
successRate: 92,
lastActive: "2025-12-28T20:48:38Z"
}
},
// ... rest of stats
}
}
๐ Cross-Platform Learning
How It Works
Cursor makes decision โ Logged with platform="cursor"
โ
Stored in unified database
โ
Agent learns pattern
โ
Claude Code requests context โ Gets pattern from Cursor
โ
Claude Code benefits from Cursor's learning
โ
Claude Code makes improved decision โ Logged with platform="claude-code"
โ
Agent gets smarter
โ
Both platforms benefit from combined intelligence
Example Scenario
Day 1 - Cursor Session
// Developer using Cursor makes architectural decision log_decision({ type: 'architecture', question: 'How to structure user authentication?', chosen: 'JWT with refresh tokens in httpOnly cookies', reasoning: 'More secure than localStorage, prevents XSS attacks', confidence: 0.95 }); // Platform: cursor, AgentID: architecture-agentDay 2 - Claude Code Session
// Developer using Claude Code needs auth guidance const context = await preflight({ task: 'Implement auth system' }); // Claude Code receives: { historicalHints: [ "JWT with refresh tokens in httpOnly cookies - prevents XSS (95% confidence)" ], // This came from Cursor's decision! }Result
- Claude Code benefits from Cursor's learning
- No manual knowledge transfer needed
- Consistent best practices across platforms
๐ Configuration
For Cursor (Existing)
.cursor/mcp-config.json - Upgraded to v2.0:
{
"version": "2.0",
"platform": {
"supportedPlatforms": ["cursor", "claude-code", "claude-desktop", "api", "external"],
"autoDetect": true,
"trackPlatformMetrics": true
},
"session": {
"current": 16,
"currentID": "16.8",
"sharedAcrossPlatforms": true
},
"agents": {
"current": "angular-agent",
"available": [
"orchestrator-agent",
"architecture-agent",
"angular-agent",
"backend-agent",
"testing-agent",
"documentation-agent"
],
"legacyIdSupport": true,
"sharedLearning": true
}
}
For Claude Code (New)
.claude/mcp.json:
{
"mcpServers": {
"gograb-development-ai": {
"type": "stdio",
"command": "node",
"args": [
"--import",
"tsx",
"./MCP/mcp-development-ai/src/server.ts"
],
"cwd": "${workspaceFolder}",
"env": {
"CLAUDE_CODE_AGENT": "true",
"MCP_WORKSPACE": "${workspaceFolder}"
}
}
}
}
For Claude Desktop
~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"gograb-development-ai": {
"type": "stdio",
"command": "node",
"args": [
"--import",
"tsx",
"/path/to/MCP/mcp-development-ai/src/server.ts"
],
"env": {
"CLAUDE_DESKTOP": "true"
}
}
}
}
๐ Analytics & Monitoring
Platform Statistics
Track which platforms contribute most to the learning system:
// Per-agent platform breakdown
const angularStats = getAgentPlatformStats('angular', decisions);
// Returns
{
"cursor": {
count: 89,
successRate: 0.87
},
"claude-code": {
count: 34,
successRate: 0.92
}
}
Cross-Platform Success Rates
Compare agent performance across platforms:
// Get all stats
const stats = await get_stats();
// Analyze platform differences
const cursorAngularSuccess = stats.platforms.cursor.successRate;
const claudeAngularSuccess = stats.platforms['claude-code'].successRate;
if (claudeAngularSuccess > cursorAngularSuccess) {
console.log('Claude Code users are making better Angular decisions!');
}
๐ Benefits
For Development Teams
| Benefit | Description |
|---|---|
| Tool Freedom | Use Cursor, Claude Code, or any tool - same intelligence |
| No Lock-in | Switch between platforms without losing context |
| Collective Learning | Team's knowledge automatically shared across tools |
| Consistent Quality | Same patterns enforced regardless of platform |
For AI Agents
| Benefit | Description |
|---|---|
| More Training Data | Decisions from all platforms improve agents |
| Cross-Validation | Patterns verified across multiple platforms |
| Faster Learning | More diverse examples = faster improvement |
| Better Calibration | Confidence scores tuned across platforms |
For the System
| Benefit | Description |
|---|---|
| Zero Duplication | One codebase, one database, one truth |
| Lower Maintenance | Update once, all platforms benefit |
| Easy Scaling | Add new platforms without architectural changes |
| Rich Analytics | Compare platform performance and contribution |
๐ฎ Future Enhancements
Planned Features
Platform-Specific Optimizations
- Tune agents per-platform based on success patterns
- "Angular-agent works better in Cursor for component generation"
- "Backend-agent excels in Claude Code for API design"
Platform Recommendation Engine
- Suggest which platform to use for specific tasks
- "For this type of refactoring, Cursor has 95% success rate"
- "For this architecture decision, Claude Code is optimal"
Cross-Platform A/B Testing
- Compare approaches across platforms
- Determine which platform's decisions lead to better outcomes
- Feed insights back to improve all platforms
Platform Collaboration
- Cursor starts task, Claude Code continues
- Seamless handoff with full context
- Multi-platform pair programming
๐ Best Practices
For Developers
// โ
DO: Let platform auto-detect
// The system knows which tool you're using
// โ
DO: Use the same session across platforms
// Session 16 works in both Cursor and Claude Code
// โ
DO: Report outcomes regardless of platform
// All platforms benefit from feedback
await report_outcome({
decisionId: 'dec_123',
wasSuccessful: true
});
// โ DON'T: Specify platform manually
// Let the detection handle it automatically
For Platform Integration
// โ
DO: Set appropriate environment variables
process.env.CLAUDE_CODE_AGENT = 'true';
process.env.CLAUDE_MODEL = 'claude-opus-4-5-20251101';
// โ
DO: Pass through environment in MCP config
{
"env": {
"CLAUDE_CODE_AGENT": "true",
"CLAUDE_SESSION_ID": "${sessionId}"
}
}
// โ
DO: Use platform info for debugging
if (process.env.DEBUG_PLATFORM) {
const info = await get_platform_info({ includeHistory: true });
console.log('Platform:', info.platform);
}
๐ Migration Guide
Upgrading from Pre-Session 16
No action required! The system is backwards compatible:
// Old decisions with cursor-* IDs
{ agentId: "cursor-angular-agent", ... }
// Automatically normalized to
{ agentId: "angular-agent", ... }
// When queried, both formats work:
getAgentDecisions('angular') // Returns decisions from both formats
Adding New Platforms
To add support for a new platform:
Add platform type:
// In types/index.ts export type PlatformType = | 'cursor' | 'claude-code' | 'your-new-platform' // โ Add here | ...Add detection logic:
// In session-detector.ts function isYourPlatform(): boolean { return process.env.YOUR_PLATFORM_AGENT === 'true'; }Update detection function:
export function detectPlatform(): PlatformMetadata { if (isYourPlatform()) { return { type: 'your-new-platform', ... }; } // ... existing detection }Create MCP config:
{ "mcpServers": { "gograb-development-ai": { "env": { "YOUR_PLATFORM_AGENT": "true" } } } }
That's it! All agents and learning automatically work.
๐ Success Metrics
Session 16 Results
| Metric | Value | Status |
|---|---|---|
| Platforms Supported | 5 (Cursor, Claude Code, Desktop, API, External) | โ |
| Agent Migration | 100% (6/6 agents) | โ |
| Legacy Compatibility | 100% | โ |
| TypeScript Compilation | โ No errors | โ |
| Decisions Logged | 2 test decisions | โ |
| Platform Detection | Working for all platforms | โ |
| Cross-Platform Stats | Tracking active | โ |
๐ Related Documentation
- MCP Index - System overview
- Architecture - Technical details
- Next Steps - Enhancement roadmap
- Session 16 Verification Report
๐ References
Files Modified
MCP/mcp-development-ai/src/types/index.ts- Platform typesMCP/mcp-development-ai/src/session/session-detector.ts- Detection logicMCP/mcp-development-ai/src/agents/agent-router.ts- Platform-agnostic routingMCP/mcp-development-ai/src/tools/stats.ts- Platform statisticsMCP/mcp-development-ai/src/server.ts- get_platform_info tool.cursor/mcp-config.json- v2.0 config.claude/mcp.json- Claude Code config
Key Functions
// Platform Detection
detectPlatform(): PlatformMetadata
getCurrentSession(): SessionMetadata | null
// Agent Management
normalizeAgentId(agentId: string): string
getAgentDecisions(type: AgentType, decisions[]): DevelopmentDecision[]
getAgentPlatformStats(type: AgentType, decisions[]): Record<string, Stats>
// MCP Tools
get_platform_info({ includeHistory?: boolean })
get_stats() // Enhanced with platform breakdown
This multi-platform integration represents a fundamental shift in how AI development tools can work together. No longer are agents siloed to individual platforms - they now form a unified intelligence that improves with every interaction, regardless of which tool is used.
Last Updated: December 28, 2025 | Session: 16.8 | Status: โ Production Ready