|
| 1 | +🏷️ PRP METADATA |
| 2 | +PRP ID: PRP-MCP-STDIO-001 |
| 3 | +Type: Backend Development |
| 4 | +Domain: MCP Server Transport |
| 5 | +Technology Stack: Python/FastMCP/STDIO |
| 6 | +Complexity Level: Medium |
| 7 | + |
| 8 | +🎯 BUSINESS CONTEXT LAYER |
| 9 | +Business Objectives |
| 10 | +- MCP Server utilizes STDIO transport to enable ctx.read_resource(task_file_uri) functionality with file:// and resource:// URIs |
| 11 | +- Maintain compatibility with MCP specification for Claude Code, Cursor, Trae clients |
| 12 | +- Improve communication efficiency and reliability between server and clients |
| 13 | + |
| 14 | +SLAs & Performance Requirements |
| 15 | +- 100% of resource reading tests pass with URIs after transport change |
| 16 | +- Response time for basic operations remains under 2 seconds |
| 17 | +- No regressions in existing functionality |
| 18 | +- STDIO transport test coverage reaches 90% |
| 19 | + |
| 20 | +🔧 TECHNICAL TRANSLATION |
| 21 | +Architecture Pattern |
| 22 | +- Functional Core & Imperative Shell (FCIS) with transport logic in shell layer |
| 23 | +- Hexagonal Architecture with STDIO adapter implementation |
| 24 | +- Maintain core/shell separation with MCPOrchestrator in shell coordinating transport |
| 25 | + |
| 26 | +Technology Specifications |
| 27 | +- FastMCP library for STDIO transport implementation |
| 28 | +- Python 3.13 with proper dependency management |
| 29 | +- Ruff line-length=88 and MyPy strict mode compliance |
| 30 | + |
| 31 | +Specification Output |
| 32 | +📝 SPECIFICATION OUTPUT |
| 33 | +Expected Deliverables |
| 34 | +- src/app.py updated to use STDIO transport instead of HTTP |
| 35 | +- MCPOrchestrator(mcp) configured for STDIO communication |
| 36 | +- tool_registry.register_all_to_mcp(mcp) working with STDIO transport |
| 37 | +- Updated documentation for STDIO client connections |
| 38 | + |
| 39 | +Code Structure Guidelines |
| 40 | +- Transport changes confined to src/shell/ layer |
| 41 | +- Core business logic remains unchanged in src/core/ |
| 42 | +- STDIO adapter follows port naming conventions (*CommandPort, *RepositoryPort) |
| 43 | + |
| 44 | +✅ VALIDATION FRAMEWORK |
| 45 | +Testing Strategy |
| 46 | +- Unit tests for core functionality remain unchanged (≥70% of suite) |
| 47 | +- Integration tests validate STDIO transport with real adapters (≤25% of suite) |
| 48 | +- E2E tests verify client connectivity via STDIO (≤5% of suite) |
| 49 | + |
| 50 | +Quality Gates |
| 51 | +- Architecture compliance: Core functions remain pure without I/O |
| 52 | +- Test distribution: 70/25/5 ratio maintained |
| 53 | +- Code quality: Ruff formatting and MyPy strict validation pass |
| 54 | + |
| 55 | +✨ AI CONTEXT ADAPTATION |
| 56 | +Model Compatibility Notes |
| 57 | +- Claude 3: Excellent for complex transport architecture changes |
| 58 | +- Include specific file paths (src/app.py, MCPOrchestrator) in prompts |
| 59 | +- Emphasize FCIS compliance during implementation |
| 60 | + |
| 61 | +📊 SUCCESS METRICS |
| 62 | +Performance Metrics |
| 63 | +- Resource reading operations complete in <2 seconds |
| 64 | +- Client connection establishment time <500ms |
| 65 | +- STDIO transport throughput: 1500 req/sec |
| 66 | + |
| 67 | +Quality & Reliability Metrics |
| 68 | +- 90% test coverage for STDIO transport code |
| 69 | +- Zero regressions in existing functionality |
| 70 | +- Ruff formatting compliance: 100% |
| 71 | + |
| 72 | +📋 ARCHITECTURE COMPLIANCE CHECKLIST |
| 73 | +- [ ] FCIS patterns properly implemented in src/app.py |
| 74 | +- [ ] Port naming conventions followed in src/core/ports/ |
| 75 | +- [ ] Test distribution requirements met in tests/ |
| 76 | +- [ ] Value objects are immutable in src/core/models/ |
| 77 | +- [ ] Core functions are pure in src/core/use_cases/ |
| 78 | +- [ ] Token budget under 1000 tokens |
0 commit comments