Skip to main content
Glama
README.md
<div align="center">

# Ansible Safe MCP

**Run approved Ansible changes from Claude or Codex under a rollback timer.**

![Status](https://img.shields.io/badge/status-0.4%20preview-d29922)
![Ansible](https://img.shields.io/badge/ansible--core-2.17%2B-EE0000)
[![Galaxy](https://img.shields.io/badge/galaxy-mureev.confirmed-EE0000?logo=ansible&logoColor=white)](https://galaxy.ansible.com/ui/repo/published/mureev/confirmed/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

<img src="docs/hero.svg" width="760" alt="On the host's clock: arm at 21:04, apply, SSH lost at 21:05, deadline at 21:14. With block/rescue the undo waits on the controller and the host is still changed at the deadline. With ansible-safe-mcp the undo was armed on the host for a 10-minute window, and the host is restored at the deadline.">

Claude or Codex writes the playbook and can show you a diff. On Linux, confirmation comes before the remote dry run and the change runs under a timer that lives on the host.<br>
To install it, give your agent this link:

```
https://github.com/mureev/ansible-safe-mcp
```

</div>

---

## Why it's safe

The fear that stops people from letting an agent near their servers is specific: *it changes something, loses the
connection, and nobody can get back in.* Ansible's own safety net can't catch that, because the rescue runs on the
machine that just lost the connection. Network gear solved this long ago with *commit confirmed*: apply, start a
timer on the device, and roll back unless someone reconnects and says "keep it". This brings that to every host
Ansible can reach (Linux: a systemd timer; Windows: a SYSTEM task; macOS: a LaunchDaemon; RouterOS: Safe Mode;
OpenWrt: a timer in RAM), and puts four more gates in front of it:

<img src="docs/gates.svg" width="760" alt="Five steps: inspect through the look account, validate the playbook, approve its version, arm an on-host snapshot and timer, then verify the change. If verification fails, the guard attempts to restore the snapshot.">

The timer restores the files and settings covered by the platform's snapshot. Linux MCP apply uses systemd
and cgroup v2 to stop the job's own workers before restoring files. Keep mutating workers in the foreground
so they stay with the job. Package changes, existing services, external calls and data outside the snapshot
need their own recovery procedure. Leave enough window for the longest step and its verification.

The approval binds the captured project files, inventory and declared external assets. An apply's dry run and
execution use the same captured files. Playbooks use relative paths for controller-side assets in the project
or declared in `approve_also`. Controller isolation is a separate area of work.

## Is it for you?

You run a few servers, routers or PCs over SSH and want Claude to do the chores: patch, fix, look into why the disk
filled up. It works on **Linux, Windows, macOS, MikroTik RouterOS and OpenWrt**, directly or through a jump host,
from the Claude desktop app (chat or Cowork) or OpenAI Codex on a Mac. If you have Ansible Automation Platform, Red Hat's own MCP server fits better
([the other options](AGENTS.md#why-not-the-standard-options)).

The timers also work without Claude: [`mureev.confirmed`](https://galaxy.ansible.com/ui/repo/published/mureev/confirmed/)
is a plain Ansible collection on Galaxy.

## For agents

To check whether your MCP client displays an approval card, ask it to run `approval_probe`. The test contacts no
hosts. It reports whether the client returned an explicit decision, declined, or timed out.
Set `ASM_CHAT_APPROVALS=1` in Codex to show the server's confirmations in chat. Existing approval rules and
rollback protections still apply. [In-chat approvals](docs/chat-approval.md)

Everything an agent needs, to install it and then to use it, is in **[AGENTS.md](AGENTS.md)**. Read it before installing.

## License

MIT. Ansible® is a registered trademark of Red Hat, Inc. This project is not affiliated with or endorsed by Red Hat.

TDQS

A3.9/5.0

Scored across 10 tools

Disambiguation4/5

Most tools have a clearly distinct role: hosts manages inventory, look reads host state, plan is dry-run, apply executes with the safety net, job follows/reverts runs, and backup pulls configs. The main soft spots are look vs. status (host reads vs. server state, though descriptions clarify), hands vs. apply (one-off vs. playbook, with explicit 'prefer a real playbook' guidance), and the niche approval_probe, which reads like a diagnostic rather than a normal workflow tool.

Naming Consistency3/5

All names are lowercase, so there is no camelCase/snake_case chaos, but the convention is semantically mixed: resource nouns (hosts, status, backup, playbook, job), bare verbs (look, plan, apply), one metaphorical term (hands), and one snake_case compound (approval_probe). An agent cannot infer a pattern such as verb_noun, so selection relies entirely on descriptions.

Tool Count4/5

Ten tools is a well-scoped size for an orchestration server covering inventory, read, plan, apply, jobs, backup, and file management. Every tool maps to a real workflow step, with approval_probe being the only borderline addition since it exists purely to test client approval-card behavior.

Completeness5/5

The surface covers the full lifecycle: host add/rename/remove/setup, read-only inspection, dry-run planning, execution with revert, one-off changes, job follow-up/extension/revert, config backups, and playbook/check-script authoring with lint. Remaining gaps (e.g., explicit approval revocation or backup pruning, both partially covered via status/backup paths) are minor and unlikely to dead-end an agent.

Maintenance

ActivityMaintained
ResponsivenessOutdated data