Skip to main content
Glama

Codemagic MCPサーバー

MCP Registry

Codemagic CI/CD REST APIをClaudeから呼び出し可能なツールとして公開するローカルPython MCPサーバーです。チャットを離れることなく、Claude CodeやClaude Desktopからビルドのトリガー、アプリの管理、アーティファクトのダウンロード、キャッシュのクリアなどが行えます。

Codemagic MCP server

CodemagicMcp MCP server MCP Badge License: MIT

ツール

アプリ (Apps)

ツール

説明

list_apps

Codemagicアカウント内の全アプリケーションを一覧表示

get_app

特定のアプリケーションの詳細を取得

add_app

公開リポジトリをCodemagicに追加

add_private_app

SSHキーを使用してプライベートリポジトリを追加

delete_app ⚠️

Codemagicからアプリケーションを削除

ビルド (Builds)

ツール

説明

list_builds

ビルドを一覧表示(アプリによるフィルタリングが可能)

get_build

ステップ数の概要を含むビルド詳細を取得。include_steps=Trueを渡すと全ステップリストを取得

trigger_build

アプリケーションの新しいビルドをトリガー

cancel_build ⚠️

実行中のビルドをキャンセル

get_build_logs

ビルドのステップごとのステータス概要を取得(ステータスによるフィルタリングが可能)

get_step_logs

特定のビルドステップの生ログをインラインで取得、または管理対象の一時ファイルを作成/更新

get_step_log_artifact

特定のビルドステップの管理対象ローカルステップログアーティファクトがまだ存在するか確認

list_build_artifacts

ビルドによって生成された全アーティファクトを一覧表示

アーティファクト (Artifacts)

ツール

説明

get_artifact_url

ビルドアーティファクトのダウンロードURLを取得

create_artifact_public_url

アーティファクトの期間限定公開URLを作成

キャッシュ (Caches)

ツール

説明

list_caches

アプリケーションの全ビルドキャッシュを一覧表示

delete_cache ⚠️

特定のビルドキャッシュを削除

delete_all_caches ⚠️

アプリケーションの全ビルドキャッシュを削除

環境変数 (Environment Variables)

ツール

説明

list_variables

アプリケーションの全環境変数を一覧表示

add_variable

アプリケーションに環境変数を追加

update_variable

既存の環境変数を更新

delete_variable ⚠️

環境変数を削除

Webhook

ツール

説明

list_webhooks

アプリケーションの全Webhookを一覧表示

add_webhook

アプリケーションにWebhookを追加

delete_webhook ⚠️

Webhookを削除

⚠️ これらのツールは破壊的な操作としてマークされており、実行前に確認を求められます。

Related MCP server: claudecode-mcp

クイックスタート

Claude Codeで実行するための最も速い方法です(個別のインストール手順は不要です)。

# 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 /tools

以上です。CODEMAGIC_DEFAULT_APP_IDなどのオプション設定については設定を参照してください。


インストール

要件: Python 3.11以上

オプション 1 — uvx (推奨、インストール不要)

uvx codemagic-mcp

オプション 2 — pip

pip install codemagic-mcp

オプション 3 — ソースから

git clone https://github.com/AgiMaulana/CodemagicMcp.git
cd CodemagicMcp
python3 -m venv .venv
.venv/bin/pip install -e .

設定

Codemagicユーザー設定 → インテグレーション → Codemagic APIからAPIトークンを取得してください。

設定は環境変数または.envファイルを通じて提供できます。

# .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

# Optional: customize managed temp log storage for get_step_logs(..., delivery="file")
CODEMAGIC_LOG_TEMP_DIR=/tmp/codemagic-mcp
CODEMAGIC_LOG_TTL_SECONDS=3600
CODEMAGIC_LOG_CLEANUP_INTERVAL_SECONDS=300
CODEMAGIC_LOG_MAX_TOTAL_BYTES=524288000
CODEMAGIC_LOG_MAX_FILE_COUNT=200

デフォルトのアプリID

CODEMAGIC_DEFAULT_APP_IDはオプションですが、主に1つのアプリを扱う場合は設定を推奨します。設定されている場合、ツールがapp_idを必要とし、かつ指定されていないときにAIが自動的にそれを使用します。設定されていない場合、AIは以下の動作を行います。

  1. list_appsを呼び出して利用可能なアプリを検出します。

  2. アプリが1つだけ存在する場合は自動的にそれを使用します。

  3. 複数のアプリが見つかった場合はリストを提示し、選択を求めます。

ステップログファイルの配信

get_step_logsは2つの配信モードをサポートしています。

  • delivery="file"(デフォルト): ログを管理対象のローカル一時ファイルに書き込み、artifact_id、file_path、bytes、line_count、expires_atなどのメタデータを返します。

  • delivery="inline": 生のステップログテキストを直接返します。

ローカルファイルモードは、ステップログが大きすぎてインラインで返すのが難しい場合に便利です。管理対象のログファイルはCODEMAGIC_LOG_TEMP_DIR配下に保存され、新しいログファイルが書き込まれるたびに期限切れのファイルが適宜クリーンアップされます。デフォルトの保持期間はCODEMAGIC_LOG_TTL_SECONDSで制御され、デフォルトは3600秒です。

サーバーは起動時のクリーンアップ処理と、定期的なバックグラウンドクリーンアップループも実行します。ループ間隔はCODEMAGIC_LOG_CLEANUP_INTERVAL_SECONDSで制御され、デフォルトは300秒です。追加の安全策として、管理対象の一時ディレクトリはCODEMAGIC_LOG_MAX_TOTAL_BYTESとCODEMAGIC_LOG_MAX_FILE_COUNTによって制限されており、いずれかの制限を超えると古いファイルから順に削除されます。

get_step_log_artifact(build_id, step_id)は、Codemagicを再呼び出ししたりファイル内容を返したりすることなく、その管理対象アーティファクトがまだ存在するかを確認します。アーティファクトのメタデータには、以下の形式の決定論的なartifact_idが含まれます。

artifact_<build_id>_<step_id>

アーティファクトが見つからない場合、サーバーはstatus="missing"と理由not_generated_or_expiredを返します。これは、ファイルが生成されなかったか、期限切れで削除されたことを意味します。

Claude Codeへの登録

以下のコマンドを実行してサーバーを追加します。

claude mcp add codemagic -- codemagic-mcp

次に、MCP環境設定でAPIキーを設定するか、Claude Codeを起動する前にシェルでエクスポートしてください。

export CODEMAGIC_API_KEY=your-api-key-here

または、~/.claude.jsonに手動で追加します。

{
  "mcpServers": {
    "codemagic": {
      "command": "codemagic-mcp",
      "env": {
        "CODEMAGIC_API_KEY": "your-api-key-here",
        "CODEMAGIC_DEFAULT_APP_ID": "your-app-id-here"
      }
    }
  }
}

uvxの使用(事前のインストール不要)

{
  "mcpServers": {
    "codemagic": {
      "command": "uvx",
      "args": ["codemagic-mcp"],
      "env": {
        "CODEMAGIC_API_KEY": "your-api-key-here",
        "CODEMAGIC_DEFAULT_APP_ID": "your-app-id-here"
      }
    }
  }
}

Claude Codeを再起動すると、ツールが/toolsに表示されます。

Claude Desktopへの登録

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) または %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"
      }
    }
  }
}

Claude Desktopを再起動して変更を反映させます。

プロジェクト構造

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

新しいツールの追加

  1. client.pyにメソッドを追加する

  2. 関連するtools/*.pyファイルにツール関数を追加する

  3. 以上です。server.pyを変更する必要はありません。

Available Tools

25 tools
add_appB

Add a new public repository to Codemagic.

Args: repository_url: The HTTPS URL of the public Git repository.

Inputs: repository_url (required).

add_private_appC

Add a new private repository to Codemagic using an SSH key.

Args: repository_url: The SSH URL of the private Git repository. ssh_key_data: Base64-encoded SSH private key. ssh_passphrase: Optional passphrase for the SSH key. project_type: Optional project type (e.g. "flutter-app", "react-native"). team_id: Optional team ID to add the app to.

Inputs: repository_url (required), ssh_key_data (required), ssh_passphrase, project_type, +1 more.

add_variableA

Add an environment variable to a Codemagic application.

Args: app_id: The Codemagic application ID. key: The variable name. value: The variable value. group: The variable group name. secure: Whether the variable should be encrypted (e.g. for secrets/tokens).

Inputs: app_id (required), key (required), value (required), group (required), +1 more.

add_webhookB

Add a webhook to a Codemagic application.

Args: app_id: The Codemagic application ID. url: The URL to send webhook payloads to. events: List of events to subscribe to (e.g. ["build.finished", "build.started"]).

Inputs: app_id (required), url (required), events (required).

cancel_buildA
Destructive

Cancel a running Codemagic build.

Args: build_id: The build ID to cancel.

Inputs: build_id (required).

create_artifact_public_urlB

Create a time-limited public URL for a build artifact.

Args: secure_filename: The secure filename of the artifact (from build results). expires_at: Expiry time as a UNIX timestamp (seconds since epoch).

Inputs: secure_filename (required), expires_at (required).

delete_all_cachesB
Destructive

Delete all build caches for a Codemagic application.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

delete_appA
Destructive

Delete an application from Codemagic.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

delete_cacheB
Destructive

Delete a specific build cache for a Codemagic application.

Args: app_id: The Codemagic application ID. cache_id: The cache ID to delete.

Inputs: app_id (required), cache_id (required).

delete_variableB
Destructive

Delete an environment variable from a Codemagic application.

Args: app_id: The Codemagic application ID. variable_id: The variable ID to delete.

Inputs: app_id (required), variable_id (required).

delete_webhookA
Destructive

Delete a webhook from a Codemagic application.

Args: app_id: The Codemagic application ID. webhook_id: The webhook ID to delete.

Inputs: app_id (required), webhook_id (required).

get_appA

Get details of a specific application by its ID.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

get_artifact_urlA

Get the download URL for a build artifact.

Args: secure_filename: The secure filename of the artifact (from build results).

Inputs: secure_filename (required).

get_buildA

Get details and status of a specific Codemagic build.

Always includes a step summary (total, success, failed, skipped counts). Set include_steps=True to also get the full list of steps with their IDs, which can then be used with get_step_logs.

Args: build_id: The Codemagic build ID. include_steps: If True, include full step list with IDs. Default False.

Inputs: build_id (required), include_steps.

get_build_logsA

Get a step-by-step status summary of a Codemagic build.

Returns each build step with its name, ID, and status (✅ success, ❌ failed, ⏭ skipped).

Args: build_id: The Codemagic build ID. statuses: Optional list of statuses to filter by. Valid values: "success", "failed", "skipped", "canceled". If omitted, all steps are returned.

Inputs: build_id (required), statuses.

get_step_log_artifactA

Check whether a managed step log artifact exists for a build step.

This tool only inspects the local managed artifact created by get_step_logs(..., delivery="file"). It does not fetch from Codemagic, recreate missing files, or return log contents inline.

The returned artifact metadata includes a deterministic artifact_id: artifact_<build_id>_<step_id>

Args: build_id: The Codemagic build ID. step_id: The step ID (from get_build_logs output).

Inputs: build_id (required), step_id (required).

get_step_logsA

Get the raw logs for a specific build step.

Use get_build_logs first to see all step IDs, then call this to drill into a specific step.

Args: build_id: The Codemagic build ID. step_id: The step ID (from get_build_logs output). delivery: Defaults to "file" to create/update a managed temp file and return artifact metadata. Use "inline" to return log text directly.

Inputs: build_id (required), step_id (required), delivery.

list_appsA

List all applications in your Codemagic account.

Inputs: no named parameters.

list_build_artifactsC

List all artifacts produced by a Codemagic build.

Args: build_id: The Codemagic build ID.

Inputs: build_id (required).

list_buildsA

List Codemagic builds, optionally filtered by app, branch, and/or tag.

Args: app_id: Optional app ID to filter builds. If omitted, returns builds across all apps. branch: Optional branch name to filter builds (e.g. "main"). tag: Optional tag name to filter builds (e.g. "release_v5.57.2"). limit: Number of builds per page (default 10). page: Page number to retrieve, starting from 1 (default 1).

Inputs: app_id, branch, tag, limit, +1 more.

list_cachesB

List all build caches for a Codemagic application.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

list_variablesB

List all environment variables for a Codemagic application.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

list_webhooksA

List all webhooks configured for a Codemagic application.

Args: app_id: The Codemagic application ID.

Inputs: app_id (required).

trigger_buildA

Trigger a new build for a Codemagic application.

Args: app_id: The Codemagic application ID. workflow_id: The workflow ID to run. branch: Git branch to build (mutually exclusive with tag). tag: Git tag to build (mutually exclusive with branch). environment: Optional environment variables to override, e.g. {"variables": {"KEY": "value"}}. instance_type: Optional machine instance type to use for the build.

Inputs: app_id (required), workflow_id (required), branch, tag, +2 more.

update_variableA

Update an existing environment variable for a Codemagic application.

Args: app_id: The Codemagic application ID. variable_id: The variable ID to update. key: The variable name. value: The new variable value. group: The variable group name. secure: Whether the variable should be encrypted.

Inputs: app_id (required), variable_id (required), key (required), value (required), +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 25 tools

    Disambiguation5/5

    All tools have clearly distinct purposes, with no overlap. Even similar tools like add_app and add_private_app are distinguished by public vs private repos. Descriptions and parameters further clarify their roles.

    Naming Consistency5/5

    Tool names consistently follow a verb_noun pattern in snake_case. Examples: add_app, get_build, list_apps, delete_variable. No mixing of casing or style.

    Tool Count4/5

    25 tools is on the higher end but appropriate for a full CI/CD API covering apps, builds, artifacts, caches, variables, and webhooks. Each tool serves a distinct purpose without redundancy.

    Completeness4/5

    Covers most core workflows: app management (add, get, delete), build lifecycle (trigger, cancel, get, list, logs), artifact handling, caches, variables, and webhooks. Missing update_app, but that is a minor gap.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      A Python-based MCP server that allows Claude and other LLMs to execute arbitrary Python code directly through your desktop Claude app, enabling data scientists to connect LLMs to APIs and executable code.
      25
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Local MCP server that wraps the headless Claude Code CLI as MCP tools, providing stateless access to Claude's coding capabilities through prompt-based interactions. It enables users to execute Claude Code commands with various prompt formats and structured outputs directly from MCP clients.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the Codemagic CI/CD API, enabling app management, build operations, artifact handling, cache control, and team management through natural language.
      8 npm
      3
      MIT