The Model Context Protocol (MCP) is an open-source implementation that bridges Jenkins with AI language models following Anthropic's MCP specification. This project enables secure, contextual AI inter
The Model Context Protocol (MCP) is an open-source implementation that bridges Jenkins with AI language models following Anthropic's MCP specification. This project enables secure, contextual AI interactions with Jenkins tools while maintaining data privacy and security.
Choose one of these installation methods:
# Using uv (recommended)
pip install uv
uvx mcp-jenkins
# Using pip
pip install mcp-jenkins
# Using Smithery
npx -y @smithery/cli@latest install @lanbaoshen/mcp-jenkins --client claude
This will create or edit the ~/.cursor/mcp.json file with your MCP server configuration.
{
"mcpServers": {
"mcp-jenkins": {
"command": "uvx",
"args": [
"mcp-jenkins",
"--jenkins-url=xxx",
"--jenkins-username=xxx",
"--jenkins-password=xxx"
]
}
}
}
.vscode
folder with mcp.json
file in you workspace for local setup or edit settings.json
trough settings menù.{
"servers": {
"jenkins": {
"url": "http://localhost:3000/sse",
"type": "sse"
}
}
}
uvx mcp-jenkins \
--jenkins-url http://localhost:3000 \
--jenkins-username your_username \
--jenkins-password your_password \
--transport sse --port 3000
# Stdio Mode
uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx --read-only
# SSE Mode
uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx --transport sse --port 9887
Install autogen:
pip install "autogen-ext[azure,ollama,openai,mcp]" autogen-chat
Run python scripts:
import asyncio
from autogen_ext.tools.mcp import StdioMcpToolAdapter, StdioServerParams
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_core import CancellationToken
async def main() -> None:
# Create server params for the remote MCP service
server_params = StdioServerParams(
command='uvx',
args=[
'mcp-jenkins',
'--jenkins-username',
'xxx',
'--jenkins-password',
'xxx',
'--jenkins-url',
'xxx'
],
)
# Get the translation tool from the server
adapter = await StdioMcpToolAdapter.from_server_params(server_params, 'get_all_jobs')
# Create an agent that can use the translation tool
agent = AssistantAgent(
name='jenkins_assistant',
model_client=[Replace_with_your_model_client],
tools=[adapter],
)
# Let the agent translate some text
await Console(
agent.run_stream(task='Get all jobs', cancellation_token=CancellationToken())
)
if __name__ == "__main__":
asyncio.run(main())
</details>
# Using MCP Inspector
# For installed package
npx @modelcontextprotocol/inspector uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx
# For local development version
npx @modelcontextprotocol/inspector uv --directory /path/to/your/mcp-jenkins run mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx
# Install Dependency
uv sync --all-extras --dev
pre-commit install
# Manually execute
pre-commit run --all-files
# Install Dependency
uv sync --all-extras --dev
# Execute UT
uv run pytest --cov=mcp_jenkins
Licensed under MIT - see LICENSE file. This is not an official Jenkins product.
lanbaoshen/mcp-jenkins
April 2, 2025
July 7, 2025
Python