feat(mcp): multi-tenant Entra ID validation + Azure APIM docs#2629
Open
fahreddinozcan wants to merge 2 commits into
Open
feat(mcp): multi-tenant Entra ID validation + Azure APIM docs#2629fahreddinozcan wants to merge 2 commits into
fahreddinozcan wants to merge 2 commits into
Conversation
jwt.ts now fetches per-teamspace Entra config from context7app's /api/v2/entra/config/[audience] endpoint, enabling per-user identity for customers using Azure API Management in front of mcp.context7.com. Per-tenant JWKS cache and 5-minute in-memory config cache. Also adds the Azure APIM enterprise integration docs page covering both the shared-identity (today) and per-user-identity (in development) patterns.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Adds vitest coverage for the new multi-tenant Entra path in jwt.ts: issuer detection, config fetch + caching, audience and scope rejection, and the unchanged Clerk fallback. Mocks jose and global fetch so the tests don't depend on network or real crypto. Includes a minor-bump changeset for the @upstash/context7-mcp package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/mcp/src/lib/jwt.ts: replaces single-tenant env-var Entra config with dynamic per-teamspace config fetched fromcontext7app's/api/v2/entra/config/[audience]endpoint. On success, returns anentrapayload (teamspaceId,oid,email,name) so the request handler can resolve a per-user Context7 identity.docs/enterprise/azure-apim.mdxcovering two patterns: shared identity (deployable today, single Context7 teamspace key behind APIM) and per-user identity (in development, native Entra validation at the Context7 MCP server).Test plan
pnpm typecheckclean inpackages/mcpUnknown audienceerrorMissing required scopeerrorRelated