Claude Code is an AI-powered command-line interface (CLI) tool that integrates with the CloudBees CI MCP Router through the MCP Server plugin, connecting your development environment to CloudBees CI. This enables context-aware code suggestions and automation using real CloudBees CI data, so you can interact with Jenkins resources directly from your development environment.
Connect Claude Code
After completing the prerequisites, connect Claude Code to the CloudBees CI MCP Router using the authentication method you configured.
-
Connect with OAuth (recommended)
Connect with OAuth
With OAuth, you do not need to pass credentials to the command line. You sign in once, and the CloudBees CI MCP Router handles the rest.
To connect Claude Code to the CloudBees CI MCP Router:
-
Open a terminal on the machine where Claude Code is installed.
-
Run the following command to add CloudBees CI MCP Router to Claude Code:
claude mcp add ci-mcp-router <router-url> --transport http --client-id ci-mcp-client(1)1 Replace <router-url>with the MCP endpoint of your CloudBees CI MCP Router:http://localhost:9000/mcpfor a local Docker deployment, orhttps://<cluster-domain>/mcp-router/mcpfor a Helm deployment.The
--client-id ci-mcp-clientflag selects the pre-seeded public client. Without it, Claude Code attempts dynamic client registration, which is disabled by default and fails with a403error. -
Start Claude Code:
claude -
Run the
/mcpcommand:/mcp -
Select the
ci-mcp-routerserver. A browser launches with an approval prompt. After you approve, Claude Code reuses the session for later requests.
Connect with an API token
|
Authenticating with an API token will be deprecated in the future. For new deployments, CloudBees recommends that you use OAuth, which authenticates each request individually rather than relying on a shared token. |
To connect Claude Code to the CloudBees CI MCP Router:
-
Open a terminal on the machine where Claude Code is installed.
-
Run the following command to add CloudBees CI MCP Router to Claude Code, including the encoded HTTP basic authentication credentials you generated in Authenticate with an API token:
claude mcp add ci-mcp-router http://localhost:9000/mcp --transport http --header "Authorization: Basic dXNlcm5hbWU6dG9rZW4="(1)1 Replace dXNlcm5hbWU6dG9rZW4=with your actual encoded credentials.Passing the encoded credential directly in this command leaves it in your shell history, and storing it as plain text in your MCP configuration file leaves it exposed to any process that can read that file.
Claude Code lets you reference an environment variable in the header value instead of the literal credential. For more information, refer to Environment variable expansion in
.mcp.jsonfor details.If properly configured, a confirmation message similar to the following is returned:
The CloudBees CI MCP Router has been successfully added to your Claude Code configuration. It's now configured to connect to your local Jenkins instance at http://localhost:9000/mcp with the provided authorization header. -
Start Claude Code:
claudeClaude Code connects using the credentials you provided.
Use Claude Code for development tasks
Now that Claude Code is connected to the CloudBees CI MCP Router, you can use the following tools and commands to accelerate your development workflow. For a list of supported tools, refer to CloudBees CI MCP Router tool reference.