The Codemagic MCP Server exposes the Codemagic CI/CD REST API as callable tools, allowing you to manage your entire Codemagic workflow directly from Claude.
App Management
List all applications, get details for a specific app
Add public repositories (HTTPS URL) or private repositories (SSH keys, with optional passphrase, project type, and team ID)
Delete applications ⚠️
Build Operations
List builds filtered by app, branch, or tag (with pagination)
Get build details including step count summary or full step list
Trigger new builds with a specific workflow, branch/tag, environment variables, and instance type
Cancel running builds ⚠️
Get build logs as a step-by-step status summary (filterable by status) or raw logs for a specific build step
List all artifacts produced by a build
Artifact Handling
Get direct download URLs for build artifacts
Create time-limited public URLs for sharing artifacts
Cache Control
List all build caches for an application
Delete a specific cache or all caches for an application ⚠️
Environment Variables
List, add (with support for secure/encrypted values and groups), update, and delete environment variables ⚠️
Webhook Configuration
List, add (with custom URLs and event subscriptions such as
build.finished,build.started), and delete webhooks ⚠️
⚠️ Destructive operations (delete/cancel) are explicitly marked and prompt for confirmation before executing.
Exposes the Codemagic CI/CD REST API as tools to manage applications, trigger and monitor builds, handle artifacts, manage environment variables, and configure webhooks.
Codemagic MCP Server
A local Python MCP server that exposes the Codemagic CI/CD REST API as Claude-callable tools. Trigger builds, manage apps, download artifacts, and clear caches — all from Claude Code or Claude Desktop without leaving the chat.
Tools
Apps
Tool | Description |
| List all applications in your Codemagic account |
| Get details of a specific application |
| Add a public repository to Codemagic |
| Add a private repository using an SSH key |
| Delete an application from Codemagic |
Builds
Tool | Description |
| List builds, optionally filtered by app |
| Get build details with step count summary; pass |
| Trigger a new build for an application |
| Cancel a running build |
| Get a step-by-step status summary of a build (filterable by status) |
| Get raw logs for a specific build step by step ID |
| List all artifacts produced by a build |
Artifacts
Tool | Description |
| Get the download URL for a build artifact |
| Create a time-limited public URL for an artifact |
Caches
Tool | Description |
| List all build caches for an application |
| Delete a specific build cache |
| Delete all build caches for an application |
Environment Variables
Tool | Description |
| List all environment variables for an application |
| Add an environment variable to an application |
| Update an existing environment variable |
| Delete an environment variable |
Webhooks
Tool | Description |
| List all webhooks for an application |
| Add a webhook to an application |
| Delete a webhook |
⚠️ These tools are marked as destructive and will prompt for confirmation before executing.
Quick Start
The fastest way to get running with Claude Code — no separate install step needed:
# 1. Add the server (uses uvx to run it on-demand)
claude mcp add codemagic -e CODEMAGIC_API_KEY=your-api-key-here -- uvx codemagic-mcp
# 2. Restart Claude Code — tools will appear in /toolsThat's it. See Configuration for optional settings like CODEMAGIC_DEFAULT_APP_ID.
Installation
Requirements: Python 3.11+
Option 1 — uvx (recommended, no install needed)
uvx codemagic-mcpOption 2 — pip
pip install codemagic-mcpOption 3 — from source
git clone https://github.com/AgiMaulana/CodemagicMcp.git
cd CodemagicMcp
python3 -m venv .venv
.venv/bin/pip install -e .Configuration
Get your API token from Codemagic User Settings → Integrations → Codemagic API.
You can provide settings as environment variables or via a .env file:
# .env
CODEMAGIC_API_KEY=your-api-key-here
# Optional: set a default app so you don't have to specify it every time
CODEMAGIC_DEFAULT_APP_ID=your-app-id-hereDefault App ID
CODEMAGIC_DEFAULT_APP_ID is optional but recommended if you work primarily with one app. When set, the AI will use it automatically whenever a tool requires an app_id and none was specified. If it is not set, the AI will:
Call
list_appsto discover available apps.Use the app automatically if only one exists.
Present the list and ask you to choose if multiple apps are found.
Register with Claude Code
Run the following command to add the server:
claude mcp add codemagic -- codemagic-mcpThen set your API key in the MCP env config, or export it in your shell before starting Claude Code:
export CODEMAGIC_API_KEY=your-api-key-hereAlternatively, add it manually to ~/.claude.json:
{
"mcpServers": {
"codemagic": {
"command": "codemagic-mcp",
"env": {
"CODEMAGIC_API_KEY": "your-api-key-here",
"CODEMAGIC_DEFAULT_APP_ID": "your-app-id-here"
}
}
}
}Using uvx (no prior installation needed)
{
"mcpServers": {
"codemagic": {
"command": "uvx",
"args": ["codemagic-mcp"],
"env": {
"CODEMAGIC_API_KEY": "your-api-key-here",
"CODEMAGIC_DEFAULT_APP_ID": "your-app-id-here"
}
}
}
}Restart Claude Code — the tools will appear in /tools.
Register with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"codemagic": {
"command": "codemagic-mcp",
"env": {
"CODEMAGIC_API_KEY": "your-api-key-here",
"CODEMAGIC_DEFAULT_APP_ID": "your-app-id-here"
}
}
}
}Restart Claude Desktop to pick up the changes.
Project Structure
codemagic_mcp/
├── config.py # pydantic-settings config (validates API key at startup)
├── client.py # httpx async client, one method per endpoint
├── server.py # FastMCP instance
└── tools/
├── apps.py
├── builds.py
├── artifacts.py
├── caches.py
├── variables.py
└── webhooks.pyAdding New Tools
Add a method to
client.pyAdd the tool function to the relevant
tools/*.pyfileThat's it —
server.pynever needs to change