Skip to main content

Codemagic CI/CD MCP Server — manage builds, apps, artifacts, and caches from your AI

Project description

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_apps List all applications in your Codemagic account
get_app Get details of a specific application
add_app Add a public repository to Codemagic
add_private_app Add a private repository using an SSH key
delete_app ⚠️ Delete an application from Codemagic

Builds

Tool Description
list_builds List builds, optionally filtered by app
get_build Get build details with step count summary; pass include_steps=True for full step list
trigger_build Trigger a new build for an application
cancel_build ⚠️ Cancel a running build
get_build_logs Get a step-by-step status summary of a build (filterable by status)
get_step_logs Get raw logs for a specific build step by step ID
list_build_artifacts List all artifacts produced by a build

Artifacts

Tool Description
get_artifact_url Get the download URL for a build artifact
create_artifact_public_url Create a time-limited public URL for an artifact

Caches

Tool Description
list_caches List all build caches for an application
delete_cache ⚠️ Delete a specific build cache
delete_all_caches ⚠️ Delete all build caches for an application

Environment Variables

Tool Description
list_variables List all environment variables for an application
add_variable Add an environment variable to an application
update_variable Update an existing environment variable
delete_variable ⚠️ Delete an environment variable

Webhooks

Tool Description
list_webhooks List all webhooks for an application
add_webhook Add a webhook to an application
delete_webhook ⚠️ Delete a webhook

⚠️ These tools are marked as destructive and will prompt for confirmation before executing.

Installation

Requirements: Python 3.11+

Option 1 — pip (recommended)

pip install codemagic-mcp

Option 2 — uvx (no install needed)

uvx codemagic-mcp

Option 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-here

Default 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:

  1. Call list_apps to discover available apps.
  2. Use the app automatically if only one exists.
  3. 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-mcp

Then 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-here

Alternatively, 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.py

Adding New Tools

  1. Add a method to client.py
  2. Add the tool function to the relevant tools/*.py file
  3. That's it — server.py never needs to change

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codemagicmcp-0.6.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codemagicmcp-0.6.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file codemagicmcp-0.6.2.tar.gz.

File metadata

  • Download URL: codemagicmcp-0.6.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codemagicmcp-0.6.2.tar.gz
Algorithm Hash digest
SHA256 a2e63bb062ae426679b9a0c03d99932be3122420abc7b06ac484e861fc64fec9
MD5 01fd7a689fa68b4d6f6dc4a822b32f14
BLAKE2b-256 9b0ddb3b7c07bef76dde7a94a014b041a8460d8562b2c131760424060ec89a36

See more details on using hashes here.

File details

Details for the file codemagicmcp-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: codemagicmcp-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codemagicmcp-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aeef203d2dbfac5c137f0a04f09e4e178abae7e7a7905cd112529e3f1d4d7170
MD5 8c22035cddbd63de2bffb0087a2eb4e9
BLAKE2b-256 d9a37ac4a52f8a952e1ec674cc86db3f134e36d2150e659daec3818f207ceb49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page