MCP for Claude Code and Codex
Paste a pull request URL into chat to find the failed step and read the surrounding logs. You can also register a team secret by entering its value in your local browser.
Log in to OpenCI
Section titled “Log in to OpenCI”Claude Code and Codex start the Model Context Protocol (MCP) server included in the OpenCI CLI by running openci mcp. On the machine where you run your client, install the CLI with Dart 3.11.5 or later and sign in to OpenCI with your email address and password.
dart install openci_cli_plusopenci loginopenci statusCheck that openci status shows the team connected to the repository you want to investigate. The MCP server uses that team. For first-time login with multiple teams or switching with openci switch team, see the CLI reference.
Install the OpenCI plugin
Section titled “Install the OpenCI plugin”Run the commands for your client in a terminal. The plugin includes the MCP server configuration and these skills.
investigate-cihelps diagnose failed builds using job status and logs.configure-android-patrolhelps write or review Flutter Patrol workflows for Android emulators.configure-flutter-goldensshows how to capture Flutter golden images on Linux and compare them in a Linux pull request workflow for visual regression testing (VRT).
Claude Code
Section titled “Claude Code”claude plugin marketplace add openci-org/openciclaude plugin install openci@openci-pluginscodex plugin marketplace add openci-org/opencicodex plugin add openci@openci-pluginsInvestigate a failed pull request
Section titled “Investigate a failed pull request”Open a new Claude Code or Codex CLI session and use /mcp to check the OpenCI connection. Try this with the URL of a PR that ran on OpenCI.
Which CI step failed on
https://github.com/OWNER/REPO/pull/123? Show me the log lines around the error and the dashboard link for that job.
find_jobstakes the PR URL (pr_url) and searches jobs across its commits. To investigate a specific revision, include its full commit SHA (commit_sha). For a build without a PR, supplyrepositoryand the full SHA. Useowner/repofor GitHub.com or the HTTPS repository URL for GitHub Enterprise.get_job_logstakes the selectedjob_idand returns an excerpt from the current attempt. If a failed step was recorded, its name appears infailed_step. On OpenCI Cloud,dashboard_urlopens the job.
If a retry passed, try asking, “Show me the iOS logs from the attempt that failed before the retry.” When that attempt appears in recent_runs, pass its OpenCI run_id along with the job_id. To read more, keep the same job_id and run_id. Pass first_cursor as cursor to read from the start, or next_cursor to continue.
Cancel a job
Section titled “Cancel a job”With OpenCI CLI 0.12.0 or later, use find_jobs to select a QUEUED or IN_PROGRESS job in the active team. Pass its job_id and its retry_count as expected_retry_count to cancel_job. A successful call returns CANCELLED. Running workers clean up asynchronously. Repeating the request with the same values targets the same attempt.
Register a team secret
Section titled “Register a team secret”With OpenCI CLI 0.11.0 or later, you can start registration by giving the assistant just the secret name.
Open the form to register
API_TOKENfor my current OpenCI team.
register_secret opens a one-time form in your local browser. Check the team and name, enter the single-line value in the masked field, and save. Saving replaces the value of an existing secret with the same name. The chat receives the save result, secret name, and team ID. To reference a new name in a workflow, run openci sync --secrets in that checkout. Manage secrets
Register the MCP server directly
Section titled “Register the MCP server directly”If you only want the MCP tools, register openci mcp as a local stdio server in your client. Installing the plugin already configures this server.
Claude Code
claude mcp add --scope user --transport stdio openci -- openci mcpCodex
codex mcp add openci -- openci mcpOpen a new session and use /mcp to check the connection. Claude Code MCP settings · Codex MCP settings
Troubleshooting
Section titled “Troubleshooting”- Server fails to start. Run
openci --versionfrom the terminal you use to launch the client. If the command is missing, add the directory containing theopenciexecutable toPATHand reopen the client. Reading jobs and logs requires CLI 0.9.0 or later. Registering secrets requires 0.11.0 or later. Runopenci updateto upgrade. - No matching jobs. Check the team with
openci status. If a search returnsnext_cursor, follow it with the same search filters, even if the current page is empty. - Empty or expired logs. Check the job status and the recorded
failure_summary, if available.