# Connect a coding agent

> Configure a coding agent to submit jobs and read results through the CLI, API or MCP.

Source: https://www.sorus.run/docs/guides/agents
Reviewed: 2026-10-21

You need an authorised repository and access to the agent host's secret settings.

## Start with the skill

[Install the Sorus CI skill](https://www.sorus.run/docs/guides/install-skill) for Claude Code, Codex, Gemini CLI or Cursor. It gives the agent the submission and recovery procedure; the interfaces below give it a way to call Sorus.

## Interfaces

Choose an interface the agent supports:


### CLI

For an agent with shell tools, install the [public client](https://www.sorus.run/docs/sorus-ci#install) and add `--json` to commands for structured results.


### HTTP API

Use the operations and schemas in the [API reference](https://www.sorus.run/docs/reference/api).


### MCP

Use the separate `lathe-mcp` server if it has been supplied for your integration. It is not included in the public client package.



The [machine-readable documentation index](https://www.sorus.run/llms.txt) links to individual Markdown pages, the full documentation text and API schemas. Keep the job procedure in the skill and look up exact commands in the reference when needed.

## Credentials

Create a named credential for the agent using the [authentication guide](https://www.sorus.run/docs/guides/authentication#ci-and-agent-credentials). A caller that reads and submits jobs generally needs `read` and `submit`, not credential administration.

For the CLI, inject `SORUS_TOKEN` through the host's secret mechanism, or select a credential file with `SORUS_CREDENTIAL_FILE`. Keep values out of prompts, checked-in configuration and transcripts. Verify the caller with `sorus whoami` before allowing submissions.

Set the repository, task, concurrency and retry limits in the agent's instructions. A valid credential does not decide whether a particular new job is within the task you assigned.

## Transports

The separate MCP server currently retains its executable and configuration names: `lathe-mcp`, `LATHE_TOKEN`, `LATHE_CREDENTIAL_FILE` and `LATHE_ENDPOINT`. Do not substitute the CLI's `SORUS_*` names in MCP configuration.


### Local · stdio

For a client that starts a local server, configure `lathe-mcp` with `stdio` as its argument and supply the credential through the host's secret mechanism.


### Streamable HTTP

Follow the [MCP transport reference](https://www.sorus.run/docs/reference/mcp#installation). A listener outside loopback also requires `LATHE_MCP_HTTP_TOKEN`, with at least 32 characters, and the matching bearer token on each request. Every operation still runs under the server's Sorus credential.



## Results and retries

Store submission keys and job identifiers. Read structured refusal and exit fields instead of parsing sentences intended for a person. Have the agent distinguish a workload failure from a platform failure or an outcome it could not observe.

After an interrupted request, inspect or resume the original job before submitting another. A submission key cannot be reused with changed inputs. Use the [job recovery guide](https://www.sorus.run/docs/guides/results) for retry behavior.
