Codemagic
MCP-сервер Codemagic
Локальный Python MCP-сервер, который предоставляет REST API Codemagic CI/CD в качестве инструментов, вызываемых Claude. Запускайте сборки, управляйте приложениями, загружайте артефакты и очищайте кэши — всё это из Claude Code или Claude Desktop, не покидая чат.
Инструменты
Приложения
Инструмент | Описание |
| Список всех приложений в вашей учетной записи Codemagic |
| Получить подробную информацию о конкретном приложении |
| Добавить публичный репозиторий в Codemagic |
| Добавить приватный репозиторий с использованием SSH-ключа |
| Удалить приложение из Codemagic |
Сборки
Инструмент | Описание |
| Список сборок, опционально с фильтрацией по приложению |
| Получить подробную информацию о сборке со сводкой по количеству шагов; передайте |
| Запустить новую сборку для приложения |
| Отменить запущенную сборку |
| Получить пошаговую сводку состояния сборки (с возможностью фильтрации по статусу) |
| Получить необработанные логи напрямую или создать/обновить управляемый временный файл для конкретного шага сборки |
| Проверить, существует ли еще управляемый локальный артефакт лога шага для конкретного шага сборки |
| Список всех артефактов, созданных сборкой |
Артефакты
Инструмент | Описание |
| Получить URL для скачивания артефакта сборки |
| Создать временный публичный URL для артефакта |
Кэши
Инструмент | Описание |
| Список всех кэшей сборок для приложения |
| Удалить конкретный кэш сборки |
| Удалить все кэши сборок для приложения |
Переменные окружения
Инструмент | Описание |
| Список всех переменных окружения для приложения |
| Добавить переменную окружения в приложение |
| Обновить существующую переменную окружения |
| Удалить переменную окружения |
Вебхуки
Инструмент | Описание |
| Список всех вебхуков для приложения |
| Добавить вебхук в приложение |
| Удалить вебхук |
⚠️ Эти инструменты помечены как деструктивные и будут запрашивать подтверждение перед выполнением.
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 .Конфигурация
Получите свой API-токен в Codemagic User Settings → Integrations → Codemagic 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=200ID приложения по умолчанию
CODEMAGIC_DEFAULT_APP_ID является необязательным, но рекомендуется, если вы работаете в основном с одним приложением. Если этот параметр задан, ИИ будет использовать его автоматически всякий раз, когда инструменту требуется app_id, а он не был указан. Если он не задан, ИИ:
Вызовет
list_appsдля обнаружения доступных приложений.Автоматически использует приложение, если оно только одно.
Представит список и попросит вас выбрать, если найдено несколько приложений.
Доставка файлов логов шагов
get_step_logs поддерживает два режима доставки:
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Затем установите свой API-ключ в конфигурации MCP env или экспортируйте его в своей оболочке перед запуском 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Добавление новых инструментов
Добавьте метод в
client.pyДобавьте функцию инструмента в соответствующий файл
tools/*.pyЭто всё —
server.pyменять не нужно
Available Tools
25 toolsadd_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_buildADestructive
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_cachesBDestructive
Delete all build caches for a Codemagic application.
Args: app_id: The Codemagic application ID.
Inputs: app_id (required).
delete_appADestructive
Delete an application from Codemagic.
Args: app_id: The Codemagic application ID.
Inputs: app_id (required).
delete_cacheBDestructive
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_variableBDestructive
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_webhookADestructive
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
Scored across 25 tools
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.
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.
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.
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
Related MCP Connectors
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
MCP server exposing Buildkite API data (pipelines, builds, jobs, tests) to AI tooling and editors.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
AlicenseNot gradedqualityFmaintenanceA 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.25MIT- AlicenseAqualityBmaintenanceLocal 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.3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for the Codemagic CI/CD API, enabling app management, build operations, artifact handling, cache control, and team management through natural language.8 npm3MIT
- AlicenseAqualityDmaintenanceA lightweight MCP server that provides seamless access to Codemagic CI/CD APIs, enabling natural language interaction with applications, builds, artifacts, caches, and teams.1616MIT