Skip to main content
Version: Latest

Jenkins

Proxy for a Jenkins controller through the managed gateway. Routes use a non-terminal path wildcard, so any nested job URL (/job/foo/job/bar/...) is accepted and gated by PBAC policy.

Authentication

Jenkins does not accept IdP-issued OAuth bearer tokens on its REST API — it authenticates with a username + API token over HTTP Basic. This connector supports two auth modes, chosen per managed resource at install time via the Authentication field:

  • Per-user credential (user_secret, default, recommended) — each user links their own Jenkins username + API token once, through a PolicyArc-hosted browser page reached by MCP URL elicitation on the first call. The credential posts only to the AS (never through the MCP client or the model), is stored encrypted per (subject, resource), and is sent as Authorization: Basic base64(user:token) on that user's calls — so Jenkins attributes every build and action to the real user. If the token later expires, the upstream 401 triggers a re-link prompt.
  • Shared service credential (static) — every call uses one operator-held credential from the basic_auth_env secret (value = base64(user:apitoken)), sent verbatim as the HTTP Basic credential. Jenkins attributes all calls to that one account.

Either way, PolicyArc enforces per-user authorization at the gateway via policy before the request reaches Jenkins. See Per-user upstream credentials for how the user_secret collection flow works.

Setup

  • base_url — your Jenkins controller URL, e.g. https://jenkins.example.com.
  • upstream_auth.typeuser_secret (default) or static.
  • basic_auth_envstatic mode only — a secret whose value is base64(user:apitoken) (e.g. printf %s 'user:APITOKEN' | base64). Hidden when user_secret is selected.

Creating a Jenkins API token

Jenkins → your name (top-right) → SecurityAPI TokenAdd new token. In user_secret mode each user does this for themselves on the collection page; in static mode the operator does it once for the shared service account.

Troubleshooting

  • 401 from Jenkins — the username / API token is missing, wrong, or revoked. In user_secret mode the gateway re-prompts the user to reconnect; in static mode check the basic_auth_env secret.
  • 403 from the gateway — the caller lacks the scope the route requires.
  • 403 from Jenkins — the authenticated user lacks permission on that job.

Manifest reference

  • ID: identos.jenkins
  • Version: 1.0.0
  • Resource type: urn:connector:identos:jenkins
  • Capabilities: mcp

Supported auth modes

TypeDetails
user_secret
staticscheme basic; setup fields: basic_auth_env

Setup fields

IDLabelDefaultSecret?Notes
base_urlJenkins base URLnoplaceholder: https://jenkins.example.com
upstream_auth.typeAuthenticationuser_secretnouser_secret (recommended) has each user link their own Jenkins username + API token, so builds are attributed to the real user. static uses one shared API token for everyone.
basic_auth_envBasic auth credentialsyesUsed only for the static method. A secret whose value is base64(user:apitoken) — e.g. `printf %s 'user:APITOKEN'

Scopes

Scope
jenkins:read
jenkins:execute

Routes

MethodPatternScopeResource template
POST/{job_path:.*}/buildjenkins:executejenkins://jobs/{{job_path}}
GET/{job_path:.*}/{build_number}/api/jsonjenkins:readjenkins://jobs/{{job_path}}/builds/{{build_number}}
GET/{job_path:.*}/{build_number}/consoleTextjenkins:readjenkins://jobs/{{job_path}}/builds/{{build_number}}

MCP tools

NameScopeDescription
execute_jobjenkins:executeTrigger a Jenkins job build. job_path is the path segment from /job/... to the job root (no trailing slash).
get_build_statusjenkins:readGet the JSON status for a specific build of a Jenkins job.
get_build_consolejenkins:readGet the console text for a specific build of a Jenkins job.