Labsco
AgiMaulana logo

CodemagicMcp

โ˜… 1

from AgiMaulana

A local Python MCP server that exposes the Codemagic CI/CD REST API as Claude-callable tools.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

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.

Codemagic MCP server

CodemagicMcp MCP server MCP Badge

Tools

Apps

ToolDescription
list_appsList all applications in your Codemagic account
get_appGet details of a specific application
add_appAdd a public repository to Codemagic
add_private_appAdd a private repository using an SSH key
delete_app โš ๏ธDelete an application from Codemagic

Builds

ToolDescription
list_buildsList builds, optionally filtered by app
get_buildGet build details with step count summary; pass include_steps=True for full step list
trigger_buildTrigger a new build for an application
cancel_build โš ๏ธCancel a running build
get_build_logsGet a step-by-step status summary of a build (filterable by status)
get_step_logsGet raw logs inline or create/update a managed temp file for a specific build step
get_step_log_artifactCheck whether a managed local step-log artifact still exists for a specific build step
list_build_artifactsList all artifacts produced by a build

Artifacts

ToolDescription
get_artifact_urlGet the download URL for a build artifact
create_artifact_public_urlCreate a time-limited public URL for an artifact

Caches

ToolDescription
list_cachesList 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

ToolDescription
list_variablesList all environment variables for an application
add_variableAdd an environment variable to an application
update_variableUpdate an existing environment variable
delete_variable โš ๏ธDelete an environment variable

Webhooks

ToolDescription
list_webhooksList all webhooks for an application
add_webhookAdd a webhook to an application
delete_webhook โš ๏ธDelete a webhook

โš ๏ธ These tools are marked as destructive and will prompt for confirmation before executing.

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