Cover image
Try Now
2025-04-14

Un servidor DevOps MCP, implementación de Python, lanzamiento en modo Docker.

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

DevOps MCP Server

A FastMCP-based MCP server providing DevOps tools and integrations.

This a conservative MCP server. It does not add, update or delete anything in your system, does not run any job. Basically, it is read-only. It only retrieves data for analysis, display the information.

So it is safe for DevOps.

Features

GitHub Integration

  • Repository search and management
  • File content retrieval from repositories
  • Issue tracking and management
  • Code search functionality
  • Commit history viewing

Jenkins Integration

  • Job listing and management
  • Build log retrieval
  • View management
  • Build parameter inspection
  • Recent failed builds monitoring

Installation

To install the package, use the following command:

pip install devops-mcps

Usage

Run the MCP server:

devops-mcps

Configuration

Environment Variables

GitHub Configuration

Set the required environment variable for GitHub API access:

export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

Jenkins Configuration

Set the required environment variables for Jenkins API access:

export JENKINS_URL=your_jenkins_url
export JENKINS_USER=your_jenkins_username
export JENKINS_TOKEN=your_jenkins_token
export LOG_LENGTH=5120

Note: LOG_LENGTH means it will retrieve this length of jenkins log for analysis. It does not always the longer the better.

UVX Configuration

Install UVX tools:

uvx install

Run with UVX:

uvx devops-mcps

Transport Configuration

The MCP server supports two transport types:

  • stdio (default): Standard input/output communication
  • sse: Server-Sent Events for HTTP-based communication

Local Usage

# Default stdio transport
devops-mcps

# SSE transport
devops-mcps --transport sse

UVX Usage

# Default stdio transport
uvx run devops-mcps

# SSE transport
uvx run devops-mcps-sse

Docker Configuration

Build the Docker image:

docker build -t devops-mcps .

Run the container:

docker run -p 8000:8000 devops-mcps

GitHub Public and Enterprise Support

This project supports both public GitHub and GitHub Enterprise automatically.

  • By default, it connects to public GitHub (https://api.github.com).
  • To use with GitHub Enterprise, set the GITHUB_API_URL environment variable to your enterprise API endpoint (e.g., https://github.mycompany.com/api/v3).

Example:

# For public GitHub (default)
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

# For GitHub Enterprise
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
export GITHUB_API_URL=https://github.mycompany.com

The server will detect the correct API endpoint at runtime.

VSCode Configuration

To use this MCP server in vs code copilot, there are 2 ways to configure it in VSCode settings.json with different transport types:

UVX Configuration

stdio Transport (default)

"devops-mcps": {
  "type": "stdio",
  "command": "uvx",
  "args": ["devops-mcps"],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxCe",
    "GITHUB_API_URL": "https://github.mycompany.com",
    "JENKINS_URL": "jenkins_url_here",
    "JENKINS_USER": "jenkins_username_here",
    "JENKINS_TOKEN": "jenkins_password_here"
  }
}

SSE Transport

"devops-mcps": {
  "type": "sse",
  "command": "uvx",
  "args": ["devops-mcps-sse"],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxCe",
    "GITHUB_API_URL": "https://github.mycompany.com",
    "JENKINS_URL": "jenkins_url_here",
    "JENKINS_USER": "jenkins_username_here",
    "JENKINS_TOKEN": "jenkins_password_here"
  }
}

Docker Configuration

stdio Transport (default)

"devops-mcps": {
  "command": "docker",
  "args": [
    "run",
    "-i",
    "huangjien/devops-mcps:latest"
  ],
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxx2Ce",
    "GITHUB_API_URL": "https://github.mycompany.com",
    "JENKINS_URL": "jenkins_url_here",
    "JENKINS_USER": "jenkins_username_here",
    "JENKINS_TOKEN": "jenkins_password_here"
  }
}

SSE Transport (MCP Server Deployed in Remote Docker Container)

"devops-mcps": {
  "type": "sse",
  "url": "http://[remote ip address]:8000/sse",
  "env": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxx2Ce",
    "GITHUB_API_URL": "https://github.mycompany.com",
    "JENKINS_URL": "jenkins_url_here",
    "JENKINS_USER": "jenkins_username_here",
    "JENKINS_TOKEN": "jenkins_password_here"
  }
}

Note: The docker should start like:

docker run -p 8000:8000 -e TRANSPORT_TYPE=sse -i huangjien/devops-mcps:latest

Development

Install development dependencies:

uv pip install -e .[dev]

or

uv sync

Recommend to install vs code extension: ruff

Or do it in command line:

To lint (check):

uvx ruff check

To format:

uvx ruff format

Run mcp inspector to test or debug:

npx @modelcontextprotocol/inspector uv run devops-mcps

CI/CD Pipeline

GitHub Actions workflow will automatically:

  1. Build and publish Python package to PyPI
  2. Build and push Docker image to Docker Hub

Required Secrets

Set these secrets in your GitHub repository:

  • PYPI_API_TOKEN: Your PyPI API token
  • DOCKER_HUB_USERNAME: Your Docker Hub username
  • DOCKER_HUB_TOKEN: Your Docker Hub access token

Workflow triggers on push to main branch.

Packaging and Publishing

Install tools

pip install -U twine build  

Build the package

python -m build

Upload to PyPI

  1. Create a ~/.pypirc file with your API token:

    [pypi]
    username = __token__
    password = your_pypi_api_token_here
    
  2. Upload the package:

    twine upload dist/*
    

Important Notes

  • Ensure all classifiers in pyproject.toml are valid PyPI classifiers
  • Remove deprecated license classifiers in favor of SPDX license expressions
  • The package will be available at: https://pypi.org/project/devops-mcps/
  • Update the version everytime, or when you push, it will show an error: already exists.

License

MIT

Appendix (Query in Github)

For Repository Search (gh_search_repositories):

  • in:: Search only in specific fields (name, description, readme, or combinations). query="fastapi in:name" (Find repos with "fastapi" in their name) query="web framework in:readme,description"

  • user: or org:: Search within a specific user's or organization's repositories. query="user:tiangolo fastapi"

  • language:: Filter by programming language. query="http client language:python"

  • stars:<N>, forks:<N>: Filter by number of stars or forks (use ranges like >100, <50, 10..50). query="language:javascript stars:>1000"

  • created:<YYYY-MM-DD>, pushed:<YYYY-MM-DD>: Filter by creation or last push date (use ranges). query="data science pushed:>2024-03-01"

  • topic:: Filter by repository topic. query="topic:docker topic:python"

  • license:: Filter by license (e.g., mit, apache-2.0). query="language:go license:mit"

For Code Search (gh_search_code):

  • in:: Search within file content (default), path, or both. q='"import requests" in:file'

  • user: or org:: Search code within a specific user's or organization's repositories. q='"BaseSettings" user:tiangolo'

  • repo:/: Search code within a specific repository. q='"JenkinsAPIException" repo:devops-mcps/devops-mcps'

  • language:: Filter by the language of the file containing the code. q='def main language:python'

  • path:, path:/: Search within specific paths or the root directory. q='"GithubException" path:src/devops_mcps'

  • filename:: Search within specific filenames. q='TODO filename:core.py'

  • extension:: Search within files having a specific extension. q='class Settings extension:py'

This query syntax provides a flexible and powerful way to find exactly what you need on GitHub directly through your MCP tools. You can find the full, official documentation here:

相关推荐

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • 1Panel-dev
  • 🔥 1Panel proporciona una interfaz web intuitiva y un servidor MCP para administrar sitios web, archivos, contenedores, bases de datos y LLM en un servidor de Linux.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • rulego
  • ⛓️Rulego es un marco de motor de regla de orquestación de componentes de alta generación de alto rendimiento, de alto rendimiento y de alto rendimiento para GO.

  • sigoden
  • Cree fácilmente herramientas y agentes de LLM utilizando funciones Plain Bash/JavaScript/Python.

  • hkr04
  • SDK liviano C ++ MCP (Protocolo de contexto del modelo)

  • RockChinQ
  • 😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 Qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 DiFy 、 Claude 、 Gemini 、 Xai 、 PPIO 、 Ollama 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 Chatglm 、 SillyTraven 、 MCP 等 LLM 的机器人 / Agente | Plataforma de bots de mensajería instantánea basada en LLM, admite Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack

  • dmayboroda
  • Trapo conversacional local con contenedores configurables

  • modelscope
  • Iniciar aplicaciones de múltiples agentes empoderadas con Building LLM de manera más fácil.

  • paulwing
  • Un repositorio de pruebas creado con el servicio MCP

    Reviews

    4.5 (2)
    Avatar
    user_2nFsznqw
    2025-04-24

    I've been a loyal user of devops-mcps by huangjien and it has significantly streamlined our DevOps processes. The intuitive design and efficient features have boosted our productivity. Highly recommend it to anyone looking to optimize their workflow.

    Avatar
    user_EEtGxFFK
    2025-04-24

    As a dedicated user of devops-mcps by huangjien, I can confidently say this tool is transformative for our DevOps processes. Its intuitive interface and robust features streamline our workflows, making deployments smoother and more efficient. Highly recommended for anyone serious about DevOps!