CAST Imaging MCP Server ExtensionA VS Code extension that provides seamless integration with the CAST Imaging MCP Server. This extension automatically manages Docker containers and creates the necessary MCP configuration for easy access to imaging services. Table of Contents
OverviewThis VS Code extension provides developers with seamless access to CAST Imaging's architectural analysis capabilities directly within VS Code, including:
PrerequisitesRequired
Quick Start
InstallationStep 1: Install the ExtensionInstall from the VS Code Marketplace or install the Auto-generated files:
Step 2: Configure Server Settings (REQUIRED)⚠️ Important: You MUST configure server settings before starting the MCP server. Open VS Code Command Palette (
ConfigurationRequired Settings
Optional Settings
Configuration MethodsAccess configuration through:
Start the MCP ServerAfter configuration, start the server:
Server startup process:
Available CommandsAccess these commands via Command Palette ( Primary Commands
Management Commands
Server ManagementStatus Bar IndicatorThe extension displays server status in the VS Code status bar:
Interaction: Click the status bar item to check detailed status. Sidebar PanelFind the "CAST Imaging MCP Server" panel in the Explorer sidebar for quick access to:
Generated FilesThe extension automatically creates these files in your workspace:
|
| Feature | Normal Mode | Debug Mode |
|---|---|---|
| Log Level | Info (Standard) | Debug (Detailed) |
| Log Location | Container logs only | Unified logs/ directory |
| Performance | Optimized | Detailed diagnostics |
| Log Aggregation | Basic | FastMCP + Custom logs |
| Recommended Use | Production | Development/Troubleshooting |
Configuration in app.config
When Debug Mode is enabled, the following is added to the server configuration:
DEBUG_MODE=true
This setting activates the enhanced logging system with centralized log file creation and configurable log levels within the MCP server container.
Control Panel SSL Configuration
When Control Panel SSL Enabled is configured, the following is added to the server configuration:
CONTROL_PANEL_SSL_ENABLED=true
This setting enables SSL/HTTPS when connecting to the CAST Imaging Control Panel. Enable this when your Control Panel is configured to use HTTPS connections.
Note: This SSL setting is for connections from the MCP server to your Control Panel, not for clients connecting to the MCP server. The MCP server itself runs on HTTP.
Usage Example
Typical Workflow
# 1. Install Extension (via VS Code Marketplace)
# 2. Configure Server Settings
Command Palette → "CAST Imaging MCP: Configure MCP Server"
→ Host Control Panel: "your-control-panel-host"
→ Port Control Panel: "8098"
→ Control Panel SSL Enabled: "false" (or "true" if Control Panel uses HTTPS)
# 3. Optional: Enable Debug Mode (for troubleshooting)
Command Palette → "CAST Imaging MCP: Configure MCP Server"
→ Debug Mode → "Enable Debug Mode"
# 4. Optional: Enable Control Panel SSL (if Control Panel uses HTTPS)
Command Palette → "CAST Imaging MCP: Configure MCP Server"
→ Control Panel SSL Enabled → "Enable Control Panel SSL"
# 5. Start Server
Command Palette → "CAST Imaging MCP: Start MCP Server"
→ Wait for green status indicator
# 6. Use MCP Features
→ VS Code prompts for API key on first connection
→ Enter your Imaging API key
→ Access imaging services through MCP
# 7. Mode Switching
→ Stop server → Change Debug/Control Panel SSL settings → Start server
API Key Setup
Generate API Key:
- Log into CAST Imaging instance
- Navigate to profile section
- Generate new API key
- Save securely
Enter in VS Code:
- First MCP feature use triggers prompt
- Enter saved API key
- Key is managed by VS Code's MCP client
Troubleshooting
Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Docker not found | Docker not installed/running | Install Docker Desktop, ensure it's running |
| Server won't start | Incorrect Control Panel settings | Run Configure MCP Server, verify settings |
| Port already in use | Port conflict | Change Server Port in settings |
| Containers won't stop | Docker container issues | Use Force Cleanup Containers or restart Docker |
| API Key prompt missing | Missing MCP configuration | Check .vscode/mcp.json exists, reload VS Code |
| Configuration outdated | Stale configuration | Use Reinstall MCP Server |
| Server logs insufficient | Debug mode disabled | Enable Debug Mode for enhanced logging |
| Performance issues | Debug mode enabled in production | Disable Debug Mode for optimal performance |
Debugging Steps
Enable Debug Mode for detailed diagnostics:
Command Palette → CAST Imaging MCP: Configure MCP Server → Debug Mode → Enable Debug Mode Command Palette → CAST Imaging MCP: Restart MCP ServerCheck server status:
Command Palette → CAST Imaging MCP: Check Server StatusView detailed logs:
Command Palette → CAST Imaging MCP: View Server LogsVerify Docker containers:
docker compose psTest Control Panel connectivity:
curl -H "x-api-key: <your-key>" http://{Control_Panel_Host}:8090/imaging/apis/rest/readyNuclear cleanup for persistent issues:
Command Palette → CAST Imaging MCP: Force Cleanup Containers Command Palette → CAST Imaging MCP: Reinstall MCP Server
Getting Help
Troubleshooting escalation:
- Enable Debug Mode for enhanced logging
- View server logs for detailed error information
- Check server status for container health
- Verify Docker installation and network connectivity
- Use force cleanup for persistent container issues
- Use reinstall for persistent configuration issues
- Restart VS Code for extension-related issues
Technical Details
Architecture Overview
VS Code MCP Client
↓ (HTTP + API Key Authentication)
Docker Container (MCP Server)
↓ (HTTP/HTTPS based on Control Panel SSL setting)
CAST Imaging Control Panel Service
Container Architecture
The extension uses a single Docker container running the MCP server:
- MCP Server Container: Provides HTTP endpoint for MCP client connections
- Control Panel Connection: Configurable HTTP or HTTPS connection to external Control Panel
File System Organization
| Component | Location | Description |
|---|---|---|
| Server Installation | VS Code global storage | Per-machine installation |
| MCP Configuration | .vscode/mcp.json |
Per-workspace configuration |
| Copilot Instructions | .github/copilot-instructions.md |
Per-workspace instructions |
| Docker Files | Installation directory | Auto-generated configurations |
| Server Logs | Installation directory/logs | Debug mode log files |
Security Considerations
- API Key Management: Handled by VS Code's built-in MCP client
- Container Isolation: Docker provides process and network isolation
- Configuration Separation: Per-workspace settings prevent cross-contamination
- Control Panel SSL: Optional SSL/TLS encryption for Control Panel connections
Ready to enhance your development workflow with CAST Imaging architectural insights!