opsgate
Typed, policy-checked server operations for AI agents, with approvals and an audit log
- Pricing
- Open source
- Platforms
- CLI, self-hosted, Linux
- Runs
- Locally
- Version
- 0.1.3
- Listing updated
- 2 days ago
About opsgate
opsgate is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
The author's starting point was that most server-access tools for agents are a command string run over SSH with a denylist in front, and a denylist fails against rephrased or encoded input. Opsgate takes the opposite route: the agent never supplies a string to execute. It calls one of 25 typed tools such as service_status, docker_logs, journal_tail and file_read, and opsgate builds each command itself as an argv array.
On the local machine the argv goes straight to exec with no shell process at all. Over SSH, every element is single-quoted so a hostile service name stays one literal argument. Names are also limited to a conservative character set, and file_grep uses fixed-string matching rather than regex.
Every tool is classed as observe, mutate or shell and checked against the mode of the target host. In operate mode reads run freely, while writes such as nginx_reload ask a human first and show the exact command. Approved and refused calls are both written to a hash-chained audit log. With no config it starts read-only on the local machine, and opsgate init writes a starter config. It is written in Go.
Install
Run in a terminal
claude mcp add opsgate -- docker run -i --rm ghcr.io/polymatx/opsgate:0.1.3Add to claude_desktop_config.json
{
"mcpServers": {
"opsgate": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/polymatx/opsgate:0.1.3"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"opsgate": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/polymatx/opsgate:0.1.3"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"opsgate": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/polymatx/opsgate:0.1.3"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"opsgate": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/polymatx/opsgate:0.1.3"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"opsgate": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/polymatx/opsgate:0.1.3"
]
}
}
}Tools this server provides (11)
Taken from the project documentation; the running server may differ.
- service_status
- Check the status of a service by name
- docker_logs
- Read logs for a container
- journal_tail
- Tail the journal for a unit with since and priority filters
- file_read
- Read a file at a path
- nginx_test
- Validate the nginx configuration on a host
- nginx_reload
- Reload nginx after approval
- listening_ports
- List listening ports and owning processes
- service_list
- List services by state
- disk_usage
- Report disk usage
- file_grep
- Search files with a literal fixed-string pattern
- service_restart
- Restart a service, refused in observe mode
What it does
- Typed tools, no shell
- 25 named tools replace a free-form command string, so the agent only fills in typed arguments.
- Argv-built commands
- Commands are assembled as argument arrays and single-quoted over SSH, so injected text stays one literal word.
- Per-host modes
- Each tool is classed observe, mutate or shell and checked against the mode set for the host it targets.
- Human approval prompts
- In operate mode, writes ask for approval and show the exact command before it runs.
- Hash-chained audit log
- Approved calls and refusals are both recorded in a tamper-evident log.
- Zero-config start
- Runs read-only on the local machine with no config file, defaulting to observe mode.
Good for
- Ask an agent what is filling the disk or listening on a port without giving it a shell
- Diagnose nginx 502 errors from journal and container logs
- Reload a service after a config change with a human approving the exact command
- Keep a reviewable record of every action and refusal an agent made on a server
- Let a team try agent-assisted ops on a read-only host first
Pricing
Open source
Free; the repository has a licence file and no paid plan is mentioned
Prices change. Check polymatx.dev before you buy.
opsgate FAQ
Does the agent get a shell?
No. It calls typed tools and opsgate builds each command as an argv array, so there is no command string to fill in.
What happens if I deny an approval?
Nothing runs and the agent is told the operator refused. The refusal is recorded in the audit log.
Can I try it without configuring a server?
Yes. `opsgate serve` runs with no config, on the local machine, in read-only observe mode.
How is it installed?
The README shows `go install github.com/polymatx/opsgate/cmd/opsgate@latest`, and the registry also lists an OCI image over stdio.
Is opsgate free?
Yes. opsgate is open source, so you can use and self-host it for free.
How do I add opsgate to Claude Code?
Run this command in your terminal: claude mcp add opsgate -- docker run -i --rm ghcr.io/polymatx/opsgate:0.1.3
What are the best alternatives to opsgate?
The closest alternatives to opsgate are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to opsgate

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools