Metadata-Version: 2.5
Name: zadig-workflow-mcp
Version: 0.1.15
Summary: A local MCP server for browsing, building and releasing Zadig product workflows
Keywords: ci-cd,deployment,mcp,zadig
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11
Requires-Dist: httpx==0.28.1
Requires-Dist: keyring<26,>=25
Requires-Dist: mcp==1.29.0
Requires-Dist: questionary<3,>=2.1
Requires-Dist: tomlkit<1,>=0.13
Description-Content-Type: text/markdown

# Zadig Workflow MCP

Zadig Workflow MCP is a local stdio server for finding product workflows, selecting build targets, running releases, and checking deployment status. The interactive release tool shows the project, workflow, environment, branch, and selected services before requesting confirmation.

## Install and connect an Agent

```sh
uv tool install zadig-workflow-mcp
zadig-mcp init
zadig-mcp login
```

`init` lists all supported clients and marks the detected ones. Move with the up and down arrow keys, toggle each client with Space, and press Enter to confirm. Press Ctrl+C or confirm an empty selection to cancel. For scripts and non-interactive shells, specify the clients explicitly, for example `zadig-mcp init --agent codex --agent cursor`. Choices are `codex`, `claude-code`, `claude-desktop`, `cursor`, `vscode`, `gemini`, and `opencode`.

To install a downloaded wheel, pass its path to `uv tool install`. `init` updates the selected clients' user configurations. `--replace` replaces a different MCP entry with the same name, and `--credentials-only` skips registration. A configuration file containing JSON comments or trailing commas can be edited manually if `init` reports that it cannot update the file.

Set up a different Zadig instance by supplying its HTTPS URL for both commands.

```sh
zadig-mcp init --agent cursor --name zadig-other --url https://zadig.example.com --auth token
zadig-mcp login --url https://zadig.example.com --auth token
```

Enter your API token in the terminal prompt. Credentials are stored through the system keyring, and the MCP configuration contains the launch command and site options. The built-in Zadig Local profile can also reuse your existing local Archery MCP LDAP account. Each user retains their own Zadig permissions. Headless installations can set `ZADIG_API_TOKEN` in the MCP process environment.

Zadig Local signs in automatically with the current user's saved Zadig or Archery LDAP credentials when a session is missing or expires. If credentials are missing or LDAP rejects them, run `zadig-mcp login` in an interactive terminal. It prompts for your LDAP username and password and saves them after LDAP login succeeds.

Use `--name` on `init` to register a second instance alongside the default `zadig` entry. For a Dex LDAP site, use `--auth ldap` to store credentials for that site. Use `--auth shared-ldap` when you want the specified HTTPS site to use the same saved Zadig Local or Archery LDAP account. Sessions are stored per site. Supply the same `--url` and `--auth` to `login`.

Other stdio MCP clients can launch `zadig-mcp` without a subcommand and pass the same `--url` and `--auth` options.

## Release through Zadig

Zadig checks out the selected branch from the remote repository configured in the workflow. Use the Zadig forms and workflow data to plan the release, and skip local Git branch, status, and diff checks.

Each new release request opens its own form. An earlier cancellation applies to that request only. If a form closes before submission, the tool reports the step and action. Follow a submitted release by the task ID returned for that request.

Use `release_interactively` in a client with MCP form support. When `influxai / dev01` is available, the tool opens its branch and service form directly. Select **重新选择工作流** on that form to choose another project or workflow. Choose one or more services from the live workflow options. Influx preselects backend, frontend, and task when those targets are available. You can change the selection and edit the Git branch, which defaults to `production`. Review the complete release and approve it to submit. Use `get_workflow_task` to follow the returned task ID through build and deployment. `run_workflow` prefills the branch and services with the supplied values and goes through the same user confirmation. Both release tools require a client with MCP form support.

## Influx release shortcuts

- `release_test` opens the Influx dev01 branch and service form.
- `release_production` promotes the images from a successful dev01 task selected by the user. The review shows the destination, source task, each component's actual Git revision, the current production Helm tag, and the image to deploy. The tool verifies that the candidate tags are present in the production registry and rechecks the production tags and candidate records after approval. If the review data changes, it stops for a new confirmation.
- `release_test_and_production` starts a dev01 release and returns the test task ID. Call the same tool on the same MCP session with that ID to continue. It can return a waiting status. Once dev01 passes, the tool confirms and deploys the same set of service images. A failed or cancelled test ends the combined release.

Register the Influx production site with `--influx-production` to expose the three shortcuts on the same server. On an existing registration, include `--replace` to apply the new launch flag. Use the named production entry for production and combined releases. The test and production approvals are separate.

## Read task logs

`get_workflow_task` includes the error reported by Zadig for each step when available. Call `get_workflow_task_log` with the same project, workflow, and task ID, plus the stage `type` and step `name` returned by `get_workflow_task`.

For product workflow builds, the tool returns the last 100 lines of the archived build log by default. Set `tail_lines` to 1–500. Output is capped at 24,000 characters. For deployment steps, the tool returns the failure detail from the Zadig task record when available. A null `log` means that no log text is available for that step.
