# Codemagic MCP

> Codemagic MCP lets you manage your entire mobile CI/CD pipeline using simple language commands through your AI agent. Don't open the dashboard; just ask it to build, check artifacts, or update environment variables. It handles complex app builds, allowing developers and release managers to maintain continuous integration without leaving their code editor.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** mobile-cicd, build-automation, ios-android-builds, artifact-management, continuous-integration

## Description

Managing a multi-app mobile build pipeline usually means jumping between dashboards, digging through menus, and copying cryptic URLs. This MCP lets you handle the entire process using natural language commands in your preferred AI client. You can tell your agent exactly what needs to happen—whether it's kicking off a specific app build from a certain branch, or retrieving an authenticated download link for the final artifact. It’s about controlling complex infrastructure tasks without ever touching a web UI. By connecting this MCP through Vinkius, you bring powerful build orchestration directly into your chat window. You can even programmatically update secure environment variables when new keys come out, keeping your whole CI/CD setup fresh and accurate.

## Tools

### add_variables_to_group
Adds new variables or secrets to your existing build variable group.

### cancel_build
Stops a running Codemagic mobile app build immediately.

### create_public_artifact_url
Creates a temporary, public download URL for an artifact that expires after a set time.

### get_artifact
Retrieves the secure, authenticated download URL for a specific build artifact within your system.

### start_build
Starts a new Codemagic mobile app build, allowing you to override branch or workflow settings.

## Prompt Examples

**Prompt:** 
```
Start a new build for app '642a1b2c3d4e5f' using the 'release-workflow' on the 'main' branch.
```

**Response:** 
```
I've triggered the build for you. The build process has started for the 'main' branch using the specified workflow. You can track its progress in your Codemagic dashboard.
```

**Prompt:** 
```
Generate a public download link for the artifact at 'build/outputs/app-release.ipa' that expires in 24 hours.
```

**Response:** 
```
I've generated a temporary public URL for your artifact. It will be valid for the next 24 hours: [URL].
```

**Prompt:** 
```
Add a secure variable 'API_KEY' with value 'secret123' to the variable group 'prod-secrets'.
```

**Response:** 
```
The secure variable 'API_KEY' has been successfully added to the 'prod-secrets' group.
```

## Capabilities

### Start a Build
Kick off a new mobile app build for a specific workflow or branch without needing to navigate the Codemagic interface.

### Stop Running Builds
Cancel ongoing builds instantly when you realize they're unnecessary, saving time and resources.

### Retrieve Build Outputs
Get the secure, authenticated download link for a specific build artifact immediately after it finishes.

### Share Artifacts Publicly
Generate temporary, public-facing URLs so QA or stakeholders can download finished builds without needing internal access.

### Update Build Secrets
Add or change secure variables and environment settings needed for the build process in the variable groups.

## Use Cases

### The Release Candidate is Ready
A release manager doesn't want to wait for internal IT access. They prompt their agent: 'Generate a public download link for the app-release.ipa that expires in 48 hours.' The agent uses `create_public_artifact_url`, and the QA team gets the URL instantly, skipping manual handoffs.

### Need to Rerun a Specific Build
A developer knows an earlier build failed due to a bad tag. They prompt their agent: 'Start a new build for app X using the release-workflow on the v2.1 branch.' The agent uses `start_build`, overriding the default settings and getting the correct test run immediately.

### Sensitive Keys Changed
The DevOps team gets a new API key for staging. Instead of logging into the web UI, they tell their agent: 'Add secure variable STAGE_API_KEY with value XYZ to the prod-secrets group.' The agent executes `add_variables_to_group` and keeps the environment current.

### Build Went Wrong Mid-Process
A developer starts a build, realizes they hit a dead end in testing, and needs to stop it. They simply chat with their agent: 'Cancel the running build.' The agent executes `cancel_build`, saving compute time.

## Benefits

- Stop context switching. Instead of opening the Codemagic dashboard, you simply tell your agent to `start_build` for a new release branch directly within your coding environment.
- Save time and compute resources by instantly cancelling unwanted builds. Use the `cancel_build` tool when a test run is no longer needed; it’s one command away.
- Simplify sharing artifacts with QA teams. The `create_public_artifact_url` tool generates temporary, external download links without giving out internal credentials.
- Maintain accurate environments easily. Use `add_variables_to_group` to programmatically update secure variables and secrets whenever your production keys change.
- Access build outputs immediately. If you need the authenticated link for a specific IPA, use `get_artifact` instead of searching through logs or menus.

## How It Works

The bottom line is, you treat complex CI/CD commands like simple chat messages.

1. Subscribe to this MCP and provide your Codemagic API Token.
2. Connect it to your AI client—Claude, Cursor, or any other compatible agent.
3. Tell your agent what you need. For example, 'Start a build for the main branch using the release workflow' or 'Generate a public link for the latest IPA artifact'.

## Frequently Asked Questions

**How do I use Codemagic MCP to start a new app build?**
You initiate a build by telling your agent to `start_build`. You can specify the exact workflow, branch, or tags you want, making sure it's not an accidental run.

**Can I use Codemagic MCP to share artifacts with external users?**
Yes. Use `create_public_artifact_url` when you need a temporary link that expires after a set time, keeping your internal builds secure while letting QA teams test the latest build.

**What if I want to stop a build that's running too long?**
Just use `cancel_build`. You send a simple message to your agent asking it to cancel, and it stops resource usage immediately.

**Does Codemagic MCP help me manage environment variables?**
Absolutely. If you have new secrets or keys, use `add_variables_to_group`. This adds the variable directly to your build group without manual dashboard interaction.

**Do I need an API token for Codemagic MCP?**
Yes, you must provide a valid Codemagic API Token when setting up this MCP. It authenticates your agent's ability to run commands on your behalf.