Skip to main content

MCP server for VPS management — SSH, Docker, services, GitHub, deployments, monitoring

Project description

server-ops-mcp

MCP server for VPS management — SSH commands, Docker containers, service management, GitHub integration, deployments, and monitoring.

Uses lazy category loading — only meta-tools are registered at startup. The agent enables categories on demand.

Quick Start

1. Install

pip install server-ops-mcp

2. Setup your VPS (one-time)

server-ops-mcp setup --host 1.2.3.4

This will:

  • Prompt for your sudo password (hidden input, never stored)
  • Create a mcp-agent user on the VPS
  • Configure NOPASSWD sudo for service commands
  • Generate an Ed25519 SSH keypair
  • Save the private key to ~/.ssh/server-ops-<name>
  • Update ~/.config/devops-mcp/config.json

3. Add to your MCP client

{
  "mcpServers": {
    "server-ops": {
      "command": "server-ops-mcp"
    }
  }
}

4. Use it

Just talk to your agent:

  • "Check disk usage on my server"
  • "Restart nginx"
  • "Deploy latest code"

The agent discovers and enables tool categories automatically.

Commands

server-ops-mcp                          # Start MCP server (default)
server-ops-mcp setup --host <ip>        # One-time VPS provisioning
server-ops-mcp info                     # Show setup info and management guide
server-ops-mcp info --name my-vps       # Info for a specific host

Configuration

Setup (Recommended)

Use server-ops-mcp setup — handles everything automatically.

Manual Config

Create ~/.config/devops-mcp/config.json:

{
  "hosts": {
    "my-server": {
      "host": "1.2.3.4",
      "username": "mcp-agent",
      "port": 22,
      "key_path": "~/.ssh/server-ops-my-server"
    }
  },
  "default_host": "my-server",
  "enabled_categories": ["ssh", "docker", "utility"],
  "github": {
    "token": "ghp_..."
  }
}

Environment Variables

export DEVOPS_MCP_HOST=1.2.3.4
export DEVOPS_MCP_USER=root
export DEVOPS_MCP_KEY=~/.ssh/id_ed25519
export DEVOPS_MCP_GITHUB_TOKEN=ghp_...

MCP Client Setup

opencode

{
  "mcpServers": {
    "server-ops": {
      "command": "server-ops-mcp"
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "server-ops": {
      "command": "server-ops-mcp"
    }
  }
}

Cursor

{
  "mcpServers": {
    "server-ops": {
      "command": "server-ops-mcp"
    }
  }
}

Security

How it works

  1. server-ops-mcp setup runs once in your terminal (not in the agent)
  2. Creates a dedicated mcp-agent user on your VPS
  3. Configures NOPASSWD sudo for service commands only
  4. Generates SSH keypair — private key stays on your machine
  5. Password is never stored or passed to the agent

Remove access

# On the VPS
sudo userdel -r mcp-agent
sudo rm /etc/sudoers.d/mcp-agent

Add password to user (if needed later)

# On the VPS
sudo passwd mcp-agent

Rotate SSH key

# On your machine
server-ops-mcp setup --host 1.2.3.4 --name my-vps

Tools (48 total)

Meta-tools (always loaded)

Tool Description
list_categories List available tool categories and their status
enable_category Enable a category, registering its tools
disable_category Disable a category, removing its tools
search_tools Search across all categories (including disabled)

SSH (9 tools)

Tool Description
ssh_exec Run a command on the remote host
ssh_upload Upload file content via SFTP
ssh_download Download a file via SFTP
ssh_file_read Read a remote file (with offset/limit)
ssh_file_write Write a remote file (overwrite)
ssh_file_edit Edit a remote file (exact string replacement)
ssh_provision_user Create Linux user + push SSH key
ssh_unlock_admin Unlock sudo session (15-min TTL)
ssh_lock_admin Lock sudo session

Docker (6 tools)

Tool Description
docker_exec_cmd Run command in a container
docker_logs_cmd Get container logs
docker_ps_cmd List containers
docker_start_cmd Start a container
docker_stop_cmd Stop a container
docker_restart_cmd Restart a container

Services (7 tools)

Tool Description
service_status Get systemd service status
service_start Start a systemd service
service_stop Stop a systemd service
service_restart Restart a systemd service
service_logs Get service logs via journalctl
nginx_test Test nginx configuration
nginx_reload Reload nginx (tests config first)

Monitoring (6 tools)

Tool Description
health_check_http HTTP health check from remote host
health_check_tcp TCP connectivity check from remote host
tail_logs Tail logs from journalctl or file
disk_usage Get disk usage (df -h)
memory_usage Get memory usage (free -m)
process_list Get top processes by CPU

GitHub (7 tools)

Tool Description
github_list_issues List issues in a repo
github_get_issue Get issue details with comments
github_comment_issue Comment on an issue
github_close_issue Close an issue
github_list_pulls List pull requests
github_create_deployment Create a GitHub deployment
github_create_deployment_status Create deployment status

Deploy (5 tools)

Tool Description
deploy_git_pull Deploy by pulling latest code
deploy_docker_compose Deploy with docker compose
deploy_status Check current deployed version
rollback_git Rollback to previous git commit
rollback_docker_compose Rollback docker compose deployment

Utility (4 tools)

Tool Description
server_info OS, uptime, kernel info
list_hosts List configured SSH hosts
add_host Add a new SSH host
remove_host Remove an SSH host

Development

pip install -e ".[dev]"
ruff check src/
pytest

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

server_ops_mcp-0.1.9.tar.gz (51.3 kB view details)

Uploaded Source

Built Distribution

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

server_ops_mcp-0.1.9-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file server_ops_mcp-0.1.9.tar.gz.

File metadata

  • Download URL: server_ops_mcp-0.1.9.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for server_ops_mcp-0.1.9.tar.gz
Algorithm Hash digest
SHA256 75e0b17c370521ca4c9f41fad8fc171db7080f39af91be22a689c37cd13e9f7c
MD5 707545ee7bdd5181f84cf740aef9cbe1
BLAKE2b-256 58e2abdbeb5b3d38881f1d6d46bdeb2c53414d7d765874447536c56a9bff8adf

See more details on using hashes here.

Provenance

The following attestation bundles were made for server_ops_mcp-0.1.9.tar.gz:

Publisher: publish.yml on Me-Baran/devops-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file server_ops_mcp-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: server_ops_mcp-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for server_ops_mcp-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f8a241b6ef4880ea8b798a6e4100d146826ad5c99954b4b60d49f665287d8e90
MD5 2042a610ea7475825ad17b0b3b74e023
BLAKE2b-256 cd2bd628ff96f6805b3d1302ab97326cda34d1210f8d841c950a58ee206b2906

See more details on using hashes here.

Provenance

The following attestation bundles were made for server_ops_mcp-0.1.9-py3-none-any.whl:

Publisher: publish.yml on Me-Baran/devops-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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