# Codemagic MCP for AI Agents AI Agent Connect

> Codemagic MCP for AI Agents. Automate mobile CI/CD workflows by triggering builds, managing artifacts, and updating environment variables directly from your AI agent. Skip the dashboard and manage your mobile app delivery pipeline with natural language commands.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_pNfm2lX2WqmSzosnLxFoxsMQehesV2YsKzeaN0sV/ai-agent-connect
- **Tags:** mobile-cicd, build-automation, ios-android-builds, artifact-management, continuous-integration

## Description

Connect your Codemagic account to your AI agent to handle the heavy lifting of mobile app delivery. Instead of jumping between your code editor and a browser to check build statuses or manually set environment variables, you can just tell your agent what needs to happen. If you need to kick off a production build with specific branch overrides, the agent handles the request for you. You can also grab authenticated links for your team or generate public URLs for stakeholders without digging through logs. This Connector lives in the Vinkius catalog to give you a direct line to your CI/CD pipeline, making it easier to manage the repetitive parts of mobile deployment while you stay focused on the code. It turns your deployment workflow into a conversation, letting you manage builds, cancel unnecessary runs, and keep your environment configuration current without leaving your workspace.

## Tools

### add_variables_to_group
Add new variables or secrets to a specific variable group. This keeps your CI/CD environment current without manual updates.

### cancel_build
Stop a build that is already running. Use this to prevent wasted resources on builds that are no longer needed.

### create_public_artifact_url
Create a public download link for a build artifact. This is perfect for sharing files with external stakeholders quickly.

### get_artifact
Retrieve an authenticated download URL for a specific build artifact. Use this to access your files securely within your own team.

### start_build
Start a new build for a specific app and workflow. You can also provide overrides for branches, tags, or machine instances.

## Prompt Examples

**Prompt:** 
```
Start a build for the production app on the main branch with the release workflow.
```

**Response:** 
```
### Build Triggered
I've initiated the production build for you. 

* **App:** Production
* **Workflow:** release-workflow
* **Branch:** main

You can track the progress in your Codemagic dashboard. I'll let you know if there are any immediate status updates.
```

**Prompt:** 
```
Give me a link for the latest build output so I can send it to the QA team.
```

**Response:** 
```
### Artifact Link Generated
I've created a public download link for the latest build artifact.

**Link:** [https://codemagic.io/share/temp-link-12345]

* **Status:** Public
* **Expiration:** 24 hours

Feel free to share this directly with the QA team.
```

**Prompt:** 
```
Add a new API key called STRIPE_KEY to our production variable group.
```

**Response:** 
```
### Variable Updated
I've added the new secret to your environment.

* **Key:** `STRIPE_KEY`
* **Group:** `production-secrets`
* **Status:** Success

Your next build will automatically include this updated variable.
```

## Capabilities

### Trigger new builds
Start specific app workflows with custom branch, tag, or machine overrides.

### Stop active builds
Instantly kill a running build to save time and compute resources.

### Generate public links
Create temporary public URLs for build artifacts to share with others.

### Get private artifact links
Retrieve authenticated download URLs for your own internal use.

### Update variable groups
Add new secrets or configuration variables to your CI/CD environment.

## Use Cases

### Hotfix deployment
A developer needs to trigger a production build on a hotfix branch. They ask the agent to start a build with the release-workflow and hotfix-v1 tag.

### QA handoff
A release manager needs to share a build with a client. They ask the agent to generate a public link using create_public_artifact_url.

### Stopping wasted builds
An engineer realizes a build is running on the wrong branch. They tell the agent to use cancel_build to stop the process immediately.

### Secret rotation
A team needs to rotate an API key in production. They ask the agent to use add_variables_to_group to update the secret in the production group.

## Benefits

- Stop wasting time on manual builds. Use start_build to trigger production runs with specific overrides without leaving your workspace.
- Manage secrets faster. Use add_variables_to_group to keep your environment variables in sync with your latest configuration changes.
- Share files instantly. Use create_public_artifact_url to get a link for your QA team the moment a build finishes.
- Save on compute costs. Use cancel_build to stop long-running builds that have failed or are no longer relevant.
- Access private builds securely. Use get_artifact to grab authenticated links for your internal testing needs.

## How It Works

The bottom line is you can manage your entire mobile CI/CD pipeline through a simple chat interface.

1. Connect your Codemagic API Token to the Connector.
2. Give your agent commands like starting a build or grabbing an artifact link.
3. Receive build status updates or download URLs directly in your chat.

## Frequently Asked Questions

**Can the Codemagic MCP trigger builds for both iOS and Android?**
Yes, it can start builds for any app or workflow configured in your Codemagic account, including both iOS and Android projects.

**How do I share build files with my team using Codemagic MCP?**
You can ask your agent to generate a public download link for any specific artifact, which you can then share instantly with your team.

**Can I stop a build that is already running with Codemagic MCP?**
Yes, you can use the agent to cancel any active build to save on your build minutes and free up your resources.

**Does the Codemagic MCP handle my environment secrets?**
It can add new variables or secrets to your existing variable groups via the V3 API, keeping your CI/CD environment up to date.

**Is it possible to get a private link for a build?**
Yes, the agent can retrieve authenticated download URLs for your internal use, ensuring your builds stay secure within your team.

**Can I trigger a build for a specific branch or tag using the AI?**
Yes! Use the `start_build` tool and provide the `appId`, `workflowId`, and either the `branch` or `tag` name. You can even specify the `instanceType` if you need a specific build machine.

**How do I share a build artifact with someone who doesn't have a Codemagic account?**
You can use the `create_public_artifact_url` tool. Provide the artifact `path` and a UNIX timestamp for `expires_at`. The agent will generate a temporary public link for you.

**Is it possible to update environment secrets safely?**
Absolutely. The `add_variables_to_group` tool allows you to add variables to a group. By setting the `secure` parameter to true, your variables will be encrypted as secrets in Codemagic.