# AgentGuard

> AgentGuard is an open-source MCP server for finance and payments. Let an agent pay on NEAR through a vault whose rules a smart contract enforces. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://agentguard.app
- **Repository:** https://github.com/zaxcoraider/agentguard/tree/HEAD/packages/mcp
- **MCP Registry name:** io.github.zaxcoraider/agentguard-mcp
- **Categories:** finance and payments, security
- **Listing updated:** 2026-11-14

## About

AgentGuard moves spending rules out of the prompt and into a NEAR contract. The agent holds only a function-call key that can call request_payment, so it can ask to pay but cannot pay. The vault answers paid, pending (waits for the human owner) or blocked, with a reason and a transaction link.

The contract applies per-payment and daily caps, an allowlist, a hold on repeated payments and a lookup in a shared scam registry. If the registry does not answer, the payment is blocked. The owner can call lock_rules(), which is one-way: afterwards nobody can loosen the rules or withdraw. Without a key the MCP server runs read-only.

The documented setup targets NEAR testnet by default, with mainnet selectable through NEAR_NETWORK. It runs locally over stdio from the npm package, and the README walks through creating a vault in about two minutes.

## Features

- **Contract-enforced limits:** Caps, allowlist and repeat-payment holds are enforced on chain, not by the agent.
- **Address safety check:** Checks the scam registry, lookalike names and prompt-injection text before paying.
- **Owner approval path:** Held payments wait for the human owner to approve or deny.
- **Read-only mode:** Without an agent key the server only reads balances, policy and history.
- **Paid checks over HTTP 402:** Buys Sentinel's paid check through your vault, capped by max_price_near.

## Good for

- Let an agent pay small invoices with hard spending caps
- Screen a recipient address before sending funds
- Hold suspicious payment requests for owner review
- Audit recent paid, held and blocked payments

## Install

### Claude Code (Terminal)

```sh
claude mcp add agentguard-mcp --env AGENTGUARD_VAULT='<AGENTGUARD_VAULT>' --env AGENTGUARD_AGENT_KEY='<AGENTGUARD_AGENT_KEY>' -- npx -y @zaxcoraider/agentguard-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "agentguard-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zaxcoraider/agentguard-mcp"
      ],
      "env": {
        "AGENTGUARD_VAULT": "<AGENTGUARD_VAULT>",
        "AGENTGUARD_AGENT_KEY": "<AGENTGUARD_AGENT_KEY>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "agentguard-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zaxcoraider/agentguard-mcp"
      ],
      "env": {
        "AGENTGUARD_VAULT": "<AGENTGUARD_VAULT>",
        "AGENTGUARD_AGENT_KEY": "<AGENTGUARD_AGENT_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "agentguard-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@zaxcoraider/agentguard-mcp"
      ],
      "env": {
        "AGENTGUARD_VAULT": "<AGENTGUARD_VAULT>",
        "AGENTGUARD_AGENT_KEY": "<AGENTGUARD_AGENT_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "agentguard-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zaxcoraider/agentguard-mcp"
      ],
      "env": {
        "AGENTGUARD_VAULT": "<AGENTGUARD_VAULT>",
        "AGENTGUARD_AGENT_KEY": "<AGENTGUARD_AGENT_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "agentguard-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zaxcoraider/agentguard-mcp"
      ],
      "env": {
        "AGENTGUARD_VAULT": "<AGENTGUARD_VAULT>",
        "AGENTGUARD_AGENT_KEY": "<AGENTGUARD_AGENT_KEY>"
      }
    }
  }
}
```

## Tools

- `agentguard_pay`: Asks the vault to pay a recipient an amount in NEAR and returns paid, pending or blocked with the reason.
- `agentguard_check_address`: Checks whether an address is safe to pay and returns allow, warn or block.
- `agentguard_balance`: Shows balance, available funds, 24-hour spend and payment counts.
- `agentguard_policy`: Shows caps, approval threshold, allowlist, registry and lock state.
- `agentguard_payment_status`: Looks up one payment by id.
- `agentguard_history`: Lists recent payment requests, including blocked ones.
- `agentguard_sentinel_check`: Buys Sentinel's paid check over HTTP 402 through your vault.

## FAQ

### Which network does it use?

Testnet by default; set NEAR_NETWORK to mainnet to change it.

### Can the agent drain the vault?

The README says the agent's key can call only request_payment, and vaults are created with no full-access key.

### How do I install it?

Run claude mcp add agentguard -e AGENTGUARD_VAULT=<vault> -- npx -y @zaxcoraider/agentguard-mcp.

### What variables are required?

AGENTGUARD_VAULT is required; AGENTGUARD_AGENT_KEY enables payments.

### Is AgentGuard free?

Yes. AgentGuard is open source, so you can use and self-host it for free.

### How do I add AgentGuard to Claude Code?

Run this command in your terminal: claude mcp add agentguard-mcp --env AGENTGUARD_VAULT='<AGENTGUARD_VAULT>' --env AGENTGUARD_AGENT_KEY='<AGENTGUARD_AGENT_KEY>' -- npx -y @zaxcoraider/agentguard-mcp

### What are the best alternatives to AgentGuard?

The closest alternatives to AgentGuard are REA, Solana MCP by Vybe, Tapetide - Indian Stock Market MCP, Agent Roast and Midplane.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Solana MCP by Vybe](https://ai-powered.com/mcp/solana-mcp-by-vybe): Solana MCP by Vybe is an MCP server for finance and payments.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Budget Tracker](https://ai-powered.com/mcp/budget-tracker-2): Budget Tracker is a freemium MCP server for finance and payments.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/agentguard-3
