---
title: How do you grant MCP server access by identity provider group?
url: https://opencontroller.lyzr.com/blog/grant-mcp-access-by-identity-provider-group
published: 2026-11-18
updated: 2026-11-18
author: Lyzr
---

# How do you grant MCP server access by identity provider group?

**Map each identity provider (IdP) group to a policy, issue every user or agent its own credential that carries that identity, and check the policy when the credential is used against an MCP server. Group-based access only works if the call still carries a person's or agent's identity when it reaches the server. A shared application key erases that identity and breaks the model.**

Security teams usually ask this once they have more than a handful of MCP servers. Nobody wants to approve access one user at a time, and the IdP already knows who is in Finance, Engineering or the SOC.

## What does the chain from group to MCP server look like?

There are four links. Each has to hold.

| Link | What it holds | Typical source |
|---|---|---|
| 1. Group membership | User X is in `eng-platform` | IdP, synced by SCIM or sent as a `groups` claim at sign-in |
| 2. Policy | `eng-platform` may use the `ci-tools` and `docs-search` MCP servers | Policy store or policy as code |
| 3. Credential | A token or key bound to user X (or to an agent acting for X) | OIDC sign-in, OAuth token exchange, or a per-user gateway key |
| 4. Enforcement | On connect or on each call, check X's groups against the policy | MCP server, gateway or client |

If link 3 is a key shared by everyone using an app, link 4 cannot tell users apart. The gateway sees one caller. Every user gets the union of everyone's access, or nobody gets anything.

## Should group data come from SCIM or from SSO claims?

Both work. They behave differently when someone changes team.

- **SCIM provisioning** pushes group changes to the governance system as they happen. Removing someone from a group can revoke MCP access within minutes, even for long-lived credentials.
- **SSO group claims** arrive only when the user signs in. Access changes take effect at the next sign-in or token refresh.

For MCP servers with write tools, prefer SCIM or short token lifetimes so a leaver or mover does not keep access until their session expires. See [SCIM vs SSO group claims for roles](/blog/scim-vs-sso-group-claims-for-roles).

## How do agents fit into group-based access?

Agents complicate the picture because they often run without a signed-in user.

1. **Agent acting for a user.** Use delegated, on-behalf-of identity. The agent's token carries both the agent and the user, so the policy can check the user's groups and the agent's own permissions. OAuth 2.0 Token Exchange (RFC 8693) is the standard way to mint these tokens.
2. **Agent running on its own.** Give the agent its own workload identity and put that identity, not a person, into a group or role. Treat it like a service principal with an owner.
3. **Shared application talking for many users.** Pass the end-user identity through to the gateway (a signed token is better than a plain header) or issue per-user credentials. Otherwise you are back to the shared-key problem.

## What is a sensible rollout plan?

1. **List MCP servers and their worst tool.** Start group mapping with servers that can write or delete.
2. **Create a small number of access groups.** One group per server per access level (`mcp-jira-read`, `mcp-jira-write`) is easier to audit than one group per team.
3. **Stop issuing shared keys for new servers.** Grandfather existing ones with an end date.
4. **Require identity on every call.** Reject MCP calls that arrive without a user or agent identity.
5. **Review membership quarterly.** Group-based access is only as good as group hygiene. Include MCP access groups in your regular [access reviews for AI agents](/blog/access-reviews-for-ai-agents).
6. **Log the identity, group and decision.** An auditor will ask why a user could call a tool. Log which group granted it.

## What goes wrong most often?

- **Nested groups not resolved.** Some tools only read direct membership, so users in a nested group are silently denied or silently allowed.
- **Group claim overflow.** Large tenants can exceed claim size limits, and some IdPs then send a link instead of the group list. Test with your largest users.
- **Groups named for teams, not access.** "Engineering" changes every reorg. Access groups should outlive org charts.

## How Opencontroller does this

Opencontroller signs users in with OIDC SSO and supports delegated on-behalf-of identity and agent workload identity federation, so a call can carry both the agent and the user it acts for. MCP servers and tools sit in a governed registry with owners, and policy as code decides what each identity may use where traffic passes through the gateway. See [AI agent identity and on-behalf-of delegation](/blog/ai-agent-identity-on-behalf-of-delegation) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can I use the same IdP groups I use for SaaS apps?**
You can, but dedicated MCP access groups per server and access level are easier to review and less likely to be over-granted after reorganisations.

**Why not just give each application one key and control access in the app?**
Because the gateway and the MCP server then cannot see who made the call. You lose per-user policy, per-user audit and the ability to revoke one person.

**How quickly does removing someone from a group revoke MCP access?**
With SCIM, as soon as the change syncs and the next call is checked. With sign-in claims only, at the next sign-in or token refresh.

## Key facts

Group-based MCP access chain: IdP group membership (SCIM or SSO groups claim) -> policy mapping groups to MCP servers -> per-user or per-agent credential -> enforcement on connect or per call. Shared application keys remove user identity and break group policy. SCIM revokes access when changes sync; SSO claims update at next sign-in or token refresh. Agents acting for users should use on-behalf-of tokens (OAuth 2.0 Token Exchange, RFC 8693); autonomous agents need their own workload identity. Recommended: one access group per MCP server per access level.

## Related

- [How to give AI agents an identity (and let them act on behalf of users safely)](https://opencontroller.lyzr.com/blog/ai-agent-identity-on-behalf-of-delegation.md)
- [Should SCIM or SSO group claims assign roles in an AI governance console?](https://opencontroller.lyzr.com/blog/scim-vs-sso-group-claims-for-roles.md)
- [How do you run access reviews for AI agents?](https://opencontroller.lyzr.com/blog/access-reviews-for-ai-agents.md)
- [More on Agent identity and access](https://opencontroller.lyzr.com/blog/cluster/agent-identity-and-access)
