Offers multi-stage Alpine image packaging (150-200MB) for containerized deployment of the CTS MCP server in production environments.
Provides CI/CD pipeline with automated test, performance, quality, and security jobs for validating CTS MCP server builds and deployments.
Enables structured logging, metrics collection, and Prometheus export for observability of CTS MCP server operations and performance.
CTS MCP Server
Version: 3.0.0
Protocol: Model Context Protocol 2024-11-05
Status: β
Production Ready
Model Context Protocol server for Close-to-Shore (CTS) methodology automation, providing automated task creation in Shrimp MCP and interactive artifact visualization (signal maps, hop dashboards, dependency graphs) for Godot game development.
Features
Tier 3 Infrastructure (v3.0.0 - NEW!)
π CI/CD Pipeline: GitHub Actions with test, performance, quality, security jobs
π¦ NPM Package: Scoped
@broken-divinity/cts-mcp-serverready for npm publishπ³ Docker Support: Multi-stage Alpine image (150-200MB), production-ready
π Observability: Structured logging, metrics collection, Prometheus export
β‘ Performance: All benchmarks passing (<2ms cache, <100ms config, <5ms sampling)
π§ͺ Test Coverage: 772 tests passing (635+ from Tier 2C improvements)
Tier 2C Production Hardening (v3.0.0)
πΎ Result Caching: LRU cache with SHA-256 hashing (<2ms operations, 29/29 tests β )
βοΈ Hot-Reload Configuration: JSON-based config with validation (28/28 tests β )
π Stratified Sampling: Efficient large dataset handling (<5ms small, <100ms large, 18/18 tests β )
π‘οΈ Enhanced Error Handling: Actionable CTSError types with recovery suggestions (10/10 tests β )
β Schema Validation: Zod schemas for all 9 tools (16/16 tests β )
π§ Tool Integration: Consistent interface, cache support, metrics tracking (16/16 tests β )
Phase 2 Enhancements (v2.0.0)
π― AST-Level Parsing: Tree-sitter-gdscript with 100% signal extraction accuracy
π Clustered Signal Maps: Community detection with convex hull visualization (150-300 signals)
π Dependency Graphs: Cross-file signal connection tracking and visualization
π Performance Trends: Time-series monitoring of parse time, signal count, memory usage
β‘ 250x Faster Clustering: 3ms for 150 nodes (greedy modularity optimization)
𧬠20x Faster Parsing: 12.5ms for 1K LOC files (tree-sitter WASM)
Core Features
οΏ½π Automated Task Creation: Convert hop plans to Shrimp tasks via stdio IPC (30min β 5min per hop)
π Signal Architecture Visualization: D3.js force-directed graphs showing EventBus/SignalBus connections
π CTS Compliance Dashboard: React-based hop status boards with real-time progress tracking
β‘ High Performance: <50ms server startup, <400ms clustered map rendering
π§ͺ Well-Tested: 188 tests (93.6% pass rate), comprehensive coverage
π Secure: Stdio transport, Zod validation, webview sandbox
Quick Start
Installation
Note: The server uses web-tree-sitter (WASM) for GDScript parsing. If the WASM file (tree-sitter-gdscript.wasm) is not available, the server will automatically fall back to a proven regex parser. See docs/WASM_SETUP.md for details.
Usage
Start the MCP server (stdio transport):
The server listens on stdin and writes to stdout using JSON-RPC 2.0 protocol.
Tools
1. CTS_Export_to_Shrimp
Convert hop plan JSON to Shrimp tasks automatically.
Input:
Output:
Example:
2. CTS_Render_Artifact
Render interactive visualizations (signal maps, hop dashboards, dependency graphs, performance trends).
Supported Artifact Types:
signal_map: Basic force-directed signal graphsignal_map_v2: Clustered signal map with community detection (Phase 2)dependency_graph: Hierarchical signal connection visualization (Phase 2)performance_trends: Time-series performance monitoring (Phase 2)hop_dashboard: CTS hop status board
Signal Map V2 (Clustered) Example:
Features:
Greedy modularity optimization clustering
Convex hull boundaries for clusters
Interactive legend (toggle cluster visibility)
Performance overlay (clustering + render time)
Supports 150-300 signals
Dependency Graph Example:
Features:
Hierarchical tree layout
Signal definitions (green) and connections (blue)
File grouping visualization
Cross-file tracking
Performance Trends Example:
Features:
Multi-line time-series chart (D3.js)
Metric selection (dropdown)
Zoom/pan interaction
Threshold annotations
Hop Dashboard Example:
3. CTS_Scan_Project_Signals
Scan Godot project for signal definitions.
Input:
Output:
Examples
Example 1: Render Signal Map
Result: Interactive D3.js force-directed graph with 2 signals and 4 connections.
Example 2: Render Hop Dashboard
Result: Interactive React dashboard with 2 hops, status filtering, and statistics panel.
Example 3: Export to Shrimp (Requires Shrimp MCP Running)
Result: 2 tasks created in Shrimp with dependencies configured.
GDScript Integration
The CTS MCP server can be called from Godot GDScript using the BDMCPClient from the bd_dev_tools addon.
Prerequisites
Install
bd_dev_toolsaddon (containsBDMCPClient)Build the CTS MCP server:
npm run buildEnsure CTS MCP binary is accessible at
cts_mcp/build/index.js
Quick Start
API Reference
CTSMCPConfig.register_cts_server(client: BDMCPClient) -> Error
Registers the CTS MCP server configuration with the MCP client.
Parameters:
client: BDMCPClient instance
Returns: Error enum (OK or error code)
Example:
CTSMCPConfig.connect_to_cts_server(client: BDMCPClient) -> Error
Connects to the CTS MCP server (starts stdio subprocess).
Parameters:
client: BDMCPClient instance (must be registered first)
Returns: Error enum (OK or error code)
Example:
CTSMCPConfig.call_export_to_shrimp(client: BDMCPClient, hop_plan: Dictionary, update_mode: String, generate_sub_tasks: bool) -> Dictionary
Exports a hop plan to Shrimp MCP as tasks.
Parameters:
client: BDMCPClient instance (must be connected)hop_plan: Hop plan dictionary (see schema below)update_mode: Task update mode ("append","overwrite","selective","clearAllTasks")generate_sub_tasks: Whether to split hops into subtasks
Returns: Dictionary with keys:
content:{ tasksCreated: int, taskIds: Array, details: Array }error:{ code: String, message: String }(if failed)
Hop Plan Schema:
Example:
Advanced Usage
Call other CTS tools directly:
Error Handling
Debugging
Enable debug logging in BDMCPClient:
Check CTS MCP server logs:
Testing
The CTS MCP integration is validated by GUT tests in test/cts_mcp/test_cts_mcp_client.gd.
Run tests via Godot Editor:
Open Godot Editor:
godot4 --path /home/eric/Godot/ProtoBd --editorNavigate to: Bottom Panel β GUT β Run Tests
Select
test/cts_mcp/test_cts_mcp_client.gdin the test listClick "Run" button
View results in GUT panel
Test Coverage:
Server registration and connection
Tool list retrieval
CTS_Export_to_Shrimp calls with various hop plans
Error handling (invalid arguments, server unavailable)
Response validation (schema compliance)
Example test structure:
Expected test results:
β
test_cts_server_registration- Registers server successfullyβ
test_cts_connection- Connects to serverβ
test_list_cts_tools- Lists 9+ tools (CTS_Export_to_Shrimp, CTS_Render_Artifact, etc.)β
test_call_export_to_shrimp- Calls tool and receives responseβ
test_error_handling_missing_binary- Handles missing binary gracefullyβ
test_connection_timeout- Handles connection timeoutβ
test_server_lifecycle- Full lifecycle (register, connect, disconnect)
Architecture
Technology Stack
Runtime: Node.js 20+
Language: TypeScript 5.0 (strict mode)
Protocol: Model Context Protocol (stdio transport)
Validation: Zod 3.22
Visualization: D3.js 7 (CDN), React 18 (CDN)
Testing: Jest 29.7
Project Structure
Performance
Metric | Target | Actual (Phase 2) | Status |
Server Startup | <2s | 46ms | β 97.7% faster |
Tool Routing | <100ms | 1-2ms | β |
Signal Parsing (1K LOC) | <250ms | 12.5ms | β 20x faster |
Signal Map (Basic, 50 nodes) | <500ms | 180ms | β |
Signal Map (Clustered, 150 nodes) | <1000ms | 400ms | β 2.5x faster |
Clustering (150 nodes) | <750ms | 3ms | β 250x faster |
Dependency Graph (150 nodes) | <800ms | 300ms | β |
Performance Trends (1K samples) | <500ms | 250ms | β |
Cache Lookup | <10ms | <1ms | β |
Development
Build
Testing
Test Results:
β 23/23 tests passing (100% pass rate)
β 85% functional coverage
β <2s test execution time
Code Quality
Configuration
Environment Variables
DEBUG=true- Enable verbose loggingSHRIMP_MCP_PATH=/path/to/shrimp/build/index.js- Custom Shrimp path
Cache Configuration
Default cache settings in src/artifacts/artifact_engine.ts:
Troubleshooting
Issue: "Shrimp MCP not found"
Cause: CTS_Export_to_Shrimp cannot reach Shrimp MCP server
Solution:
Ensure Shrimp MCP server is running
Check Shrimp path configuration
Verify stdio IPC permissions
Issue: Artifact render timeout
Cause: Large dataset (100+ signals) exceeds render budget
Solution:
Filter signals before rendering (use
includeEventBusOnly: true)Increase timeout in VS Code extension
Phase 2 will add graph clustering
Issue: TypeScript compilation errors
Cause: Missing type definitions or syntax errors
Solution:
Documentation
Guides
MCP Server Guide - Complete usage guide with installation, configuration, and all tool documentation
API Reference - Comprehensive API documentation with schemas, types, and examples
Troubleshooting Guide - Common issues and solutions
Infrastructure
CI/CD Pipeline - GitHub Actions workflow, benchmarks, coverage
Packaging Guide - NPM publishing and Docker deployment procedures
Technical Details
Tier 2C Improvements - Production hardening documentation (caching, config, sampling, errors, schemas)
Phase 2 Migration - Upgrade guide from v1.0 to v2.0
VS Code MCP Setup - VS Code integration configuration
WASM Setup - Tree-sitter WASM configuration
Architecture Decision Records
Project Documentation
Test Results - Comprehensive test coverage report
CHANGELOG - Version history and release notes
Contributing
See CONTRIBUTING.md for development guidelines.
License
MIT License - See LICENSE.txt
Changelog
v3.0.0 (October 31, 2025)
Tier 0 & Tier 1 Complete β - Template-First MCP Development
β New Tools: Added 4 tools using template-first design:
CTS_Reasoning (template-driven iteration, 750 LOC)
CTS_Bughunter (search + heuristic scan, 720 LOC)
CTS_Cleanup (filesystem tidy, 740 LOC)
CTS_Audit_Project (compliance checks, 740 LOC)
β Tree-Sitter Fix: Migrated to WASM (
web-tree-sitter)Unblocked 3 tools: scan_project_signals, analyze_project, suggest_refactoring
AST parsing with caching (<50ms per file, <1ms cached)
Headless CI/CD compatible (no native module compilation)
β MCP Tool Templates (Tier 0):
TypeScript template: 460 lines, 5 sections (Zod, MCPError, logging, performance tracking)
Rust template: 483 lines, 5 sections (safe mutex, tracing, async/await)
Template compliance audit: 13 tools scored (avg 64/100, max 90/100)
β Architecture Enhancements:
Signal contracts (Section 10): Cross-MCP data flow schemas
Performance budgets (Section 11): <100ms sync tools, <5s async tools
Integration topology (Section 12): Coordinator pattern documentation
β GDScript Integration: MCPClient for CTS tool calling from Godot
β Breaking Changes:
Requires Node.js 18+ (ESM modules, WASM support)
tree-sitter β web-tree-sitter (native bindings removed)
9 total tools (5 existing + 4 new)
Metrics:
Total Tools: 9 (5 existing + 4 new template-based)
Total LOC: ~4,500 (implementation) + ~1,200 (tests)
Performance: All tools meet <100ms sync / <5s async budgets
CTS Compliance: 100% (all files <500 lines)
Template Compliance: 90% (cts_export_to_shrimp reference implementation)
v1.0.0 (2025-10-30)
Phase CTS_MCP_1 Complete β
β MCP server with stdio transport
β Shrimp integration (CTS_Export_to_Shrimp tool)
β D3.js signal map renderer (force-directed graph)
β React hop dashboard renderer (interactive filtering)
β GDScript parser (signal extraction)
β Artifact caching (SHA-256 + LRU)
β 23 integration tests (100% pass rate)
β 85% functional coverage
Metrics:
Total LOC: 1,097 (implementation) + 450 (tests)
Performance: 97.7% faster than targets
CTS Compliance: 100% (all files <500 lines)
Roadmap
Phase 2 (Planned)
Dependency graph renderer (visualize hop dependencies)
Performance chart renderer (LOC over time)
Graph clustering (100+ signal support)
Tree-sitter GDScript parser (robust signal extraction)
Phase 3 (Future)
Sandpack integration (game visualizers)
Scene preview renderer
Interactive mechanic demos
Maintained by: Development Team
Questions?: See MCP_PROTOCOL.md or open an issue
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Automates Close-to-Shore methodology for Godot game development by creating tasks in Shrimp MCP from hop plans and generating interactive visualizations of signal architectures, dependencies, and project metrics.