# polymatx/opsgate [Health: Active]

**Category:** 🖥️ Command Line  
**Repository:** https://github.com/polymatx/opsgate  
**GitHub Stars:** 2  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/polymatx-opsgate

## Description
Safety gate between AI agents and your servers: 25 typed tools (services, logs, Docker, disk, ports, files, nginx) that build their own argv, so the agent never passes a command string. Deny-by-default observe / operate / full modes per host, human approval for every change via MCP elicitation, and a hash-chained audit log that also records refusals. Local or over SSH with knownhosts verification.

## Tools
Capabilities this server exposes over MCP:

- **service_status**
- **journal_tail**
- **docker_ps**
- **disk_usage**
- **dir_list**
- **journal_errors**
- **docker_inspect**
- **service_list**

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/polymatx/opsgate), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
go install github.com/polymatx/opsgate/cmd/opsgate@latest
```

2. Add to Claude Code:

```sh
claude mcp add opsgate -- opsgate serve --config ~/.opsgate/config.yaml
```

## Documentation

## What polymatx/opsgate MCP server does

polymatx/opsgate places a policy and audit boundary between an MCP client and infrastructure. Instead of accepting an arbitrary shell command, it exposes typed operations whose arguments are used to construct the underlying process arguments. This prevents the agent from supplying a command string directly.

The server can work against the local machine or hosts reached through SSH. It supports infrastructure inspection and selected operations across system services, journald logs, Docker, disk usage, directories, listening ports, files, and nginx. Host policy is deny-by-default and can be set to observe, operate, or full mode.

## How it works

Read-only investigation uses tools such as `service_status`, `service_list`, `journal_tail`, `journal_errors`, `docker_ps`, `docker_inspect`, `disk_usage`, and `dir_list`. The broader tool set also covers ports, files, and nginx operations, including configuration testing and reloads.

In observe mode, state-changing requests are refused. In operate mode, a change pauses for human confirmation through MCP elicitation. The approval interface shows the host, requested operation, context, and generated command before execution. A denial is returned as a refusal and nothing runs.

Every attempt is written to an audit log, including policy refusals. The log uses hash chaining so entries can be linked in sequence. SSH connections use known-hosts verification.

## Setup and configuration

The binary requires Go 1.26 or newer when installed from source, and the documented quick start uses the latest Go install target:

```bash
go install github.com/polymatx/opsgate/cmd/opsgate@latest
opsgate serve
```

Running `opsgate serve` without a configuration file starts a local, read-only service. The default audit path is `~/.opsgate/audit.jsonl`. Use `opsgate init` to create a starter configuration at `~/.opsgate/config.yaml`.

MCP clients that can launch local processes can use stdio. Claude Code can register `opsgate serve` directly, while Claude Desktop, Cursor, and VS Code can configure the executable and an optional absolute config path. A Docker image is available as `ghcr.io/polymatx/opsgate`; mount the opsgate directory and SSH directory when the container must reach remote hosts.

For clients that cannot launch a local process, serve MCP over HTTP with `opsgate serve --http 127.0.0.1:8080`. Non-loopback HTTP binding requires `http.auth_token`, sent as a Bearer token. A TLS-terminating reverse proxy is recommended for remote access, and a VPN interface is safer than exposing the endpoint publicly.

## Tools and capabilities

- Inspect service state and enumerate services.
- Read recent journal entries and identify journal errors.
- List and inspect Docker containers.
- Check disk usage and list directories.
- Inspect listening ports.
- Work with files and nginx-related operations.
- Run locally or through SSH with known-hosts verification.
- Apply per-host observe, operate, or full modes.
- Require human approval for changes in operate mode.
- Record executions and refusals in a hash-chained JSONL audit log.

## Limitations and notes

The local default is observe mode, so it is suitable for inspection but refuses changes until policy is configured differently. HTTP deployment exposes an infrastructure-management API to the reachable network; the bearer token is its protection, so use a long random token, TLS, and network restrictions when publishing it. Operate-mode changes also require a person who can respond to the approval prompt, which makes unattended HTTP use a poor fit for mutation workflows.

_Full upstream README: https://allmcps.com/mcp/polymatx-opsgate/readme_

