> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Jenkins in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/jenkins
Last updated: 2026-11-24

Share Jenkins with your team in Claude, ChatGPT and Cursor through Metorial: jenkins API token sign-in, 19 tools (15 read-only).

---

To give your team Jenkins in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Jenkins integration in a Metorial portal, and each person connects with a jenkins API token. Inspect Jenkins CI jobs and builds, trigger and replay builds, read queues and logs, summarize test and SCM metadata, and check controller status through Jenkins Remote Access API endpoints. The integration has 19 tools, 15 read-only and 4 write, plus 3 triggers.

**What you will learn**

- How an admin shares Jenkins in a portal and how each person connects
- What Jenkins asks for when you connect, and where to find it
- How to keep the 15 read-only tools and reject the other 4

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- A jenkins API token from Jenkins for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in method

| Method | Type | What a person provides |
| --- | --- | --- |
| **Jenkins API Token** | Custom credentials | `username` and `token` |

### Jenkins API Token

To connect, a person enters these values:

- `username`: Jenkins username
- `token`: Jenkins API token (found at $JENKINS_URL/me/configure)

### Setup settings

Setup also asks for:

- `instanceUrl`: The base URL of the Jenkins instance (e.g. https://jenkins.example.com)

## Admin: share Jenkins in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Jenkins. For how members connect, choose **Each person connects** so everyone enters their own jenkins API token, or **Shared connection** to enter one jenkins API token for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Jenkins.

4. **Choose who gets it**

   Add the access groups that should see Jenkins. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Jenkins integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search jenkins
```

## Employee: connect Jenkins

### In the portal

1. **Open Jenkins in the catalog**

   Sign in to your portal and open Jenkins. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your jenkins API token (username and token).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search jenkins
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. 

### Add it to your AI client

`metorial install` adds your Jenkins connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list jenkins
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 15 read-only tools, such as `get_job` and `who_am_i`, and lose the 4 write tools, such as `replay_build` or `update_build`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list jenkins
metorial tools <integration-id>
metorial call <integration-id> list_jobs -d '{}'
```

`metorial tools` lists the 19 tools, minus any you rejected. `list_jobs` takes no input. It lists Jenkins jobs in the root or a folder, sorted by name with skip/limit pagination, optional folder recursion, and optional name filtering.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (15)

- `get_build_log`: Retrieve Jenkins build log lines with forward, end-relative, and cursor pagination.
- `get_flaky_failures`: Retrieve Jenkins JUnit test cases that contain exported flakyFailure entries for a build.
- `who_am_i`: Return the Jenkins identity visible to the authenticated API token using /me/api/json.
- `list_jobs`: List Jenkins jobs in the root or a folder, sorted by name with skip/limit pagination, optional folder recursion, and optional name filtering.
- `get_replay_scripts`: Fetch Pipeline Replay main script and loaded scripts for a Jenkins build when the Pipeline Replay HTTP page is available.
- `get_queue_item`: Get a Jenkins queue item by id, including task details, scheduling reason, and executable build when assigned.
- `get_build_changesets`: Get Jenkins build changesets with commit ids, messages, authors, timestamps, and affected paths.
- `search_build_log`: Search Jenkins build console logs for matching lines, using progressive log reads and bounded result counts.
- `get_build_scm`: Retrieve Git SCM metadata attached to a Jenkins build, including repository URIs, built branches, and commit when Jenkins exposes Git BuildData.
- `get_job_scm`: Read a Jenkins job config.xml and summarize SCM classes, repository URLs, branches, credential ids, and Git SCM configs.
- `get_job`: Get Jenkins job details, including status color, buildability, health reports, and recent build references. Needs `jobPath`.
- `get_build`: Get Jenkins build details by build number, defaulting to the last build when no build number is provided. Needs `jobPath`.
- `get_status`: Get Jenkins controller health/readiness, queue, and executor status using /api/json, /queue/api/json, and /computer/api/json.
- `find_jobs_with_scm_url`: Find Jenkins jobs whose Git SCM configuration loosely matches a repository URL and optional branch.
- `get_test_results`: Get Jenkins JUnit test report counts, bounded suite summaries, and representative test cases for a build.

### Write tools (4)

- `trigger_build`: Trigger a Jenkins job build, using buildWithParameters when parameters are provided and build otherwise. Needs `jobPath`.
- `rebuild_build`: Re-run a Jenkins build.
- `update_build`: Update a Jenkins build display name and/or description through stock Jenkins build HTTP endpoints.
- `replay_build`: Run Jenkins Pipeline Replay for a build when Jenkins exposes the Pipeline Replay HTTP run endpoint.

## Triggers

Jenkins has 3 triggers, which fire on events in Jenkins:

- `build_event`: Triggers when a build starts, completes (success, failure, unstable, or aborted) on monitored Jenkins jobs.
- `inbound_webhook`
- `job_status_change`: Triggers when a job's status color changes (e.g. from blue/success to red/failure, or becomes disabled).

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Jenkins there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Jenkins on metorial.com](https://metorial.com/integrations/jenkins): the integration overview