How per-user OAuth works for MCP tools
Each person connects their own accounts once in the Metorial portal, and every MCP tool call their agent makes runs with that person’s permissions.
With per-user OAuth, each person connects their own account for an integration, such as their own GitHub or Google account, through your Metorial portal. When their AI client calls a tool through Magic MCP, Metorial runs the call with that person's connection, so the agent can only see and change what the person could in the app. Nobody shares a service account, and no token is pasted into an AI client.
What you'll learn
- How a tool call is tied to the person behind it
- When to use per-user connections and when to use a shared one
- How admins publish per-user integrations and how people connect them
How a call flows
Two layers limit every call. Metorial decides which integrations and tools the person may use, based on groups and tool filters. The app itself then applies the person's own permissions, so a person who cannot see a private repository in GitHub cannot see it through their agent either.
Credentials are stored in Metorial Vault and resolved at the gateway when a call is allowed. They are not passed to the model, the AI client, or the person. Organizations can encrypt them with their own AWS KMS keys.
Per-user or shared connection
| Portal listing type | Who connects | Use it for |
|---|---|---|
| User-configured | Each person, with their own credentials | Apps where access differs per person: email, calendar, GitHub, CRM |
| Pre-configured | An admin, with shared credentials | Read-only reference data, or tools without per-person accounts |
Prefer user-configured listings whenever the app has per-person accounts. A shared connection gives everyone the same access and makes logs show the same app identity for every call, even though Metorial still records which person made it.
Publish a per-user integration
Add the integration to Workforce
In Workforce, open Access, Integrations, and select Add Integration. Choose New Integration to configure one, or Existing Integration to list one you already created.
Let each person connect
When you configure the integration, choose the option where users connect their own accounts (Users Connect) instead of a shared connection. This creates a user-configured listing.
Choose the groups
In the integration's Access section, select Add Group, set the group to Allow, and select Save.
Use your own OAuth app if needed
Metorial manages the OAuth apps by default. To control consent screens and scopes yourself, create custom OAuth credentials and use them in the integration.
Some apps, such as Google Workspace and Microsoft 365, need a workspace admin to approve the app before anyone can connect. The integration page tells you when that applies and can create a setup link to send to your admin.
What people do
Connect accounts in the portal
Each person opens the portal, signs in with company SSO, goes to the integrations view, and connects the integrations they need. Each connection goes through the app's own sign-in.
Connect an AI client
They add the Magic MCP URL to their client and sign in. Metorial's consent screen lists the integrations they can use ("Select Integrations"), then lets them choose which tools the client may use for each one. Tool Access offers "Allow every tool, including ones added later, or pick specific tools."
Work as themselves
Every tool call now runs with that person's connection. Admins see the calls in Workforce under Identity, Accounts, on the person's Operations page.
Agents that act for a person
Agents connected through a person's Magic MCP URL act with that person's identity and never exceed what the person is allowed to do. For agents that need durable access of their own, Workforce has agents as separate actors, and identity delegation lets one actor use another's credentials within a scoped, time-bound grant. To build the same flow into your own product, see OAuth with the SDK.
Troubleshooting
A tool call fails with an authentication error
The person's connection for that app has expired or been revoked. They reconnect the integration in the portal. Provider auth failures also appear in the dashboard's logs for admins.
People cannot connect a Google Workspace or Microsoft 365 app
The app needs admin approval in that workspace. Create the setup link from the integration page and send it to the workspace admin.
Two people get different results from the same tool
That is expected. Each call uses the person's own account, so the app returns what that person can access.
FAQ
Do employees share one service account for each app?
No, not for user-configured integrations. Each person connects their own account, and the app applies their permissions to every call their agent makes.
Can admins see or copy users' OAuth tokens?
Tokens are kept in Metorial Vault and resolved at the gateway when a call is allowed. They are not exposed to the model, the AI client, or the user.
What happens when someone loses access in the app itself?
Their agent loses it too. Metorial uses the person's own credential, so the app refuses the call the same way it would refuse the person.
What happens when someone leaves the company?
With SCIM, deactivating them in your identity provider deprovisions their Metorial account and removes their groups. Revoke their app accounts in your normal offboarding as well.
To see which other MCP gateways document per-user OAuth, see Which MCP gateways support per-user OAuth? in the MCP gateway comparison.