Skip to main content

A FastMCP-based MCP server for DevOps

Project description

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 repository search and management
  • File content retrieval from repositories
  • Issue tracking and management
  • Code search functionality

Installation

To install the package, use the following command:

pip install devops-mcps

Usage

Run the MCP server:

devops-mcps

Configuration

Environment Variables

Set the required environment variable for GitHub API access:

export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

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/api/v3

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/api/v3",
    "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/api/v3",
    "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/api/v3",
    "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/api/v3",
    "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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devops_mcps-0.5.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devops_mcps-0.5.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file devops_mcps-0.5.2.tar.gz.

File metadata

  • Download URL: devops_mcps-0.5.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for devops_mcps-0.5.2.tar.gz
Algorithm Hash digest
SHA256 52b39d73f6d6c4fa972300752b68486a7549cd5161d2c52f7c6c188d06e29f4f
MD5 6aa14c4990c1b5678ec7ee27ce10933e
BLAKE2b-256 7157bd22e9d81a3b2ee1dabdd79c0ac9d86b6b3cd52f9368c3f9ad36a0245ab1

See more details on using hashes here.

File details

Details for the file devops_mcps-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: devops_mcps-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for devops_mcps-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af49798dae6da3abf8bc6a1246a192b0e1292b44bb1f7c4b0d8cee91c064584c
MD5 8ce6cd5f72c184705438ba10e90ef979
BLAKE2b-256 66ecd8f406c1deaba1f6e1cebf0dca5cd6ce1a474efc7686e783ddeb90af00ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page