🔐 Authentication
Getting a Jenkins API token and choosing between bearer token and basic auth.
🔑 Get Your Jenkins API Token
Follow these steps to create an API token for the MCP server:
Step 1: Access Security Settings
- Log in to your Jenkins instance
- Click your username in the top-right corner
- Select Configure from the dropdown menu
- In the left sidebar, click Security
Step 2: Create API Token
- Scroll to the API Token section
- Under "Current token(s)", click the Add new token button
- Enter a descriptive name (e.g., "Jenkins MCP" or "AI Assistant")
- Click Generate
- ⚠️ IMPORTANT: Copy the token immediately - it will only be shown once!
Step 3: Save the Token
Store the token securely - you'll need it for configuration:
- For Bearer Token auth: Use it as
MCP_JENKINS_BEARER_TOKEN - For Basic auth: Use it as
MCP_JENKINS_API_TOKEN(along withMCP_JENKINS_USER)
Example token format: 11abcd1234567890abcdef1234567890ab
💡 Tip: You can see all your active tokens in the "Current token(s)" list. Each shows when it was created and last used, helping you manage and rotate tokens regularly.
⚖️ Bearer Token vs Basic Auth
Bearer Token (Recommended):
--env MCP_JENKINS_BEARER_TOKEN=your_tokenBasic Auth:
--env MCP_JENKINS_USER=your_username
--env MCP_JENKINS_API_TOKEN=your_token🕶️ Anonymous Instances
For Jenkins instances with no authentication, pass --anonymous (or set
MCP_JENKINS_ANONYMOUS=true) and omit all credentials.
🎫 OAuth Support
This server forwards any Authorization header to Jenkins. If your Jenkins uses OAuth (via plugins), just pass the OAuth token as MCP_JENKINS_BEARER_TOKEN.