Imaging MCP Server Extension
A VS Code extension that provides seamless integration with the Imaging MCP Server. This extension automatically manages Docker containers and creates the necessary MCP configuration for easy access to imaging services.
🚀 Quick Start
Prerequisites
- Docker Desktop must be installed and running
- VS Code version 1.74.0 or higher
Step-by-Step Setup
1. Install the Extension
- Install from VS Code Marketplace or install the
.vsix
file
- The extension will automatically create:
.vscode/mcp.json
file in your workspace
.github/copilot-instructions.md
file for GitHub Copilot integration
⚠️ Important: You MUST configure the server settings before starting the MCP server.
Open VS Code Command Palette (Ctrl+Shift+P
or Cmd+Shift+P
) and run:
Imaging MCP: Configure MCP Server
Required Configuration:
- Eureka Host: The hostname/IP where your Eureka service is running
- Eureka Port: The port number for your Eureka service
Optional Configuration:
- Server Port: Port for the MCP server (default: 8282)
- HTTPS Enabled: Enable HTTPS with nginx SSL proxy (default: false)
- Auto Start: Start server automatically when VS Code opens (default: false)
3. Start the MCP Server
After configuring the settings, start the server:
Imaging MCP: Start MCP Server
The extension will:
- Pull necessary Docker images
- Create and start containers
- Display server status in the status bar
4. Use the MCP Server
- The extension automatically creates
.vscode/mcp.json
in your workspace
- The extension also creates
.github/copilot-instructions.md
for enhanced GitHub Copilot integration
- When you first use MCP features in VS Code, it will prompt for your Imaging API Key
- Enter your API key to start using the imaging services
📋 Available Commands
Access these commands via Command Palette (Ctrl+Shift+P
):
Command |
Description |
Imaging MCP: Configure MCP Server |
Configure server settings (Run this first!) |
Imaging MCP: Install MCP Server |
Install Docker containers and dependencies |
Imaging MCP: Start MCP Server |
Start the MCP server containers |
Imaging MCP: Stop MCP Server |
Stop the MCP server containers (cleans up both HTTP and HTTPS) |
Imaging MCP: Restart MCP Server |
Restart the MCP server containers |
Imaging MCP: Reinstall MCP Server |
Clean reinstall of server components |
Imaging MCP: Force Cleanup Containers |
Forcibly remove all containers (use if containers are stuck) |
Imaging MCP: View Server Logs |
Display server logs in output panel |
Imaging MCP: Check Server Status |
Show current server status |
🎛️ Configuration Options
Configure these settings through:
- Command Palette →
Imaging MCP: Configure MCP Server
- VS Code Settings → Search for "Imaging MCP"
Settings Details
Setting |
Description |
Default |
Required |
Eureka Host |
Hostname/IP of Eureka service |
localhost |
✅ Yes |
Eureka Port |
Port number for Eureka service |
8098 |
✅ Yes |
Server Port |
Port for MCP server |
8282 |
No |
HTTPS Enabled |
Enable HTTPS with nginx proxy |
false |
No |
Auto Start |
Auto-start server on VS Code startup |
false |
No |
🔧 Server Management
Status Bar Indicator
The extension shows server status in the VS Code status bar:
- 🟢 Green Circle: Server is running
- 🔴 Red Circle: Server is stopped
- 🟡 Yellow Spinner: Starting/stopping
- ❌ Red X: Error state
Click the status bar item to check detailed status.
Find the "Imaging MCP Server" panel in the Explorer sidebar for quick access to:
- Server status
- Action buttons (Start/Stop/Restart)
- Configuration overview
- Log viewing
📁 Generated Files
The extension automatically creates these files in your workspace:
.vscode/mcp.json
{
"inputs": [
{
"id": "imaging-key",
"type": "promptString",
"description": "Imaging API Key"
}
],
"servers": {
"imaging": {
"type": "http",
"url": "http://your-eureka-host:8282/mcp/",
"headers": {
"imaging_api_key": "${input:imaging-key}"
}
}
}
}
This file configures VS Code to connect to your MCP server with API key authentication. The URL automatically updates based on your HTTP/HTTPS setting.
.github/copilot-instructions.md
The extension also creates GitHub Copilot instructions that provide context about using Imaging tools. This file helps GitHub Copilot understand your project structure and provides guidance on:
- Impact analysis workflows
- Exploration of application architecture
- Recommended tools for different scenarios
- Code modification best practices
The instructions are automatically applied to all files in your workspace (applyTo: '**'
).
🔐 HTTPS Configuration
Setting Up HTTPS
- Set HTTPS Enabled to
true
in extension settings
- Extension creates a
.vscode/certificates
folder in your workspace
- Place your SSL certificates in this folder:
certificate.pem
- Your SSL certificate
private_key.pem
- Your private key
- Restart the server
Certificate folder structure:
your-workspace/
├── .vscode/
│ ├── mcp.json
│ └── certificates/
│ ├── certificate.pem
│ └── private_key.pem
└── ...
HTTPS Architecture
When HTTPS is enabled, the extension uses nginx as an SSL proxy:
Client Request (HTTPS:8443)
↓
nginx (SSL Termination)
↓
mcp-server:8282 (Main HTTP Backend)
mcp-server:8283 (Health Check Backend)
nginx automatically handles:
- SSL/TLS termination
- Security headers
- Gzip compression
- Load balancing between main and health endpoints
- WebSocket upgrades
- Request buffering and timeouts
🔄 Switching Between HTTP and HTTPS
Switching from HTTP to HTTPS
Stop the server if it's running:
Imaging MCP: Stop MCP Server
Enable HTTPS in settings:
Command Palette → "Imaging MCP: Configure MCP Server" → "HTTPS Enabled" → "Enable HTTPS"
Add SSL certificates to your workspace:
- Extension will create
.vscode/certificates/
folder
- Add your certificate files:
certificate.pem
- Your SSL certificate
private_key.pem
- Your private key
Start the server:
Imaging MCP: Start MCP Server
Server will now run on HTTPS with nginx proxy handling SSL termination
Switching from HTTPS to HTTP
Stop the server if it's running:
Imaging MCP: Stop MCP Server
Disable HTTPS in settings:
Command Palette → "Imaging MCP: Configure MCP Server" → "HTTPS Enabled" → "Disable HTTPS"
Start the server:
Imaging MCP: Start MCP Server
Server will now run on HTTP directly without nginx proxy
Important Notes for Switching
- MCP Configuration Updates Automatically: The extension updates
.vscode/mcp.json
with the correct URL when you switch modes
- No Container Reinstall Needed: The extension uses different Docker Compose configurations automatically
- Certificates Remain: Your certificates in
.vscode/certificates/
are preserved when switching to HTTP
Troubleshooting Mode Switching
If you encounter port conflicts or containers that won't stop properly when switching modes:
Use Force Cleanup:
Command Palette → "Imaging MCP: Force Cleanup Containers"
This will:
- Stop all MCP-related containers
- Remove stuck containers and networks
- Free up all ports
- Allow clean restart in any mode
🚨 Troubleshooting
Common Issues
"Docker not found" Error
- Solution: Install Docker Desktop and ensure it's running
- Test: Run
docker --version
in terminal
"Server won't start" Error
- Solution: Check that Eureka Host and Port are correctly configured
- Test: Run
Imaging MCP: Configure MCP Server
and verify settings
"Port already in use" Error
- Solution: Change the Server Port in extension settings
- Test: Use
netstat -an | grep :8282
to check port usage
"SSL Certificate not found" Error (HTTPS mode)
- Solution: Verify certificates exist in
.vscode/certificates/
folder
- Required files:
certificate.pem
and private_key.pem
- Fix: Extension will offer to create the certificates folder
"nginx container fails to start" Error
- Solution: Use
Imaging MCP: Reinstall MCP Server
to recreate nginx configuration
- Check: Ensure certificates have proper file permissions
"Port already in use" Error when switching modes
- Solution: Use
Imaging MCP: Force Cleanup Containers
to remove stuck containers
- Cause: Previous mode containers didn't shut down properly
- Prevention: Always use the extension's stop command rather than manual Docker commands
"Containers won't stop" Error
- Solution: Use
Imaging MCP: Force Cleanup Containers
for nuclear cleanup
- Alternative: Restart Docker Desktop if containers are completely stuck
"API Key prompt not appearing"
- Solution: Check that
.vscode/mcp.json
exists in your workspace
- Fix: Reload VS Code or reinstall the extension
"Server configuration outdated" after switching HTTP/HTTPS
- Solution: Use
Imaging MCP: Reinstall MCP Server
to refresh all configurations
- Alternative: Restart VS Code to reload extension
Getting Help
- View Logs: Use
Imaging MCP: View Server Logs
for detailed error information
- Check Status: Use
Imaging MCP: Check Server Status
to see container status
- Verify Docker: Run
docker compose ps
in the server installation directory
- Force Cleanup: Use
Imaging MCP: Force Cleanup Containers
for persistent container issues
- Reinstall: Use
Imaging MCP: Reinstall MCP Server
for persistent configuration issues
📊 Usage Example
Here's a typical workflow:
# 1. Install Extension (done through VS Code)
# 2. Configure Settings
Command Palette → "Imaging MCP: Configure MCP Server"
→ Set Eureka Host: "my-eureka-server.com"
→ Set Eureka Port: "8098"
# 3. Optional: Enable HTTPS
Command Palette → "Imaging MCP: Configure MCP Server"
→ HTTPS Enabled → "Enable HTTPS"
→ Add certificates to .vscode/certificates/
# 4. Start Server
Command Palette → "Imaging MCP: Start MCP Server"
→ Wait for green status indicator
# 5. Use MCP Features
→ VS Code will prompt for API key when first connecting
→ Enter your Imaging API key
→ Start using imaging services!
# 6. Switch modes anytime
→ Stop server → Change HTTPS setting → Start server
⚙️ Technical Details
Architecture
VS Code MCP Client
↓ (HTTP/HTTPS + API Key)
nginx (HTTPS mode only)
↓
Docker Container (MCP Server)
↓
Eureka Service (Your Backend)
Docker Containers
- HTTP Mode: Single MCP server container
- HTTPS Mode: MCP server + nginx proxy containers
File Locations
- Server Installation: VS Code global storage directory
- MCP Configuration:
.vscode/mcp.json
in your workspace
- Copilot Instructions:
.github/copilot-instructions.md
in your workspace
- SSL Certificates:
.vscode/certificates/
in your workspace
- Docker Files: Auto-generated in installation directory
📝 Notes
- The extension creates boilerplate configurations automatically
- Server settings can be changed anytime through the configuration command
- The server installation is per-machine, but MCP configuration is per-workspace
- API key is handled by VS Code's built-in MCP client, not stored by the extension
- Switching between HTTP and HTTPS is seamless and doesn't require reinstallation
- SSL certificates are workspace-specific and portable
🆘 Support
If you encounter issues:
- Check the troubleshooting section above
- Review server logs using the extension commands
- Verify Docker and network connectivity
- Ensure Eureka service is accessible from your machine
- Use the reinstall command for persistent configuration issues