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
Optional
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.
Switching Between HTTP and HTTPS
HTTP to HTTPS Migration
Stop the server:
CAST Imaging MCP: Stop MCP Server
Enable HTTPS:
Command Palette → CAST Imaging MCP: Configure MCP Server → HTTPS Enabled → Enable HTTPS
Add SSL certificates:
- Extension creates
.vscode/certificates/
folder - Place certificate files:
certificate.pem
private_key.pem
- Extension creates
Start server:
CAST Imaging MCP: Start MCP Server
HTTPS to HTTP Migration
Stop the server:
CAST Imaging MCP: Stop MCP Server
Disable HTTPS:
Command Palette → CAST Imaging MCP: Configure MCP Server → HTTPS Enabled → Disable HTTPS
Start server:
CAST Imaging MCP: Start MCP Server
Migration Notes
✅ Automatic updates:
- MCP configuration updates automatically
- No container reinstall required
- Different Docker Compose configurations used seamlessly
- SSL certificates preserved when switching to HTTP
⚠️ Troubleshooting switching issues: If you encounter port conflicts or stuck containers:
Command Palette → CAST Imaging MCP: Force Cleanup Containers
This command will:
- Stop all MCP-related containers
- Remove stuck containers and networks
- Free up all ports
- Enable clean restart in any mode
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"
# 3. Optional: Enable HTTPS
Command Palette → "CAST Imaging MCP: Configure MCP Server"
→ HTTPS Enabled → "Enable HTTPS"
→ Add certificates to .vscode/certificates/
# 4. Optional: Enable Debug Mode (for troubleshooting)
Command Palette → "CAST Imaging MCP: Configure MCP Server"
→ Debug Mode → "Enable Debug Mode"
# 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 HTTPS/Debug 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 |
SSL Certificate not found | Missing certificates (HTTPS mode) | Add certificates to .vscode/certificates/ |
nginx container fails | nginx configuration issues | Use Reinstall MCP Server |
Port conflicts when switching | Stuck containers from previous mode | Use Force Cleanup Containers |
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 config after HTTP/HTTPS switch | 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 Server
Check server status:
Command Palette → CAST Imaging MCP: Check Server Status
View detailed logs:
Command Palette → CAST Imaging MCP: View Server Logs
Verify Docker containers:
docker compose ps
Test Control Panel connectivity:
curl -H "x-api-key: <your-key>" http://{Control_Panel_Host}:8090/imaging/apis/rest/ready
Nuclear 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/HTTPS + API Key Authentication)
nginx Proxy (HTTPS mode only)
↓
Docker Container (MCP Server)
↓
CAST Imaging Control Panel Service
Container Architecture
Mode | Containers | Description |
---|---|---|
HTTP Mode | Single MCP server container | Direct HTTP connection |
HTTPS Mode | MCP server + nginx proxy | SSL termination via nginx |
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 |
SSL Certificates | .vscode/certificates/ |
Per-workspace certificates |
Docker Files | Installation directory | Auto-generated configurations |
Security Considerations
- API Key Management: Handled by VS Code's built-in MCP client
- SSL Certificate Storage: Workspace-specific and portable
- Container Isolation: Docker provides process and network isolation
- Configuration Separation: Per-workspace settings prevent cross-contamination
Ready to enhance your development workflow with CAST Imaging architectural insights!