agent-guard-mcp
Enables instant approval notifications and links for high-risk operations through Telegram bot integration, allowing human approval via Telegram.
agent-guard-mcp
MCP Guard Server — Budget control, approval workflows, and audit logging for AI agents.
Works with Claude Code, Cursor, ChatGPT, and any AI agent that speaks the MCP protocol.
Features
Budget Control — Daily credits hard limit prevents agent overspending
High-Risk Approval — Operations exceeding amount threshold or matching sensitive resource keywords trigger human approval
Approval Workflow — Agent requests → token generated → human approves via Dashboard or Telegram
Audit Log — All spend, approval, and rejection actions recorded with cursor-based pagination
Web Dashboard — Gin + HTMX + Tailwind real-time dashboard
Telegram Notifications — Instant approval links for high-risk operations
Multi-Transport — stdio / SSE / StreamableHTTP with automatic detection
Related MCP server: Guardpost MCP Server
MCP Tools
Tool | Description |
| Query today's budget status |
| Execute a spend (auto-detects high-risk) |
| Explicitly request human approval |
| Approve a pending token |
| Reject a pending token |
| Poll approval status |
| Query audit log with filtering and pagination |
| List all pending approval requests |
Quick Start
Requirements
Go 1.24+
No CGO required (pure Go SQLite driver)
Build from Source
git clone https://github.com/dygogogo/agent-guard-mcp.git
cd agent-guard-mcp
go build -o mcp-guard main.goDownload Pre-built Binary
Download the latest release for your platform:
Platform | amd64 | arm64 |
macOS | ||
Linux | ||
Windows |
Or visit the latest release page.
Configuration
Configure via environment variables or .env file:
Variable | Description | Default |
| Transport: stdio / sse / http | Auto-detect (TTY → http) |
| Daily budget cap (credits) | 10.0 |
| High-risk amount threshold | 2.0 |
| High-risk resource keywords (comma-separated) | delete,send |
| SQLite database path | ./mcp-guard.db |
| Dashboard HTTP port | 8080 |
| Base URL for approval links | |
| Log level: debug/info/warn/error | info |
| Payer identity | hostname |
| Telegram Bot Token (optional) | - |
| Telegram Chat ID (optional) | - |
Running
# HTTP mode (auto-detected, with Dashboard)
./mcp-guard
# Dashboard: http://localhost:8080/dashboard
# MCP endpoint: http://localhost:8080/mcp
# stdio mode (for MCP clients)
MCP_TRANSPORT=stdio ./mcp-guard
# SSE mode
MCP_TRANSPORT=sse ./mcp-guard
# SSE endpoint: http://localhost:8080/sseClaude Code Integration
Add to Claude Code's MCP configuration:
{
"mcpServers": {
"agent-guard-mcp": {
"command": "mcp-guard",
"env": {
"MCP_TRANSPORT": "stdio",
"BUDGET_LIMIT": "10"
}
}
}
}Architecture
┌─────────────┐ MCP Protocol ┌────────────────┐
│ AI Agent │ ◄──────────────────► │ MCP Guard │
│ (Claude, │ stdio / HTTP │ Server │
│ Cursor...) │ │ │
└─────────────┘ │ ┌────────────┐ │
│ │ BudgetStore │ │
┌─────────────┐ HTTP │ │ (SQLite) │ │
│ Dashboard │ ◄──────────────────► │ └────────────┘ │
│ (Gin+HTMX) │ └────────────────┘
└─────────────┘
┌─────────────┐ Webhook
│ Telegram │ ◄────── Approval notifications
└─────────────┘Core Files
File | Description |
| Entry point, transport selection, graceful shutdown |
| MCP Server with 8 registered tools |
| BudgetStore interface + SQLite implementation |
| High-risk detection, approval workflow, Telegram |
| Environment config, auto transport detection |
| zap logging (stdio mode: file only) |
| Gin Web Dashboard |
Approval Workflow
1. Agent calls spend(amount=5.0, resource="/api/delete")
2. MCP Guard detects high-risk (amount > threshold OR resource keyword matched)
3. Returns {status: "pending_approval", token: "xxx"}
4. Agent polls check_approval(token) for status
5. Human approves/rejects via Dashboard or Telegram
6. Agent receives final result (approved/rejected/budget_exceeded)Testing
# All tests with race detection
go test -race -count=1 ./...
# Integration tests only
go test -race -run TestIntegration -v ./...
# Coverage
go test -race -cover ./...Tech Stack
Go 1.24 — Language
mcp-go — MCP protocol Go SDK
Gin — Web framework (Dashboard)
modernc.org/sqlite — Pure Go SQLite (no CGO)
zap — Structured logging
HTMX + Tailwind CSS — Dashboard frontend
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceMCP server for AI agent security guardrails. Provides input validation, prompt injection detection, PII redaction, output filtering, policy enforcement, rate limiting, and comprehensive audit logging.461MIT
- Flicense-qualityBmaintenanceRuntime agent firewall for PII redaction, rate limits, and policy enforcement, enabling autonomous agent security via MCP integration.
- Alicense-qualityDmaintenanceMCP server that provides runtime defense for AI agents, protecting against prompt injection, data exfiltration, and other adversarial attacks through a ranked pipeline of up to 36 inline defenses and 3 output scanners.3Apache 2.0

Outfitofficial
Alicense-qualityAmaintenanceAn MCP server that enforces agent persona permissions by acting as a gateway, scoping tool access and denying unauthorized capabilities.157MIT
Related MCP Connectors
Security Feeds MCP.
Paid remote MCP for agent design system guard MCP, structured receipts, audit logs, and reviewer-rea
MCP server for AgentDocs (agentdocs.eu): read, search, write, comment on & share Markdown docs.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dygogogo/agent-guard-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server