You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs(azure-apim): reflect Settings tab + cascade-delete + audience-uniqueness
Three updates after merging the per-user identity feature to production:
1. Dashboard navigation: Entra cards moved from the Overview tab to a
conditional Settings tab (only visible for enterprise teamspaces or
active trials). Update Part 4 and the troubleshooting section.
2. Cascade-delete: clicking Remove on the Microsoft Entra ID card now
removes both the tenant configuration AND all provisioned users in a
single step. Add a note so admins know not to use Remove for
single-user revocation.
3. Audience uniqueness: each MCP API app (audience GUID) can be claimed
by one teamspace at a time. Document the failure mode and how to
resolve it, since hitting it from a fresh setup is easy.
* docs(azure-apim): add Part 6 — smoke test the gateway from CLI
Walks through pre-authorizing Azure CLI on the Gateway app's scope and
running an `az account get-access-token` + curl against APIM end-to-end.
Lets admins validate the full OBO flow before pointing real MCP clients
at the gateway.
Renumber the original "Connect an MCP client" to Part 7.
The card is visible only for enterprise teamspaces and active enterprise trials.
343
+
The Settings tab itself is visible only for enterprise teamspaces and active enterprise trials. If you don't see it, confirm the selected teamspace is on an enterprise plan.
344
344
</Note>
345
345
346
346
3. Fill in:
@@ -354,7 +354,7 @@ An owner or admin of the teamspace configures both from the dashboard.
354
354
355
355
### Step 2: Pre-provision your developers
356
356
357
-
After saving the tenant configuration, scroll down to the **Microsoft Entra ID users** card on the same Overview tab. This is where you list every Entra user who should be able to authenticate to the teamspace through APIM.
357
+
After saving the tenant configuration, scroll down to the **Microsoft Entra ID users** card on the same Settings tab. This is where you list every Entra user who should be able to authenticate to the teamspace through APIM.
358
358
359
359
1. Click **Add user**.
360
360
2. Enter the user's:
@@ -364,6 +364,14 @@ After saving the tenant configuration, scroll down to the **Microsoft Entra ID u
364
364
365
365
Context7 creates a Clerk user record for the developer, adds them as a `developer` member of the teamspace, and inserts a `(tenant, oid, teamspace)` mapping. The same email can be added to multiple teamspaces — the Clerk user is reused and a separate mapping row is created per teamspace.
366
366
367
+
<Note>
368
+
Clicking **Remove** on the Microsoft Entra ID card removes both the tenant configuration **and** all provisioned users for the teamspace in a single step. If you only need to revoke a single user, remove them from the Microsoft Entra ID users card instead.
369
+
</Note>
370
+
371
+
<Note>
372
+
Each MCP API app (audience) can be configured for **one** teamspace at a time. If you reuse an audience already claimed by a different teamspace you will see "This audience is already configured for another teamspace" — open the other teamspace's Settings tab and remove the Entra configuration there first, or register a new MCP API app for this teamspace.
373
+
</Note>
374
+
367
375
<Note>
368
376
For large rollouts (tens or hundreds of developers), CSV bulk-import and Entra SCIM provisioning are on the roadmap. Reach out to [context7@upstash.com](mailto:context7@upstash.com) if your scale needs either ahead of general availability.
369
377
</Note>
@@ -518,7 +526,45 @@ Expected:
518
526
-`/authorize` returns `302 Found` with a `Location` header pointing at Entra's authorize endpoint.
519
527
- An unauthorised POST to `/context7/mcp` returns `401` with `WWW-Authenticate: Bearer resource_metadata="https://<your-apim-host>/.well-known/oauth-protected-resource"`.
520
528
521
-
## Part 6: Connect an MCP client
529
+
## Part 6: Smoke test the gateway from CLI
530
+
531
+
Before pointing real MCP clients at the gateway, validate the full OBO flow from your terminal. This catches misconfigurations (wrong audience, missing scope, unmapped user) without involving an MCP client.
532
+
533
+
### Step 1: Authorize the Azure CLI on the Gateway app
534
+
535
+
Azure CLI's well-known client ID is `04b07795-8ddb-461a-bbee-02f9e1bf7b46`. Pre-authorize it on the Gateway app's scope so `az account get-access-token` can mint tokens:
536
+
537
+
1. Entra admin center → **App registrations** → **Context7 APIM Gateway** → **Expose an API**.
538
+
2. Under **Authorized client applications**, click **+ Add a client application**.
4. Tick the `api://<gateway-app-id>/Mcp.Gateway.Access` scope. **Add**.
541
+
542
+
<Note>
543
+
This pre-authorization is only required for the CLI smoke test described here. End users connecting via VS Code with GitHub Copilot use Microsoft's first-party VS Code client ID, which you already pre-authorized in [Part 2 Step 3](#step-3-wire-the-permission-chain).
544
+
</Note>
545
+
546
+
### Step 2: Acquire a token and call the gateway
547
+
548
+
```bash
549
+
GATEWAY_APP_ID=<gateway-app-client-id>
550
+
APIM_HOST=<your-apim-host>
551
+
552
+
az login --tenant <your-tenant-id> --scope api://$GATEWAY_APP_ID/.default
Expected: `200 OK`, an `mcp-session-id` response header, and a Server-Sent Events body with the Context7 server info. That confirms APIM validated your inbound token, performed the OBO exchange, forwarded the new token to `mcp.context7.com`, the MCP server validated it against your tenant configuration, and the request was attributed to your provisioned user.
564
+
565
+
If you get a non-200 status, decode `$TOKEN` at [jwt.io](https://jwt.io) and confirm `aud` is the Gateway app's client ID, `scp` is `Mcp.Gateway.Access`, and `oid` matches the value you added under **Microsoft Entra ID users**. See [Troubleshooting](#troubleshooting) for specific error codes.
566
+
567
+
## Part 7: Connect an MCP client
522
568
523
569
Configure your MCP client to talk to the APIM endpoint. Example for VS Code with GitHub Copilot:
524
570
@@ -587,15 +633,15 @@ The `scope` parameter in the OBO request is malformed. Verify that the `mcp-api-
587
633
588
634
Either the token does not match the teamspace's tenant configuration, or the user is not on the teamspace's pre-provisioned list.
589
635
590
-
First open **Overview → Microsoft Entra ID** in the dashboard and verify:
636
+
First open **Settings → Microsoft Entra ID** in the dashboard and verify:
591
637
592
638
-**Tenant ID** matches the OBO token's `tid` claim.
593
639
-**Audience** matches the OBO token's `aud` claim exactly (case-sensitive, GUID form for v2 tokens).
594
640
-**Required scope** matches a value in the token's `scp` claim.
595
641
596
642
Use **Test connection** to confirm the tenant is reachable.
597
643
598
-
If the tenant config is correct, the user's `oid` is probably not in the teamspace's provisioned users list. Decode the OBO token at [jwt.io](https://jwt.io) and copy the `oid` claim, then check that exact value appears in **Overview → Microsoft Entra ID users**. If it's missing, add the user (see Part 4 Step 2).
644
+
If the tenant config is correct, the user's `oid` is probably not in the teamspace's provisioned users list. Decode the OBO token at [jwt.io](https://jwt.io) and copy the `oid` claim, then check that exact value appears in **Settings → Microsoft Entra ID users**. If it's missing, add the user (see Part 4 Step 2).
0 commit comments