Human-in-the-loop approval gateway for AI agents over MCP: request, decide, approve.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Human-in-the-loop approval system for AI agents.
Agents request. Policies decide. Humans approve.
Keep humans in control of what AI agents can do.
Your AI agent wants to send an email, delete a file, or deploy to production. Should it? AgentGate lets you define policies that auto-approve safe actions, auto-deny dangerous ones, and route everything else to a human — via dashboard, Slack, Discord, or email.
docker-compose up for the full stackDrop AgentGate into an MCP client (Claude Desktop / Cursor / VS Code) — point it at the gateway:
See all pending requests at a glance, color-coded by urgency so you know what needs attention first.

Review, approve, or deny requests — filter by status to focus on what matters.

Search through every decision with filters for event type, action, actor, and date range.

Drill into any request to see parameters, context, timeline, and audit trail — with one-click Approve/Deny buttons.

Manage API keys with fine-grained scopes, rate limits, and usage tracking. Create, edit, or revoke keys from the dashboard.

Configure webhook endpoints for real-time notifications. Add URLs, pick events, and let AgentGate handle retries automatically.

Sign in with your API key — create one via the CLI or ask your admin.

Save the API key - it's shown once only! Set it in your environment:
In a new terminal (with API key set):
Visit http://localhost:5173 to view and manage approval requests.
| Package | Description | Docs |
|---|---|---|
@agentkitai/agentgate-core | Types, schemas, policy engine | - |
@agentkitai/agentgate-server | Hono API server | - |
@agentkitai/agentgate-sdk | TypeScript SDK for agents | README |
@agentkitai/agentgate-cli | Command-line interface | - |
@agentkitai/agentgate-mcp | MCP server for Claude Desktop | - |
@agentkitai/agentgate-slack | Slack bot integration | README |
@agentkitai/agentgate-discord | Discord bot integration | README |
@agentkitai/agentgate-dashboard | React web dashboard | - |
AgentGate includes a command-line interface for managing approval requests.
Configure the CLI with your server URL and API key:
Configuration is stored in ~/.agentgate/config.json. You can also use environment variables:
| Command | Description |
|---|---|
agentgate config show | Show current configuration |
agentgate config set <key> <value> | Set a configuration value |
agentgate request <action> | Create a new approval request |
agentgate status <id> | Get status of a request |
agentgate list | List approval requests |
agentgate approve <id> | Approve a pending request |
agentgate deny <id> | Deny a pending request |
AgentGate includes a Model Context Protocol (MCP) server for integration with Claude Desktop and other MCP-compatible clients.
Add to your claude_desktop_config.json:
| Tool | Description |
|---|---|
agentgate_request | Submit a new approval request |
agentgate_get | Get the status of an approval request by ID |
agentgate_list | List approval requests with optional filters |
agentgate_decide | Approve or deny a pending request |
agentgate_list_policies | List all policies ordered by priority |
agentgate_create_policy | Create a new policy with rules |
agentgate_update_policy | Replace an existing policy |
agentgate_delete_policy | Delete a policy by ID |
agentgate_list_audit_logs | List audit log entries with filters and pagination |
agentgate_get_audit_actors | Get unique actor values from audit logs |
AgentGate uses API keys for authentication. All API requests (except /health) require a valid API key.
| Scope | Description |
|---|---|
admin | Full access to all operations |
request:create | Create new approval requests |
request:read | Read approval requests |
request:decide | Approve or deny requests |
webhook:manage | Create/update/delete webhooks |
HTTP Header:
SDK:
| Method | Endpoint | Description | Required Scope |
|---|---|---|---|
POST | /api/requests | Create approval request | request:create |
GET | /api/requests | List requests (with filters) | request:read |
GET | /api/requests/:id | Get request by ID | request:read |
POST | /api/requests/:id/decide | Submit approval/denial | request:decide |
GET | /api/requests/:id/audit | Get audit trail | request:read |
GET | /api/policies | List policies | admin |
POST | /api/policies | Create policy | admin |
PUT | /api/policies/:id | Update policy | admin |
DELETE | /api/policies/:id | Delete policy | admin |
POST | /api/api-keys | Create API key | admin |
GET | /api/api-keys | List API keys | admin |
PATCH | /api/api-keys/:id | Update API key | admin |
DELETE | /api/api-keys/:id | Revoke API key | admin |
GET | /api/webhooks | List webhooks | webhook:manage |
POST | /api/webhooks | Create webhook | webhook:manage |
DELETE | /api/webhooks/:id | Delete webhook | webhook:manage |
GET | /health | Health check | (none) |
AgentGate supports per-API-key rate limiting to prevent abuse and ensure fair usage.
429 Too Many Requests| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per minute |
X-RateLimit-Remaining | Remaining requests in current window |
X-RateLimit-Reset | Seconds until window resets |
Set rate limits when creating or updating API keys:
Rate limits can also be managed from the web dashboard under Settings → API Keys.
AgentGate can notify external systems when request events occur.
| Event | Description |
|---|---|
request.created | A new approval request was created |
request.decided | A request was approved or denied |
request.expired | A request expired without decision |
If you provide a secret, requests are signed with HMAC-SHA256:
Verify by computing HMAC-SHA256(secret, body) and comparing.
Failed webhook deliveries are retried automatically with exponential backoff. The server scans for pending deliveries and retries them with increasing delays (2^attempts * 1000ms) until successful or the maximum retry count is reached.
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port |
DATABASE_URL | ./data/agentgate.db | SQLite database path |
AGENTGATE_API_KEY | - | API key for SDK/CLI |
SLACK_BOT_TOKEN | - | Slack bot token (for Slack integration) |
SLACK_SIGNING_SECRET | - | Slack signing secret |
DISCORD_BOT_TOKEN | - | Discord bot token (for Discord integration) |
DISCORD_DEFAULT_CHANNEL | - | Default Discord channel for notifications |
_FILE suffix)For Docker secrets or Kubernetes secret mounts, AgentGate supports a _FILE suffix convention. Instead of setting a secret directly in an environment variable, point to a file containing the value:
| Variable | Reads secret from file |
|---|---|
ADMIN_API_KEY_FILE | Sets ADMIN_API_KEY |
JWT_SECRET_FILE | Sets JWT_SECRET |
DATABASE_URL_FILE | Sets DATABASE_URL |
REDIS_URL_FILE | Sets REDIS_URL |
SLACK_BOT_TOKEN_FILE | Sets SLACK_BOT_TOKEN |
SLACK_SIGNING_SECRET_FILE | Sets SLACK_SIGNING_SECRET |
DISCORD_BOT_TOKEN_FILE | Sets DISCORD_BOT_TOKEN |
SMTP_PASS_FILE | Sets SMTP_PASS |
Behavior:
_FILE variant are set, the explicit env var takes precedenceExample with Docker Compose:
Policies are stored in the database and can be managed via API:
AgentGate provides Docker images for easy self-hosted deployments.
Host ports are configurable via
SERVER_PORT(default3002) andDASHBOARD_PORT(default3003); both map to the container's internal port 3000/80.
| Service | Description | Host Port |
|---|---|---|
server | AgentGate API server | 3002 |
dashboard | Web dashboard (nginx) | 3003 |
postgres | PostgreSQL database | internal only* |
redis | Redis (rate limiting, queues) | internal only* |
* PostgreSQL and Redis are on an internal Docker network (
agentgate-internal) and are not exposed to the host by default. During development,docker-compose.override.ymlis auto-loaded and exposes them on ports 5432/6379. For production, rundocker-compose -f docker-compose.yml up -dto skip the override.
To include the bot services, use the bots profile:
All configuration is done via environment variables. See .env.example for all options.
Required variables:
ADMIN_API_KEY — Admin API key (min 16 characters)Recommended for production:
JWT_SECRET — JWT signing secret (min 32 characters)CORS_ALLOWED_ORIGINS — Restrict to your domain(s)POSTGRES_PASSWORD — Use a strong passwordBuild all images locally:
Build a specific service:
Migrations run automatically when the server starts. For manual control:
AgentGate uses Vitest for testing across all packages.
Coverage reports are generated per-package and include line, branch, and function coverage.
Contributions are welcome! To get started:
pnpm install)pnpm build && pnpm test to verify everything worksPlease make sure all tests pass and code is formatted (pnpm format:check && pnpm lint) before submitting.
| Project | Description | |
|---|---|---|
| AgentLens | Observability & audit trail for AI agents | |
| Lore | Cross-agent memory and lesson sharing | |
| AgentGate | Human-in-the-loop approval gateway | ⬅️ you are here |
| FormBridge | Agent-human mixed-mode forms | |
| AgentEval | Testing & evaluation framework | |
| agentkit-cli | Unified CLI orchestrator |
MIT
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agentgate)<a href="https://allmcps.com/mcp/agentgate"><img src="https://allmcps.com/api/badge/agentgate?style=directory" alt="AgentGate on AllMCPs" /></a>