Skip to content
Status

MCP Gateway / Access, OAuth, and sessions

Access, OAuth, and sessions

How people and agents authenticate to MCP servers and gateways, which credential a server presents upstream, who may connect and which tools they get, and who is connected right now.

Every MCP server and gateway answers the same questions about access. Each one is configured independently on the server detail page, so it helps to keep them apart:

  • Who is calling this MCP server? Answered by authentication and user sessions, where the platform acts as the authorization server and issues tokens to MCP clients.
  • What can the server reach upstream on the caller’s behalf? Answered by upstream credentials. A server can offer several, such as each person’s own account and a shared service account, and credential access decides who may use each one. Secrets for hosted servers live in environments.
  • Who may connect, and which tools do they get? Answered by team access, the per-server rules that grant or block people, roles, and agents and narrow what they can call.

Alongside those answers, clients and sessions shows who is connected right now, through which MCP clients, and lets an admin cut a connection off.

Start from MCP Gateway > MCP in the project sidebar and open the server. Where each setting sits depends on the server type, as described in Where authentication is configured.

Viewing a server’s authentication and identity settings requires the mcp:read scope and changing them requires mcp:write. Each page in this section lists the scopes its own settings need.

  • User sessions: how MCP clients log in, consent, and hold tokens for a server, and how a person’s session is revoked.
  • Upstream credentials: the credentials a server signs in upstream with, how people pick one on the consent screen, and how agents, assistants, apps, and API keys use one without a browser.
  • Credential access: which roles, people, agents, and API keys may use each credential, and splitting the organization-wide grant.
  • OAuth client registration: DCR and CIMD: how MCP clients identify themselves to a server, and which clients may start a sign-in.
  • Session length and refresh: how long a sign-in lasts, and whether upstream credentials are refreshed before idle connections lapse.
  • Team access: granting and blocking access per server, narrowing tools, and resolving conflicting roles.
  • Clients and sessions: the MCP clients and people connected to one server, and revoking their sessions or registrations.

Authentication covers the first two questions. A server can answer one, both, or neither. A server with no answer to the first question and no answer to the second is an anonymous server proxying an unauthenticated upstream.

On a remote server, the Identity section of the Settings tab answers the second question with a list of Credentials. Each credential is one way the platform signs in to the upstream service, and a server can offer several at once:

  • Each person’s own account: each person connects their own upstream account and keeps their own permissions there. Because each token is stored against a person, it requires callers to sign in to the server.
  • Service account: every caller who may use it acts upstream as one OAuth app, with a token the platform obtains through the client credentials grant.
  • Static credential: stored headers, such as an API key, sent for every caller who may use it.
  • Caller-supplied header: a header the calling app sends, forwarded upstream.
  • Enterprise-managed sign-in: the organization identity provider vouches for the person, with no per-service connect step.

People choose between the credentials they may use on the consent screen, and agents, assistants, apps, and API keys have theirs chosen ahead of time. A server with no credentials calls the upstream without sign-in. See Set up a remote server with several credentials.

ai.speakeasy.com
The Identity section of a remote MCP server with the Upstream sign-in badge and a Credentials list holding several credentials

Hosted and tunneled servers make the same decisions through separate settings, summarized in the table below.

GoalUsePer end user?
Only organization members can connect, using their Speakeasy loginUser sessions on a private serverIdentity only
Anyone can connect anonymously, with no loginPublic visibility, which requires a tunneled server and the tunnel source owner’s consentNo
Each end user acts against their own account on an upstream serviceAn Each person’s own account credential on a remote server, or authorization servers layered on user sessions on a hosted serverYes
One shared identity for some or all callersA Service account or Static credential on a remote server, limited with credential access, or environment system variables on a hosted serverNo
People use their own accounts while agents use a shared one, on the same serverBoth credentials on one remote server, with the agent credential chosen on its MCP sign-in tabMixed
Each calling app brings its own upstream keyA Caller-supplied header credentialPer app
Each connecting user supplies their own API keyEnvironment variables marked as user-providedYes
Each end user reaches an upstream service through the organization’s Okta, with no per-service connect stepEnterprise Managed Auth on a server signed in through an Okta-trusted user session issuerYes

Per-user upstream credentials require user sessions, while shared credentials compose with anything, including a fully anonymous public server. See Upstream credentials.

Two similarly named concepts run in opposite directions. User sessions are inbound: tokens the platform issues to an MCP client so it can reach the server. Remote sessions are outbound: upstream tokens the platform holds on an end user’s behalf so the server can reach a third-party API. Session length governs the first. Reconnect prompts and automatic session refresh belong to the second.

On a hosted or tunneled server, the Authentication section of the Settings tab carries both halves of authentication in one place, described in the product as “Who may connect to this server and how they sign in. Changes take effect on new connections.” Before an identity provider is attached, the section shows Set up authentication, which requires MCP clients to authenticate through an upstream identity provider before reaching the server. Once one is attached, the section shows the Session length, Client access, and Authorization servers fields. Gateways reuse the same section.

A remote server splits the same settings across two sections of its Settings tab: the Identity section described above, and a Sessions section with Session length and Client access, which shows its controls once the server signs people in. See Session length and refresh and OAuth client registration.

Every server also has a Team Access tab and a Clients and Sessions tab.

The organization-wide inventory of upstream issuers lives in Authorization servers, and every live connection across the project is visible in MCP Sessions, both under Identity in the project sidebar. The per-server view of the same connections is the server’s Clients and Sessions tab.

Authentication changes apply to new client connections. Clients already holding a valid token keep working until that token expires.

Public visibility skips authentication entirely: any caller reaches the server with no login and every tool is exposed to the public internet. It is available only on tunneled servers whose source owner has opted in, and it is a deliberate double opt-in rather than a general visibility option.

A public server still sends its own shared credentials on every call, so anonymous callers get to spend them. See Hosted and tunneled servers.

Two guides cover OAuth against an authorization server outside the platform, on hosted servers. A hosted server whose OpenAPI document declares external OAuth shows a Configure External OAuth action next to Set up authentication, and a server already configured that way offers Convert to User Sessions to move onto the shared authentication section:

  • Secure an MCP server with OAuth covers adding OAuth to a hosted server and the credential styles those servers accept: pre-obtained access tokens, the client credentials flow, and several security schemes in one OpenAPI document.
  • Build MCP with external OAuth covers pointing clients at a third-party authorization server directly.

Both advertise OAuth scopes, and both handle token storage and revocation differently from user sessions.