Skip to content

Add MCP (Model Context Protocol) integration to Wheels CLI#1735

Merged
bpamiri merged 2 commits intodevelopfrom
mcp_investigations
Sep 15, 2025
Merged

Add MCP (Model Context Protocol) integration to Wheels CLI#1735
bpamiri merged 2 commits intodevelopfrom
mcp_investigations

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Sep 14, 2025

Summary

This PR implements comprehensive MCP (Model Context Protocol) support for AI-powered development tools through new CLI commands. MCP enables AI assistants like Claude Code, Cursor, and Continue to better understand and work with Wheels projects.

New CLI Commands

  • wheels mcp setup - Installs and configures MCP server with automatic port detection
  • wheels mcp status - Shows current MCP installation and configuration status
  • wheels mcp test - Validates MCP setup and connection
  • wheels mcp update - Updates MCP server to latest version
  • wheels mcp remove - Cleanly removes MCP integration

Key Features

  • Dynamic port detection from server.json, .env, or running server
  • Multi-IDE support for Claude Code, Cursor, Continue, and Windsurf
  • Smart template system using app/snippets folder following Wheels conventions
  • Automatic npm dependency management with @modelcontextprotocol/sdk
  • Comprehensive error handling with helpful user feedback

Technical Details

Files Added

  • cli/src/models/MCPService.cfc - Core service for MCP management
  • cli/src/commands/wheels/mcp/setup.cfc - Setup command
  • cli/src/commands/wheels/mcp/status.cfc - Status command
  • cli/src/commands/wheels/mcp/test.cfc - Test command
  • cli/src/commands/wheels/mcp/update.cfc - Update command
  • cli/src/commands/wheels/mcp/remove.cfc - Remove command
  • templates/base/src/app/snippets/mcp-server.js.txt - MCP server template

Architecture Decisions

  • MCP server template lives in app/snippets following Wheels generator conventions
  • Template distributed with base application template for consistency
  • CLI reads from snippets folder like other generators
  • Uses {{PORT}} placeholder for dynamic port configuration
  • Integrated with WireBox dependency injection

Testing

Tested with Docker test environment on port 60006 at templates/base/src:

  • ✅ Setup command successfully installs MCP server
  • ✅ Port detection works correctly
  • ✅ Dependencies install via npm
  • ✅ Status command shows correct configuration
  • ✅ Test command validates setup
  • ✅ Update command refreshes server file
  • ✅ Remove command cleanly uninstalls

Impact

This integration enables AI assistants to:

  • Access real-time project structure and configuration
  • Generate models, controllers, and migrations using Wheels conventions
  • Execute tests and server commands directly
  • Understand routes and database schema
  • Provide more accurate and context-aware assistance

Breaking Changes

None - this is a new feature that doesn't affect existing functionality.

Add retry mechanism for CFPM package installation in GitHub Actions workflow.
The cfpm install command occasionally fails with exit code 1, particularly
for the SQL Server package on Adobe ColdFusion 2023.

Changes:
- Add 3 retry attempts for cfpm package installation
- Wait 10 seconds between retries
- Attempt to restart ColdFusion service before retrying
- Add better logging to track installation attempts

This should resolve the transient failures seen in the CI pipeline.
@bpamiri bpamiri merged commit 81f2b28 into develop Sep 15, 2025
31 checks passed
@bpamiri bpamiri deleted the mcp_investigations branch September 15, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant