Skip to main content
Glama
Zfinix

codemagic_mcp

by Zfinix

codemagic_mcp

用于 Codemagic CI/CD API 的 MCP 服务器。使用 Bun + TypeScript,采用 stdio 传输方式。

工具

应用 (Apps)

  • codemagic_get_all_applications

  • codemagic_get_application

  • codemagic_add_application

  • codemagic_add_application_private

构建 (Builds)

  • codemagic_start_build

  • codemagic_get_builds

  • codemagic_get_build_status

  • codemagic_cancel_build

制品 (Artifacts)

  • codemagic_get_artifact (返回元数据 + base64 预览;如需完整下载,请使用公共 URL 工具)

  • codemagic_create_public_artifact_url

缓存 (Caches)

  • codemagic_get_app_caches

  • codemagic_delete_all_app_caches

  • codemagic_delete_app_cache

团队 (Teams)

  • codemagic_invite_team_member

  • codemagic_delete_team_member

Related MCP server: Codemagic

配置

环境变量:

变量

必需

默认值

说明

CODEMAGIC_API_KEY

是

—

从 Teams 设置 → Personal Account → API 获取

CODEMAGIC_BASE_URL

否

https://api.codemagic.io

用于自托管/测试环境的覆盖设置

CODEMAGIC_TIMEOUT_MS

否

30000

单次请求超时时间

CODEMAGIC_MAX_RETRIES

否

3

针对 408/425/429/5xx 及网络错误的重试次数(采用带抖动的指数退避算法,遵循 Retry-After)

运行

bun install
CODEMAGIC_API_KEY=... bun run start

监视模式:

CODEMAGIC_API_KEY=... bun run dev

使用官方 MCP 检查器进行调试:

CODEMAGIC_API_KEY=... bun run inspect

Claude Code / Claude Desktop 配置

单行设置:

claude mcp add codemagic --scope user \
  -e CODEMAGIC_API_KEY=<your_key> \
  -- bunx codemagic_mcp

或在 claude_desktop_config.json 中手动配置:

{
  "mcpServers": {
    "codemagic": {
      "command": "bunx",
      "args": ["codemagic_mcp"],
      "env": { "CODEMAGIC_API_KEY": "..." }
    }
  }
}

安全说明

  • API 密钥仅从环境变量中读取。

  • 外发请求通过 x-auth-token 发送密钥;该密钥绝不会被记录到日志中。

  • 所有工具输出(文本和结构化数据)均经过脱敏处理,会屏蔽密钥值以及任何匹配 authorization、x-auth-token、api[-_]?key、password、passphrase、ssh[-_]?key、secret 或 token 的对象键。

  • 错误被映射为类型化类(CodemagicAuthError、CodemagicNotFoundError、CodemagicValidationError、CodemagicRateLimitError、CodemagicServerError、CodemagicNetworkError),并以可操作的消息形式呈现——内部堆栈跟踪不会暴露给客户端。

布局

src/
  index.ts          stdio entrypoint
  schemas.ts        Zod input schemas
  lib/
    config.ts       env loading + validation
    client.ts       fetch wrapper: timeouts, retries, status mapping
    errors.ts       typed error classes + user-facing formatter
    redact.ts       secret/string + key-pattern redaction
    response.ts     jsonResult / textResult / errorResult helpers
  tools/
    apps.ts builds.ts artifacts.ts caches.ts teams.ts

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    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.
    25
    2
    MIT