Connect GitHub Copilot to the CloudBees CI MCP Router

2 minute read

GitHub Copilot 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.

Prerequisites

Before you begin, ensure that you have:

Connect GitHub Copilot

After completing the prerequisites, connect GitHub Copilot to the CloudBees CI MCP Router using the authentication method you configured.

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 GitHub Copilot to the CloudBees CI MCP Router:

  1. Open a terminal on the machine where GitHub Copilot is installed.

  2. Run the following command to add CloudBees CI MCP Router to GitHub Copilot:

    copilot mcp add --transport http ci-mcp-router <router-url>(1)
    ▼
    1 Replace <router-url> with the MCP endpoint of your CloudBees CI MCP Router: http://localhost:9000/mcp for a local Docker deployment, or https://<cluster-domain>/mcp-router/mcp for a Helm deployment.
  3. Start GitHub Copilot:

    copilot
    ▼

    A browser launches with an approval prompt. After you approve, GitHub Copilot 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 GitHub Copilot to the CloudBees CI MCP Router:

  1. Open a terminal on the machine where GitHub Copilot is installed.

  2. Run the following command to add CloudBees CI MCP Router to GitHub Copilot, including the encoded HTTP basic authentication credentials you generated in Authenticate with an API token:

    copilot mcp add ci-mcp-router --transport http http://localhost:9000/mcp --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.

    GitHub Copilot has no confirmed way to reference an environment variable in this field. Treat this configuration file as sensitive, keep it out of version control, and rotate the credential if it’s ever exposed.

  3. Start GitHub Copilot:

    copilot
    ▼

    GitHub Copilot connects using the credentials you provided.

Use GitHub Copilot for development tasks

Now that GitHub Copilot 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.