---
title: "AISIX 1.9.0: Connect MCP Users with Their Own Upstream Authorization - API7.ai"
description: "AISIX 1.9.0 adds per-user upstream MCP OAuth, allowing users to authorize an upstream service from their MCP client while AISIX manages the upstream credentials."
url: "https://api7.ai/blog/aisix-1-9-0-per-user-mcp-oauth"
---

[Blog](https://api7.ai/blog)

[Products](https://api7.ai/category/products)[Technology](https://api7.ai/category/technology)[Ecosystem](https://api7.ai/category/ecosystem)[Case Study](https://api7.ai/category/usercase)[Team & Community](https://api7.ai/category/community)

Search

⌘ + K

[Blog](https://api7.ai/blog)

Products

# AISIX 1.9.0: Connect MCP Users with Their Own Upstream Authorization

November 6, 2026

[Products](https://api7.ai/category/products)

An MCP client can give an AI assistant access to a team's tools, but a shared upstream credential can make every user appear to the upstream service as the same account. When the service needs to apply each person's own permissions, the connection must carry that person's authorization.

[AISIX 1.9.0](https://docs.api7.ai/ai-gateway/release-notes#190), released November 6, 2026, adds OAuth authorization-code authentication for upstream MCP servers of `type: mcp`. A user authorizes the upstream from their MCP client; AISIX then calls the upstream with that user's token. AISIX does not expose that upstream token to the MCP client, and it does not forward the client's gateway authorization to the upstream. The upstream service remains responsible for applying its own permissions.

## One Server URL, Separate User Authorizations

Consider a team connecting an MCP client to an issue service. Alice and Bob can use the same per-server gateway URL, while each signs in and authorizes the upstream under their own identity. Their ability to read or change issues still depends on the upstream's authorization rules.

In a local demonstration using the official AISIX 1.9.0 gateway image, two separate MCP client sessions connected to the same URL. A simulated identity provider and simulated upstream service represented Alice and Bob. After each user completed sign-in and consent, the same `whoami` tool returned the corresponding simulated identity. This demonstrates the tested flow with those fixtures; it does not establish behavior for a particular third-party provider or prove its permission policy.

[![AISIX 1.9.0 consent screen for the simulated Alice identity and identity-demo MCP server](https://static.api7.ai/uploads/2026/11/16/LFw1zYQJ_aisix-1-9-0-consent.webp?imageMogr2/format/webp)](https://static.api7.ai/uploads/2026/11/16/LFw1zYQJ_aisix-1-9-0-consent.webp)

*The actual AISIX 1.9.0 consent page identifies the MCP server and the simulated signed-in user before granting a local test client access. Open the image to inspect its original 1280×720 pixels. It does not show the upstream's permissions or prove a real provider's authorization policy.*

In the recorded test, both clients used `http://127.0.0.1:3000/mcp/identity-demo`. The simulated upstream's `whoami` tool answered `Local upstream received identity: alice` for Alice's session and `Local upstream received identity: bob` for Bob's. These are observations from the local fixture, not production account data.

```
Alice — whoami: Local upstream received identity: alice
Bob   — whoami: Local upstream received identity: bob
```

*These lines summarize the two recorded client responses from the simulated upstream. They show the selected local identities for these tool calls, not an upstream provider's production permission decision.*

## Configure the Sign-In Path

The gateway needs a public MCP resource URL and an MCP server configured for `oauth2_authorization_code`, together with the upstream's OAuth endpoints and client configuration. Follow the [upstream authentication guide](https://docs.api7.ai/ai-gateway/mcp-gateway/upstream-authentication) for the configuration and the upstream provider's requirements.

For URL-only interactive sign-in, configure exactly one enabled OIDC provider with `login`, plus the identity-to-gateway-access mapping described in the [interactive sign-in guide](https://docs.api7.ai/ai-gateway/mcp-gateway/interactive-sign-in). Otherwise, the client needs a gateway credential that identifies a user, such as a JWT or an owned API key; a credential without a user subject is insufficient for this per-user flow. Interactive sign-in uses the individual `/mcp/{server}` entry, not the aggregated `/mcp` entry. Route the required `/.well-known/`, `/mcp/{server}/`, and `/mcp-oauth/` paths through any front proxy, and review `outbound.ssrf_protection` for OAuth endpoints on another authority.

## Manage Credentials and Plan the Upgrade

In AISIX Enterprise and AISIX Cloud, upstream credentials are encrypted in the control plane through the data-plane manager, with refresh coordinated across gateways. Administrators with the `mcp_server_credentials` permission can list or disconnect credentials. A gateway may continue using a cached token for up to five minutes after a disconnect or purge; during a store outage, an already cached token can remain usable beyond that period until it expires. Disconnecting does not revoke the upstream grant or terminate existing stateless gateway sessions. Standalone AISIX OSS uses process-local memory, lost on restart, rather than managed shared persistence.

Canceling the AISIX consent page after upstream authorization does not undo that upstream authorization or delete a stored token. Disabling a user or removing a group at the identity provider does not immediately change claims already recorded in a live gateway session. By contrast, deleting or disabling the configured provider or changing its issuer can make the next per-server request require authorization again. Consult the sign-in guide when planning revocation and access changes.

The feature requires 1.9.0 gateways. In a managed environment, saving the new upstream OAuth configuration is refused with `422 DP_INCOMPATIBLE` while an older gateway remains registered. Older gateways ignore the OIDC `login` field, and the save returns a warning. Upgrade and verify the gateways before enabling the workflow.

## Review Other Upgrade Changes Separately

The OAuth flow is one part of this release. Before upgrading, review the [full release notes](https://docs.api7.ai/ai-gateway/release-notes#190) for changes that affect your deployment:

- On the listed inference routes, clients that parsed JSON out of `error.message` should read it as text and use `error.code` and `error.param` as separate fields where the upstream supplies them. Passthrough file, batch, fine-tuning and other routes retain their documented relay behavior.
- For passthrough routes with `credential_mode: inject`, name any client header that must still reach the upstream in `forward_client_headers`. The new stripping rule covers credential headers regardless of the ProviderKey's `strip_headers`; explicitly forwarding the injected header instead sends the caller's value. `forward_client` mode is unchanged.
- Review who can read failure records and exports. `error_message` can contain text echoed by an upstream or parser even in `metadata_only`; with `content_mode: full`, failed attempts can include request and response bodies, including an unmasked request that fails before guardrails finish.
- A `provider_key` budget now accumulates `upstream_cost`, falling back to `cost_usd` when it is null. If model-group pricing differs from target pricing, verify when the hard limit will be reached; previously accumulated spend remains.
- On Vertex AI Gemini 2.5 or later, requesting thinking can expose reasoning in the response field. Output guardrails do not scan that thought text, and unsupported `max` or `xhigh` effort can now receive an upstream `400` for models that do not think by default.
- On covered typed routes, a nonempty top-level `error` in an upstream 2xx response or stream frame is now treated as `upstream_in_band_error` rather than a successful answer; `null`, `{}`, and `""` are not failures, and passthrough and realtime follow their stated rules. Recheck clients and alerts that relied on the earlier status.
- Custom output guardrails now also run for responses with no text. A custom script must tolerate an empty `ctx.segments` array; a script that throws on a fail-closed row can refuse an otherwise empty or image-only response.
- AISIX Enterprise operators should confirm `AISIX_CLOUD_MASTER_KEY` is set to the same value as `AISIX_DPMGR_MASTER_KEY` before upgrading: `cp-api` now exits at startup if its key is empty. Behind a proxy, configure `auth.trusted_proxies` before interpreting audit and access-log client addresses; without it, those logs will show the proxy address. Check database connection headroom for each data-plane manager replica.
- Revisit realtime alerts and clients: an upstream-refused `/v1/realtime` session now reports a failure status and metrics according to the refusal, although the client WebSocket upgrade can already have succeeded. Consumers of full-content OTLP, SLS and Datadog exports should also review changed prompt/media shapes and omitted base64 payloads before assuming previous field formats.

These changes have their own conditions and migration actions; they are not requirements of the MCP OAuth workflow.

Start with a non-production environment and verify the actual identity provider, upstream authorization, client, gateway routing, and disconnect behavior before rollout. The [interactive sign-in guide](https://docs.api7.ai/ai-gateway/mcp-gateway/interactive-sign-in) provides a concrete configuration path.

Tags:

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[MCP](https://api7.ai/tags/mcp)

Share article link

Share

Related Posts

[![AISIX 1.6.0: Make Streaming SLOs Reflect the Outcome](https://static.api7.ai/uploads/2026/10/15/JvxAcYMU_aisix-1-6-0-stream-metrics-terminal-outcomes.webp)](https://api7.ai/blog/aisix-1-6-0-stream-metrics-terminal-outcomes)

## [AISIX 1.6.0: Make Streaming SLOs Reflect the Outcome](https://api7.ai/blog/aisix-1-6-0-stream-metrics-terminal-outcomes)

[![MCP Security Best Practices: Auth, Tool Access, and Egress](https://static.api7.ai/uploads/2026/10/08/Nd9pj31A_mcp-security-best-practices.webp)](https://api7.ai/blog/mcp-security-best-practices)

## [MCP Security Best Practices: Auth, Tool Access, and Egress](https://api7.ai/blog/mcp-security-best-practices)

Table of Contents

- [One Server URL, Separate User Authorizations](#one-server-url-separate-user-authorizations)
- [Configure the Sign-In Path](#configure-the-sign-in-path)
- [Manage Credentials and Plan the Upgrade](#manage-credentials-and-plan-the-upgrade)
- [Review Other Upgrade Changes Separately](#review-other-upgrade-changes-separately)

## Related Posts

[![MCP 2026-07-28 Support in AISIX AI Gateway](https://static.api7.ai/uploads/2026/08/19/XzdYJ6os_aisix-mcp-2026-cover.svg)](https://api7.ai/blog/aisix-mcp-2026-07-28-stateless-protocol)

Products

August 19, 2026

#### [MCP 2026-07-28 Support in AISIX AI Gateway](https://api7.ai/blog/aisix-mcp-2026-07-28-stateless-protocol)

AISIX AI Gateway now serves the stateless MCP 2026-07-28 revision alongside every 2025 revision on one endpoint, with per-server protocol pinning and a one-call-one-execution guarantee.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[MCP](https://api7.ai/tags/mcp)

[![AISIX 1.10.0: Keep AI Coding Sessions on a Matched Semantic Route](https://static.api7.ai/uploads/2026/11/13/5rPD4mvs_aisix-1-10-0-semantic-routing-session-affinity.webp)](https://api7.ai/blog/aisix-1-10-0-semantic-routing-session-affinity)

Products

November 12, 2026

#### [AISIX 1.10.0: Keep AI Coding Sessions on a Matched Semantic Route](https://api7.ai/blog/aisix-1-10-0-semantic-routing-session-affinity)

AISIX 1.10.0 brings semantic routing to Messages and Responses APIs, model-group targets, and optional session affinity for supported AI coding and agent sessions.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[Semantic Routing](https://api7.ai/tags/semantic-routing)

[![AISIX 1.7.0: Turn AI Spend Into an Operating Boundary](https://static.api7.ai/uploads/2026/10/26/qZ0mRtyd_aisix-1-7-0-cost-attribution-tags.webp)](https://api7.ai/blog/aisix-1-7-0-cost-attribution-tags)

Products

October 22, 2026

#### [AISIX 1.7.0: Turn AI Spend Into an Operating Boundary](https://api7.ai/blog/aisix-1-7-0-cost-attribution-tags)

AISIX 1.7.0 adds inherited cost-attribution tags so teams can connect AI usage, budgets, and rate-limit policy to the organization that owns the work.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[Cost Governance](https://api7.ai/tags/cost-governance)
