AgentGuard MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentGuard MCPshow pending approval requests for sensitive actions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentGuard MCP
Identity-aware authorization for AI agents.
AgentGuard MCP is a protected Model Context Protocol server that gives AI agents distinct machine identities, enforces least-privilege OAuth permissions, applies contextual authorization policy, and pauses sensitive actions for authenticated human approval before execution.
It is the authorization backend for AgentGuard.
Live product: https://agentguard-eight.vercel.app
Why AgentGuard?
Giving an AI agent access to a tool is easy.
Controlling which agent can use which tool, under what conditions, and when a human must intervene is harder.
AgentGuard separates those concerns:
Auth0 authenticates machine and human identities.
OAuth scopes define what each machine identity is allowed to request.
AgentGuard policy evaluates the context of the action.
Human approval gates higher-risk operations.
Supabase persists approval state and security audit events.
MCP exposes the protected tools to AI runtimes.
An agent can therefore be authenticated without automatically being trusted to perform every action.
Related MCP server: gov-mcp
Architecture
flowchart LR
A[AI Agent] --> B[Auth0 Machine Identity]
B --> C[OAuth Access Token]
C --> D[AgentGuard MCP Server]
D --> E{Required Scope?}
E -->|Missing| F[DENY]
E -->|Granted| G[Contextual Policy]
G -->|Low Risk| H[ALLOW]
G -->|Sensitive| I[APPROVAL_REQUIRED]
G -->|Forbidden| F
I --> J[(Supabase Approval)]
J --> K[Auth0 Human Login]
K --> L{Human Decision}
L -->|Approve| M[APPROVED]
L -->|Deny| N[DENIED]
M --> O[Agent Retries Approved Action]
O --> P[Identity + Approval Verification]
P --> Q[Execute Once]
F --> R[(Audit Events)]
H --> R
I --> R
N --> R
Q --> RSecurity Model
AgentGuard uses two distinct identity classes.
Machine identities
Each autonomous runtime receives a separate Auth0 Machine-to-Machine identity.
Example demo identities:
Runtime | Purpose | Granted scopes |
Sales Agent | Revenue operations |
|
Finance Agent | Finance operations |
|
Admin Runtime | Administrative automation |
|
A Sales Agent cannot issue refunds simply because another agent can.
The authorization layer checks the scopes carried by the caller's OAuth access token before the protected tool is executed.
Human identities
Human operators authenticate separately through an Auth0 Regular Web Application in the AgentGuard dashboard.
Machine identities and human identities are intentionally separated.
A sensitive request may therefore look like:
Finance Agent
↓
Authenticated machine identity
↓
finance:refund scope
↓
Contextual policy
↓
APPROVAL_REQUIRED
↓
Authenticated human administrator
↓
APPROVED
↓
Finance Agent executes approved actionAuthorization Layers
AgentGuard applies authorization in layers.
1. Authentication
The MCP server validates the Auth0 access token and establishes the caller's identity.
2. OAuth scope authorization
Protected tools declare the scopes required to call them.
Example:
@require_scopes(["finance:refund"])If the caller does not have the required scope, execution stops immediately.
3. Contextual policy
Passing the OAuth check does not automatically authorize execution.
AgentGuard evaluates the context of the requested action.
Current demo rules include:
Refund <= $500
→ ALLOW
Refund > $500
→ APPROVAL_REQUIRED
Customer data export
→ APPROVAL_REQUIRED
Customer deletion
→ DENY4. Human approval
Sensitive operations are written to the approval store and paused.
A separately authenticated human can approve or deny the request through the AgentGuard dashboard.
5. Approval-bound execution
An approved action can only be executed by the machine identity that originally requested it.
AgentGuard checks:
approval exists
approval status is
APPROVEDapproval belongs to the requesting identity
approval action matches the requested tool
approval has not already been executed
6. Replay protection
After successful execution:
APPROVED
→ EXECUTEDA second execution attempt is denied and recorded as a security event.
Demonstrated Security Cases
The project includes three persisted scenarios that are also visible in the public AgentGuard demo.
Human approved
Finance Agent
→ finance:refund scope verified
→ requests $750 refund
→ policy requires approval
→ human administrator approves
→ Finance Agent executes
→ ALLOW
→ approval becomes EXECUTEDHuman denied
Finance Agent
→ finance:refund scope verified
→ requests $750 refund
→ policy requires approval
→ human administrator denies
→ Finance Agent attempts execution
→ DENYScope blocked
Sales Agent
→ attempts issue_refund
→ missing finance:refund
→ DENY
Contextual policy is never evaluated.
Human review is never reached.This demonstrates the difference between:
authentication
authorization
contextual policy
human control
MCP Tools
The current demo exposes five protected MCP tools.
search_accounts
Search CRM accounts.
Required scope:
crm:readissue_refund
Request or execute a refund depending on policy.
Required scope:
finance:refundPolicy:
amount <= $500 → ALLOW
amount > $500 → APPROVAL_REQUIREDlist_pending_approvals
Lists approval requests waiting for review.
Required scope:
agent:manageapprove_action
Administrative MCP approval path used during machine-runtime testing.
Required scope:
agent:manageThe portfolio application also supports a preferred human approval path through the Auth0-protected Next.js dashboard.
execute_approved_refund
Executes an already-approved refund.
Required scope:
finance:refundThe server verifies the approval belongs to the calling machine identity before execution.
Approval Lifecycle
Approval records use four states:
PENDING
APPROVED
DENIED
EXECUTEDTypical successful lifecycle:
PENDING
↓
APPROVED
↓
EXECUTEDDenied lifecycle:
PENDING
↓
DENIEDReview and approval are stored separately.
This allows AgentGuard to represent:
DENIED
reviewed_by = Human Administrator
approved_by = nullwithout incorrectly treating a human denial as an approval.
Audit Events
AgentGuard records authorization and policy decisions in Supabase.
Example events include:
ALLOW
DENY
APPROVAL_REQUIRED
APPROVEDSecurity metadata can include:
granted scopes
missing scopes
authorization failures
approval IDs
requesting identity
action context
replay attempts
human reviewer
account/resource identifiers
Example scope failure:
{
"action": "issue_refund",
"decision": "DENY",
"required_scope": "finance:refund",
"reason": "Missing required scopes: ['finance:refund']",
"metadata": {
"granted_scopes": [
"crm:read",
"crm:write",
"support:read"
],
"missing_scopes": [
"finance:refund"
],
"security_event": "authorization_failure"
}
}Secrets and access tokens should never be written to the audit log.
Repository Structure
agentguard-mcp/
│
├── database/
│ └── schema.sql
│
├── src/
│ ├── auth0/
│ │ ├── __init__.py
│ │ ├── authz.py
│ │ ├── errors.py
│ │ └── middleware.py
│ │
│ ├── approvals.py
│ ├── audit.py
│ ├── config.py
│ ├── database.py
│ ├── policy.py
│ ├── server.py
│ ├── tools.py
│ └── __init__.py
│
├── .env.example
├── .gitignore
├── pyproject.toml
└── README.mdDatabase
AgentGuard currently uses Supabase/Postgres for:
approvals
Stores sensitive requests and their review lifecycle.
Important fields include:
requesting_identity
action
payload
reason
status
reviewed_by
reviewed_at
approved_by
approved_at
executed_ataudit_events
Stores security decisions and execution context.
Important fields include:
identity
action
decision
required_scope
reason
approval_id
metadata
created_atRow Level Security is enabled on both tables.
No public browser policies are created.
Trusted AgentGuard server components access the database using server-only credentials.
See:
database/schema.sqlLocal Setup
Requirements
Python 3.10+
Auth0 tenant
Supabase project
Auth0 Machine-to-Machine applications
Auth0 API configured for the MCP resource
Clone
git clone https://github.com/haisamar/agentguard-mcp.git
cd agentguard-mcpCreate a virtual environment
Windows:
python -m venv .venv
.\.venv\Scripts\Activate.ps1macOS/Linux:
python -m venv .venv
source .venv/bin/activateInstall dependencies
Using Poetry:
pip install poetry
poetry installOr install the required dependencies manually if preferred.
Configure environment
Copy:
.env.exampleto:
.envand configure your own credentials.
Never commit .env.
Required Environment Variables
AUTH0_DOMAIN=
AUTH0_AUDIENCE=http://localhost:3001/
MCP_SERVER_URL=http://localhost:3001/
PORT=3001
SALES_AGENT_CLIENT_ID=
SALES_AGENT_CLIENT_SECRET=
FINANCE_AGENT_CLIENT_ID=
FINANCE_AGENT_CLIENT_SECRET=
ADMIN_AGENT_CLIENT_ID=
ADMIN_AGENT_CLIENT_SECRET=
SUPABASE_URL=
SUPABASE_SECRET_KEY=Auth0 API Permissions
The AgentGuard API currently defines permissions including:
crm:read
crm:write
support:read
support:write
finance:read
finance:refund
customer:export
agent:manageMachine-to-Machine applications should receive only the permissions needed for their role.
Run the MCP Server
From the repository root:
python -m src.serverDefault server:
http://localhost:3001/MCP endpoint:
http://localhost:3001/mcpProtected-resource metadata:
http://localhost:3001/.well-known/oauth-protected-resourceTesting With MCP Inspector
Start the MCP Inspector:
npx -y @modelcontextprotocol/inspectorConnect using:
Transport:
Streamable HTTP
URL:
http://localhost:3001/mcpUse an Auth0 Machine-to-Machine access token in the authorization header:
Authorization: Bearer <ACCESS_TOKEN>Do not commit or expose access tokens.
Frontend
The companion AgentGuard product interface is available here:
Repository
https://github.com/haisamar/agentguard
Live demo
https://agentguard-eight.vercel.app
It provides:
public product page
sanitized public security demo
Auth0-protected administrator dashboard
human approve/deny controls
machine vs human identity visualization
authorization trace explorer
interactive security-event inspection
approval history
Technology
AgentGuard combines:
Auth0
OAuth 2.0
Model Context Protocol
Python
FastMCP
Starlette
Supabase / PostgreSQL
Next.js
Human-in-the-loop authorizationDesign Principle
AgentGuard is based on a simple idea:
An AI agent being authenticated should not mean it has unlimited authority.
Authentication proves who the agent is.
OAuth scopes determine what category of actions it may request.
Contextual policy determines whether that specific action can execute autonomously.
Human approval provides a separate identity boundary for high-risk decisions.
Current Scope
AgentGuard is a portfolio security prototype rather than a production IAM platform.
Current limitations intentionally include:
demo policy rules are defined in code
machine identities are mapped to demo roles
the MCP backend is designed for controlled/local deployment
human admin authorization currently uses an application-level administrator allowlist
policy management is not yet exposed through a control plane
audit-event immutability is not enforced at the database layer
distributed locking for concurrent execution is outside the current demo scope
These boundaries are intentionally documented rather than hidden.
Possible Extensions
Future versions could add:
Auth0 role-based human administration
policy-as-code
policy versioning
agent identity registry
workload identity federation
delegated authorization
time-limited approvals
resource-level authorization
approval expiration
organization-level isolation
signed audit events
SIEM export
policy simulation
production MCP deployment
additional MCP tools and resource servers
Related Project
AgentGuard frontend:
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
- AlicenseNot gradedqualityDmaintenanceProvides a secure gRPC transport layer for the Model Context Protocol (MCP) with mutual TLS, token-based authentication, and fine-grained authorization. Includes comprehensive telemetry and a real-time visualization dashboard for monitoring AI model interactions and security events.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enforces runtime governance on AI agent actions — file access, command execution, delegation chains, and permission escalation.MIT
- AlicenseNot gradedqualityCmaintenanceA governed, audited Model Context Protocol server that provides AI agents with secure, read-only access to a clinical knowledge base through least-privilege tools, policy validation, and append-only audit logging.MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that provides a security gateway for AI agents, enforcing allow/confirm/deny policies on tool calls and requiring human approval for risky operations, with full audit logging.
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP-native Trust Infrastructure for AI Agents. Persistent encrypted memory with Trust Quotient.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
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/haisamar/agentguard-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server