# SuperTokens MCP for AI Agents AI Agent Connect

> SuperTokens lets you manage your entire authentication system using your AI agent. You can handle user signups, session security, and role-based permissions without touching a dashboard or writing scripts. It turns your auth layer into a conversational interface.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_CP9DImFvaf6eyl0RkLBvary4O9crAiMiAhFMQLXQ/ai-agent-connect
- **Tags:** authentication, session-management, rbac, jwt, user-lifecycle, security

## Description

This SuperTokens MCP lets you manage your entire authentication system using your AI agent. Usually, when you need to handle a user lockout or update a permission level, you have to stop what you're doing, open a new browser tab, log into a dashboard, and hunt for the right ID. It's a tedious context switch that breaks your focus. This Connector changes that by letting you handle those tasks directly through your AI client. You can just tell your agent to find a user, check their status, and update their role in one go. It turns your authentication layer into a conversational tool. Whether you're updating custom metadata for a specific profile, unlinking accounts, or revoking suspicious sessions, the agent does the heavy lifting of talking to SuperTokens Core for you. You don't have to worry about the API calls or the specific order of operations. You just describe the result you want, and the agent makes it happen. It makes managing user lifecycles and Role-Based Access Control (RBAC) feel like a natural part of your workflow. You'll find it's much faster to handle these quick tasks when they don't require opening a new tab or writing a one-off script. By connecting to the Vinkius catalog, you get access to this and thousands of other tools through a single connection from your preferred client. It makes your security operations more direct and less tedious.

## Tools

### get_user
Retrieve the full profile and details for a specific user ID. This is the quickest way to check a user's current status.

### link_accounts
Connect two different user accounts into a single identity. Use this to merge user profiles as needed.

### list_roles
View a complete list of all roles currently in the system. This is helpful for auditing your current permission structure.

### delete_user_metadata
Remove specific metadata associated with a user profile. This keeps your user data clean and organized.

### get_tenant
Retrieve the details and configuration of a specific tenant. Use this to quickly check your multi-tenant setup.

### get_user_metadata
Fetch the custom JSON metadata for a specific user. This lets you see custom preferences or app-specific data.

### list_user_roles
See all the roles assigned to a particular user. Use this to verify what permissions a specific person has.

### assign_role_to_user
Assign a specific role to a user account. This helps you manage permissions without clicking through menus.

### bulk_import_users
Import a large batch of users into your system at once. This is perfect for setting up test data or migrating accounts.

### create_or_update_role
Create a new user role or modify an existing one. Use this to define new permission levels for your app.

### create_session
Generate a new session for a user to grant access. This allows you to manually authorize a user into the system.

### create_or_update_tenant
Create a new tenant or update details for an existing one. Use this to manage multi-tenant data structures.

### refresh_session
Update an existing session to extend its validity. This keeps users logged in without requiring a full re-authentication.

### remove_session
Revoke an active session to kick a user out of the app. This is your go-to tool for immediate security actions.

### signin_user
Authenticate a user and start a new session. Use this to programmatically sign users into your application.

### signup_user
Create a new user account in the system. This allows your agent to handle new registrations for you.

### unlink_accounts
Separate two previously linked user accounts. Use this to undo a previous account merge.

### update_user_metadata
Modify or add custom JSON data to a user profile. This lets you track application-specific data points.

## Prompt Examples

**Prompt:** 
```
Can you see if user-99 has any active sessions?
```

**Response:** 
```
I checked the session logs for user-99. They currently have 3 active sessions. Would you like me to revoke any of them?
```

**Prompt:** 
```
Give the 'editor' role to user-456.
```

**Response:** 
```
I've assigned the 'editor' role to user-456. They now have the permissions associated with that role.
```

**Prompt:** 
```
What's the metadata for user-123?
```

**Response:** 
```
Here is the custom metadata for user-123:
- **Plan**: Premium
- **Onboarding**: Complete
- **Beta_Access**: True
```

## Capabilities

### Sign up or sign in users
Create new user accounts or authenticate existing ones through your agent.

### Revoke or refresh active sessions
Manage user access by killing sessions or extending their validity.

### Assign roles and permissions
Grant or modify specific permission levels for any user in your system.

### Update custom user metadata
Modify and track application-specific data points on user profiles.

### Link or unlink multiple accounts
Merge or separate different user identities into a single profile.

### Bulk import user data
Populate your system with multiple user records in a single operation.

## Use Cases

### Immediate Security Response
A user's account is compromised. You tell your agent to remove_session for that user and assign_role_to_user to 'locked' to stop the attack immediately.

### Fast Support Resolution
A customer can't access a feature. You use get_user to check their permissions and create_or_update_role to fix their access level in seconds.

### Bulk Data Migration
You need to move 500 users from a legacy system. You use bulk_import_users to populate your SuperTokens Core instance without manual entry.

### Account Merging
A customer wants to combine two accounts. You use link_accounts to merge their identities into one primary profile.

## Benefits

- Stop writing one-off scripts to update user roles because assign_role_to_user lets your agent handle it instantly.
- Fix customer login issues faster by using get_user and update_user_metadata to see what's wrong and fix it on the fly.
- Tighten security by using remove_session to kick out suspicious users without needing to find their session ID manually.
- Handle complex identity tasks like link_accounts and unlink_accounts without navigating through nested menus.
- Speed up testing by using bulk_import_users to populate your environment with dummy data in one go.
- Manage multi-tenant environments more easily with create_or_update_tenant and get_tenant commands.

## How It Works

The bottom line is you get a conversational interface for your entire authentication and user management layer.

1. Subscribe to the SuperTokens MCP on Vinkius.
2. Add your SuperTokens Core URL and API Key to the configuration.
3. Ask your agent to perform tasks like 'revoke all sessions for user X'.

## Frequently Asked Questions

**How does SuperTokens MCP help with user management?**
It lets you handle the entire user lifecycle through natural language. You can sign up users, check their profiles, and update their account details without leaving your chat interface.

**Can I use SuperTokens MCP to manage roles?**
Yes, you can use it to manage Role-Based Access Control (RBAC). You can list all roles, create new ones, and assign them to specific users instantly.

**Does the SuperTokens MCP support session security?**
It does. You can use your agent to refresh active sessions or revoke them immediately to kick a user out of your application for security reasons.

**Can I use SuperTokens MCP for multi-tenant apps?**
Yes, it includes tools to create, update, and retrieve tenant details, making it easy to manage multi-tenant data via your AI client.

**How do I handle account linking with SuperTokens MCP?**
You can use the Connector to link or unlink different user accounts, allowing you to merge multiple identities into a single primary user profile through conversation.

**Can SuperTokens MCP update user metadata?**
It can. You can use it to read and update custom JSON metadata for any user, which is perfect for tracking application-specific data points.

**Can I retrieve specific user information using their ID?**
Yes, by using the `get_user` tool with the specific User ID, you can fetch the full profile, including email and account linking status.

**How do I assign a specific role like 'admin' to a user?**
You can use the `assign_role_to_user` tool. Just provide the User ID and the role name to update their permissions immediately.

**Is it possible to update custom user data or preferences?**
Absolutely. The `update_user_metadata` tool allows you to pass a JSON object to store or update custom information for any user.