CodemagicMcp
About
A local Python MCP server that exposes the Codemagic CI/CD REST API as Claude-callable tools.
Details
- Author
- agimaulana
- Categories
- Cloud Service, Infrastructure, Other
Jump to
Option 1 — uvx (recommended, no install needed)
git clone https://github.com/AgiMaulana/CodemagicMcp.git cd CodemagicMcp python3 -m venv .venv .venv/bin/pip install -e .
Get your API token from](#configuration)[Codemagic User Settings → Integrations → Codemagic API.
You can provide settings as environment variables or via a.envfile:
# .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
CODEMAGIC_DEFAULT_APP_IDis optional but recommended if you work primarily with one app. When set, the AI will use it automatically whenever a tool requires anapp_idand none was specified. If it is not set, the AI will:
- Calllist_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.
get_step_logssupports two delivery modes:
- delivery="file"is the default and writes the log to a managed local temp file, returning metadata such asartifact_id,file_path,bytes,line_count, andexpires_at.
- delivery="inline"returns the raw step log text directly.
The local file mode is useful when a step log is too large to comfortably return inline. Managed log files are stored underCODEMAGIC_LOG_TEMP_DIRand expired files are cleaned up opportunistically whenever a new log file is written. The default retention window is controlled byCODEMAGIC_LOG_TTL_SECONDSand defaults to3600seconds.
The server also runs a startup cleanup pass and a periodic background cleanup loop. The loop interval is controlled byCODEMAGIC_LOG_CLEANUP_INTERVAL_SECONDSand defaults to300seconds. As an additional safety backstop, the managed temp directory is capped byCODEMAGIC_LOG_MAX_TOTAL_BYTESandCODEMAGIC_LOG_MAX_FILE_COUNT; when either cap is exceeded, the oldest files are evicted first.
get_step_log_artifact(build_id, step_id)checks whether that managed artifact still exists without calling Codemagic again or returning the file contents. The artifact metadata includes a deterministicartifact_idin this format:
artifact_<build_id>_<step_id>
If the artifact is missing, the server returnsstatus="missing"with reasonnot_generated_or_expired, which means the file was either never generated or it expired and was deleted.
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" } } } }
A local Python MCP server that exposes theCodemagic CI/CD REST APIas Claude-callable tools. Trigger builds, manage apps, download artifacts, and clear caches — all from Claude Code or Claude Desktop without leaving the chat.
⚠️ These tools are marked as destructive and will prompt for confirmation before executing.
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 /tools
That's it. SeeConfigurationfor optional settings likeCODEMAGIC_DEFAULT_APP_ID.
Option 1 — uvx (recommended, no install needed)
git clone https://github.com/AgiMaulana/CodemagicMcp.git cd CodemagicMcp python3 -m venv .venv .venv/bin/pip install -e .
Get your API token fromCodemagic User Settings → Integrations → Codemagic API.
You can provide settings as environment variables or via a.envfile:
# .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
CODEMAGIC_DEFAULT_APP_IDis optional but recommended if you work primarily with one app. When set, the AI will use it automatically whenever a tool requires anapp_idand none was specified. If it is not set, the AI will:
- Calllist_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.
get_step_logssupports two delivery modes:
- delivery="file"is the default and writes the log to a managed local temp file, returning metadata such asartifact_id,file_path,bytes,line_count, andexpires_at.
- delivery="inline"returns the raw step log text directly.
The local file mode is useful when a step log is too large to comfortably return inline. Managed log files are stored underCODEMAGIC_LOG_TEMP_DIRand expired files are cleaned up opportunistically whenever a new log file is written. The default retention window is controlled byCODEMAGIC_LOG_TTL_SECONDSand defaults to3600seconds.
The server also runs a startup cleanup pass and a periodic background cleanup loop. The loop interval is controlled byCODEMAGIC_LOG_CLEANUP_INTERVAL_SECONDSand defaults to300seconds. As an additional safety backstop, the managed temp directory is capped byCODEMAGIC_LOG_MAX_TOTAL_BYTESandCODEMAGIC_LOG_MAX_FILE_COUNT; when either cap is exceeded, the oldest files are evicted first.
get_step_log_artifact(build_id, step_id)checks whether that managed artifact still exists without calling Codemagic again or returning the file contents. The artifact metadata includes a deterministicartifact_idin this format:
artifact_<build_id>_<step_id>
If the artifact is missing, the server returnsstatus="missing"with reasonnot_generated_or_expired, which means the file was either never generated or it expired and was deleted.
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.
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.
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
- Add a method toclient.py
- Add the tool function to the relevanttools/*.pyfile
- That's it —server.pynever needs to change
Manage apps, builds, and artifacts on Bitrise, a Continuous Integration and Delivery (CI/CD) platform.
Create, build, deploy, and manage Netlify resources using natural language.
European cloud hosting. Use your favorite AI coding assistant to easily deploy and manage apps on Ploi Cloud.
Simplifies framework deployments on various hosting environments, with a focus on shared hosting.
Expose the entire ArgoCD API to LLMs via MCP using just 2 auto-generated tools powered by the OpenAPI spec.
Bult.ai MCP Server lets Claude Desktop deploy and manage Bult.ai cloud hosting resources, including projects, services, GitHub and Docker deployments, routes, volumes, templates, logs, and build history.
Integrate with the Coolify API to manage your servers, applications, and databases.
An MCP server for interacting with the Coolify API to manage servers and applications.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




