A Model Context Protocol (MCP) server for IBM Cloud Code Engine. Enables natural language deployment and management of applications via Claude Desktop or Claude Code.
- Natural language deployment - "Deploy this app to Code Engine on port 8080"
- Build from source - Automatic packaging, building, and deployment
- Complete management - Projects, applications, builds, jobs, secrets
- Secure by design - API keys isolated in Docker container
- 22 MCP tools - Full Code Engine API coverage
- Docker Desktop
- IBM Cloud account with Code Engine access
- IBM Cloud API key (create one)
git clone https://github.com/greyhoundforty/code-engine-mcp
cd code-engine-mcp
docker build -t code-engine-mcp:latest .Create ~/.mcp.env:
IBMCLOUD_API_KEY=your-api-key-hereSecure the file:
chmod 600 ~/.mcp.envAdd to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ibm-code-engine": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--env-file", "/Users/your-username/.mcp.env",
"code-engine-mcp:latest"
]
}
}
}Replace /Users/your-username/.mcp.env with your actual path.
The MCP server will be available for use.
Navigate to your project directory with a Dockerfile:
"Deploy this app to Code Engine on port 8080"
Claude will automatically:
- Package your source code
- Create a build run
- Build the Docker image
- Deploy to Code Engine
- Return the endpoint URL
"Find my Code Engine project named rst-ce-dev"
"List all applications in project dts-account-project"
"Show me details for app myapp"
"Scale myapp to minimum 2 instances"
The MCP server provides 22 tools across 6 categories for complete Code Engine management:
list_projects- List all Code Engine projectsfind_project_by_name- Find project by name with optional resource group filter
list_applications- List applications in a projectget_application- Get application detailscreate_application- Create app from pre-built imageupdate_application- Update app configurationcreate_app_from_source- Deploy from source code (build + deploy)list_app_revisions- List application revisionsget_app_revision- Get revision details
create_build- Create build configurationlist_builds- List build configurationscreate_build_run- Execute a buildget_build_run- Get build run statuslist_build_runs- List build runs
list_jobs- List batch jobsget_job- Get job detailslist_job_runs- List job runsget_job_run- Get job run details
list_domain_mappings- List custom domain mappingsget_domain_mapping- Get domain mapping details
list_secrets- List secrets (data masked)get_secret- Get secret details (data masked)
All tools return formatted summaries and raw JSON for flexibility.
π For detailed documentation of all tools including parameters, examples, and usage patterns, see TOOLS.md
| Variable | Required | Default | Description |
|---|---|---|---|
IBMCLOUD_API_KEY |
Yes | - | IBM Cloud API key |
IBMCLOUD_REGION |
No | us-south |
IBM Cloud region |
LOG_LEVEL |
No | INFO |
Logging level |
us-south(Dallas)us-east(Washington DC)eu-gb(London)eu-de(Frankfurt)jp-tok(Tokyo)au-syd(Sydney)
- API keys loaded via Docker
--env-file(never in command history) - Container runs as non-root user
- Ephemeral containers (
--rmflag) - Secrets automatically masked in responses
- No credential caching
code-engine-mcp/
βββ ce_mcp_server_v3.py # MCP server implementation (22 tools)
βββ ce_push.py # Build-source deployment CLI
βββ utils.py # Code Engine SDK wrapper
βββ Dockerfile # Container definition
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ TOOLS.md # Detailed tool documentation
βββ examples/
βββ simple-flask-app/ # Example Flask application
βββ simple-go-app/ # Example Go application
export IBMCLOUD_API_KEY=your-api-key
python ce_mcp_server_v3.pydocker build -t code-engine-mcp:latest .docker run -i --rm --env-file ~/.mcp.env code-engine-mcp:latestThe server should start and show initialization messages.
"Deploy this Flask app to Code Engine project dts-account-project on port 8080 with minimum 2 instances"
"Show me the status of build run myapp-run-123"
"List all applications in the CDE resource group"
"Update myapp to use 4G memory and 1 CPU"
- Verify Docker is running:
docker ps - Rebuild image:
docker build -t code-engine-mcp:latest . - Restart Claude Desktop
- Check API key in
~/.mcp.env - Verify API key is valid:
ibmcloud iam oauth-tokens - Ensure file has correct permissions:
chmod 600 ~/.mcp.env
- List projects to see exact names:
ibmcloud ce project list - Use exact project name in command
Ensure Docker daemon is running and you have permissions to run Docker commands.
Claude Desktop/Code
β
Natural Language Command
β
MCP Server (Docker)
β
IBM Code Engine API
β
Your Application (deployed)
The MCP server translates natural language into Code Engine API calls, handling authentication, error handling, and response formatting.
For detailed guides and examples, see the project wiki.
MIT License - See LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Ensure all tests pass and code follows existing style.