home / mcp / jenkins mcp server

Jenkins MCP Server

Provides a Jenkins-focused MCP server and client workflow to trigger build tasks via MCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jasonkylelol-jenkins-mcp-server": {
      "command": "python3",
      "args": [
        "mcp_server.py"
      ],
      "env": {
        "JENKINS_URL": "YOUR_JENKINS_URL",
        "JENKINS_USER": "YOUR_USER",
        "OPENAI_MODEL": "MODEL_NAME",
        "JENKINS_TOKEN": "YOUR_TOKEN",
        "OPENAI_API_KEY": "YOUR_API_KEY",
        "OPENAI_API_BASE_URL": "OPENAI_BASE_URL"
      }
    }
  }
}

You can run a Jenkins-focused MCP server locally to automate build tasks. This MCP allows you to start a small server, configure Jenkins connection details, and trigger Jenkins build tasks via a lightweight client, enabling streamlined, repeatable automation in your CI workflow.

How to use

To use the Jenkins MCP server with the MCP client, first configure the environment to point to your Jenkins instance and your OpenAI settings. You will also specify how the server should listen locally.

Edit your environment and server port settings as needed, then start the server and run the client to kick off a Jenkins build task.

# Start the MCP server
python3 mcp_server.py
```

```
# Run the MCP client to trigger a Jenkins build task
python3 mcp_client.py

How to install

Prerequisites you need before installation: Python 3.x is installed on your system.

Prepare the working directory and required files. You should have the MCP server script, the client, a configuration file, and an environment file ready to edit.

Concrete steps you can follow to set up locally:

# (Optional) Create a working directory
mkdir -p ~/jenkins-mcp
cd ~/jenkins-mcp

# Ensure the server and client scripts are present in this directory:
# - mcp_server.py
# - mcp_client.py
# - server_config.json (or equivalent)
# - .env (to configure Jenkins URL, user, token, and OpenAI settings)

# Start the MCP server (stdio, local runtime)
python3 mcp_server.py

# In a separate terminal, run the MCP client to trigger a Jenkins build task
python3 mcp_client.py

Additional information

Configuration notes: you will edit the .env file to configure the Jenkins URL, user, token, and OpenAI API base URL, model, and API key. You should also edit server_config.json to reflect your MCP server port.

Security and access: keep your Jenkins credentials secure. Do not share the .env file or credentials publicly. Use strong tokens and rotate them periodically.

Troubleshooting tips: if the server fails to start, verify the port in server_config.json and ensure no other process is listening on that port. If the client reports authentication or Jenkins connectivity issues, re-check the Jenkins URL, user, and token in the .env file.