add_private_app
Add a private Git repository to Codemagic CI/CD using SSH authentication. Configure repository access with SSH keys to enable automated builds and deployments.
Instructions
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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repository_url | Yes | ||
| ssh_key_data | Yes | ||
| ssh_passphrase | No | ||
| project_type | No | ||
| team_id | No |
Implementation Reference
- codemagic_mcp/tools/apps.py:46-70 (handler)The MCP tool handler for 'add_private_app' which calls the CodemagicClient.
@mcp.tool() async def add_private_app( repository_url: str, ssh_key_data: str, ssh_passphrase: str | None = None, project_type: str | None = None, team_id: str | None = None, ) -> Any: """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. """ async with CodemagicClient() as client: return await client.add_private_app( repository_url=repository_url, ssh_key_data=ssh_key_data, ssh_passphrase=ssh_passphrase, project_type=project_type, team_id=team_id, ) - codemagic_mcp/client.py:81-99 (handler)The underlying API client method that executes the POST request to add a private app.
async def add_private_app( self, repository_url: str, ssh_key_data: str, ssh_passphrase: str | None = None, project_type: str | None = None, team_id: str | None = None, ) -> Any: payload: dict[str, Any] = { "repositoryUrl": repository_url, "sshKey": {"data": ssh_key_data}, } if ssh_passphrase is not None: payload["sshKey"]["passphrase"] = ssh_passphrase if project_type is not None: payload["projectType"] = project_type if team_id is not None: payload["teamId"] = team_id return await self._post("/apps/new", json=payload)