# safeagent MCP server

> Prevents duplicate payments, webhooks, and side effects by providing an exactly-once execution guard for AI agents.

- Repository: https://github.com/azender1/SafeAgent
- Page: https://hostedmcp.org/servers/azender1/safeagent
- Transport: stdio
- Stars: 8
- License: Apache-2.0
- Latest version: 0.1.22

## Install

### Claude Code

```sh
claude mcp add safeagent -- uvx safeagent-exec-guard
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "safeagent": {
      "command": "uvx",
      "args": [
        "safeagent-exec-guard"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "safeagent": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "safeagent-exec-guard"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"safeagent","type":"stdio","command":"uvx","args":["safeagent-exec-guard"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "safeagent": {
      "command": "uvx",
      "args": [
        "safeagent-exec-guard"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add safeagent -- uvx safeagent-exec-guard
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.safeagent]
command = "uvx"
args = ["safeagent-exec-guard"]
```

### Gemini CLI

```sh
gemini mcp add -s user safeagent uvx -- safeagent-exec-guard
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "safeagent": {
      "command": "uvx",
      "args": [
        "safeagent-exec-guard"
      ]
    }
  }
}
```

## FAQ

### What is the difference between PENDING and COMMITTED status?

COMMITTED means the caller has successfully settled a receipt after the action fired, while PENDING means an action is unresolved due to a timeout or crash and remains blocked to prevent duplicates.

### Does SafeAgent guarantee the external outcome is successful?

No, it only proves the local claim state. End-to-end exactly-once effects still require provider-native idempotency or reconciliation with the provider's records.
