MCP Server
AuthGate exposes an MCP (Model Context Protocol) server so AI coding assistants can manage your entire project — users, billing, organizations, roles, security, and more — all from natural language.
Supported clients
Any MCP-compatible client can connect to the AuthGate MCP server, including:
- Claude Code (Anthropic CLI)
- Cursor
- Windsurf
- Any client supporting the Streamable HTTP transport
Connect your AI assistant
You need an AuthGate API key. Find yours in the dashboard under your project settings.
claude mcp add --transport http authgate https://www.authgate.dev/api/mcp \
--header "Authorization: Bearer ag_live_xxx"
Replace ag_live_xxx with your actual API key. For project-wide sharing, add the .mcp.json file to your repository (use environment variable interpolation for the key).
Available tools (60)
Once connected, your AI assistant has access to the following tools:
Project
- Name
get_project_status- Type
- read
- Description
Returns the full project configuration: enabled auth providers, billing plans with prices, roles, and organizations.
- Name
get_sdk_setup_instructions- Type
- read
- Description
Returns framework-specific SDK integration code. Supports
nextjs,react,node,react-native, andflutter.
- Name
verify_token- Type
- read
- Description
Verifies a JWT token issued by AuthGate and returns the decoded claims. Useful for debugging auth flows.
End Users
- Name
list_end_users- Type
- read
- Description
List end users with pagination. Returns user details, password status, and email verification state.
- Name
get_end_user- Type
- read
- Description
Get a single end user by ID with linked accounts, password credential status, and MFA enrollment.
- Name
delete_end_user- Type
- danger
- Description
Permanently delete an end user and all associated data (cascading).
- Name
send_password_reset- Type
- write
- Description
Send a password reset email to an end user. Requires email, password credential, and a configured callback URL.
- Name
set_email_verified- Type
- write
- Description
Manually set or unset the email verified status for an end user.
- Name
resend_verification_email- Type
- write
- Description
Resend an email verification OTP to an end user with an unverified email.
Sessions
- Name
list_sessions- Type
- read
- Description
List active sessions, optionally filtered by end user ID.
- Name
get_session- Type
- read
- Description
Get full details of a specific session by ID.
- Name
revoke_session- Type
- write
- Description
Revoke (invalidate) an active session.
Organizations
- Name
list_orgs- Type
- read
- Description
List organizations with pagination. Returns each org with its member count.
- Name
get_org- Type
- read
- Description
Get a single organization with full details: members (with user info and role), pending invitations, and member count.
- Name
create_org- Type
- write
- Description
Create an organization with a name, slug, and optional member limit.
- Name
update_org- Type
- write
- Description
Update an organization's name, slug, image, member limit, or metadata. Supports partial updates with slug uniqueness validation.
- Name
delete_org- Type
- danger
- Description
Permanently delete an organization. Cascading deletes are handled by database foreign keys.
Organization Members
- Name
list_org_members- Type
- read
- Description
List members of an organization with their user details and role.
- Name
add_org_member- Type
- write
- Description
Add an end user to an organization. Validates membership limits, duplicate check, and assigns default role.
- Name
update_org_member_role- Type
- write
- Description
Change a member's role within an organization.
- Name
remove_org_member- Type
- danger
- Description
Remove a member from an organization.
Roles
- Name
list_roles- Type
- read
- Description
List all roles defined for the project with their permissions.
- Name
create_role- Type
- write
- Description
Create a role with a unique key and optional permissions list.
- Name
update_role- Type
- write
- Description
Update a role's name, permissions, or default status. The role key is immutable. Setting a role as default cascades (unsets previous default).
- Name
delete_role- Type
- danger
- Description
Delete a role. Blocked (409) if any organization members are currently assigned to it.
Auth Providers
- Name
list_auth_providers- Type
- read
- Description
List all authentication providers and their enabled/disabled status for the project.
- Name
configure_auth_providers- Type
- write
- Description
Enable or disable authentication providers (Google, GitHub, Discord, Azure, Apple, email, magic-link, SMS).
Callback URLs
- Name
list_callbacks- Type
- read
- Description
List all configured callback URLs for the project.
- Name
add_callback- Type
- write
- Description
Add a callback URL to the project. Must be a valid URL.
- Name
remove_callback- Type
- danger
- Description
Remove a callback URL by ID.
API Keys
- Name
list_api_keys- Type
- read
- Description
List all API keys for the project. Returns metadata only (keys are never exposed after creation).
- Name
create_api_key- Type
- write
- Description
Generate a new API key. The full key is returned once — store it securely.
- Name
regenerate_api_key- Type
- danger
- Description
Revoke all existing API keys and generate a new one. Returns the new key once.
- Name
revoke_api_key- Type
- danger
- Description
Revoke a single API key by ID.
Billing
- Name
list_billing_plans- Type
- read
- Description
List all billing plans (products) with their prices. Supports filtering archived plans.
- Name
create_billing_plan- Type
- write
- Description
Create a billing plan with optional monthly price. Use for setting up Free, Pro, Enterprise tiers.
- Name
get_user_entitlements- Type
- read
- Description
Get a user's billing entitlements: active subscription, plan features, and metered usage.
Billing Migrations
- Name
create_billing_migration- Type
- write
- Description
Create a billing migration to move subscribers between plans. Automatically maps prices by interval and currency.
- Name
get_billing_migration- Type
- read
- Description
Get a billing migration with its items grouped by status (pending, completed, failed).
- Name
execute_billing_migration- Type
- danger
- Description
Execute a pending billing migration, moving all subscribers to the target plan.
Usage Reporting
- Name
report_usage- Type
- write
- Description
Report metered usage events in batch. Supports idempotency keys to prevent double-counting.
- Name
get_usage_summary- Type
- read
- Description
Get aggregated usage summary for the current billing period.
Audit Logs
- Name
list_audit_events- Type
- read
- Description
List audit events with optional filters: event type, actor ID, target ID, and date range. Paginated, newest first.
- Name
list_audit_event_types- Type
- read
- Description
List all distinct event types that have been recorded in audit logs.
Security Alerts
- Name
list_security_alerts- Type
- read
- Description
List security alerts with optional status and severity filters.
- Name
acknowledge_security_alert- Type
- write
- Description
Acknowledge a security alert (marks it as seen).
- Name
resolve_security_alert- Type
- write
- Description
Resolve a security alert (marks it as handled).
- Name
get_security_stats- Type
- read
- Description
Get aggregate security statistics: counts by status and severity.
Email Templates
- Name
list_email_templates- Type
- read
- Description
List all email template types, showing whether each uses a custom or default template.
- Name
get_email_template- Type
- read
- Description
Get the full email template (subject + TipTap JSON content) for a specific type.
- Name
upsert_email_template- Type
- write
- Description
Create or update a custom email template. Validates the template by rendering before saving.
- Name
preview_email_template- Type
- read
- Description
Render a preview of an email template with sample variables. Returns HTML and substituted subject.
- Name
reset_email_template- Type
- write
- Description
Delete a custom template, reverting to the built-in default.
RBAC (Role-Based Access Control)
- Name
list_rbac_resources- Type
- read
- Description
List all RBAC resources defined for the project.
- Name
list_rbac_roles- Type
- read
- Description
List all RBAC roles with their permission grants.
- Name
create_rbac_resource- Type
- write
- Description
Create an RBAC resource with defined actions.
- Name
create_rbac_role- Type
- write
- Description
Create an RBAC role with permission grants across resources.
- Name
get_rbac_sync_state- Type
- read
- Description
Get the current RBAC configuration state: all resources, roles, and conditions managed as code.
- Name
check_rbac_permission- Type
- read
- Description
Check whether a specific user has a permission on a resource, based on their org membership and role.
- Name
apply_rbac_sync- Type
- write
- Description
Declaratively sync RBAC configuration. Creates, updates, or archives resources and roles to match the desired state.
Data Export
- Name
export_user_data- Type
- read
- Description
Export all data for a specific end user: profile, sessions, audit events, and organization memberships. Useful for GDPR data subject requests.
Example usage
After connecting, you can ask your AI assistant something like:
"Set up my auth project: create Free, Pro ($19/mo), and Enterprise ($99/mo) billing plans. Add admin, editor, and viewer roles. Enable Google and GitHub auth. Then show me the Next.js SDK setup."
The assistant will call the appropriate tools automatically:
create_billing_plan-- Free plan (no price)create_billing_plan-- Pro plan ($19/mo)create_billing_plan-- Enterprise plan ($99/mo)create_role-- admin with full permissionscreate_role-- editor with read + writecreate_role-- viewer with read onlyconfigure_auth_providers-- enable Google + GitHubget_sdk_setup_instructions-- Next.js integration code
Other example prompts:
"Show me all users who signed up this week and check if any security alerts need attention."
"Create an organization called 'Acme Corp', add 3 members, and set up RBAC with posts and comments resources."
"Export user data for GDPR compliance and verify their JWT token is valid."
Authentication
The MCP server authenticates using your AuthGate API key passed as a Bearer token. Every tool call is scoped to the project associated with that API key.
Authorization: Bearer ag_live_xxx
No additional OAuth setup is required -- the API key is validated on every request.
Transport
The MCP server uses the Streamable HTTP transport (MCP spec 2025-03-26) at:
POST https://www.authgate.dev/api/mcp
A legacy SSE endpoint is also available at /api/sse for older clients.