@upstash/context7-mcp 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,4 +10,8 @@ export const CLERK_DOMAIN = "clerk.context7.com";
10
10
  export const CONTEXT7_API_BASE_URL = process.env.CONTEXT7_API_URL || `${CONTEXT7_BASE_URL}/api`;
11
11
  export const RESOURCE_URL = process.env.RESOURCE_URL || MCP_RESOURCE_URL;
12
12
  export const AUTH_SERVER_URL = process.env.AUTH_SERVER_URL || CONTEXT7_BASE_URL;
13
+ // Enterprise-Managed Auth (id-jag): access tokens minted by the Context7
14
+ // authorization server, validated against its public JWKS.
15
+ export const EMA_ISSUER = AUTH_SERVER_URL;
16
+ export const EMA_JWKS_URL = process.env.EMA_JWKS_URL || `${CONTEXT7_API_BASE_URL}/oauth/ema-jwks`;
13
17
  export const OPENAI_APPS_CHALLENGE_TOKEN = process.env.OPENAI_APPS_CHALLENGE_TOKEN;
package/dist/lib/jwt.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as jose from "jose";
2
- import { CLERK_DOMAIN, CONTEXT7_API_BASE_URL } from "./constants.js";
2
+ import { CLERK_DOMAIN, CONTEXT7_API_BASE_URL, EMA_ISSUER, EMA_JWKS_URL, RESOURCE_URL, } from "./constants.js";
3
3
  const CLERK_ISSUER = `https://${CLERK_DOMAIN}`;
4
4
  const clerkJwks = jose.createRemoteJWKSet(new URL(`https://${CLERK_DOMAIN}/.well-known/jwks.json`));
5
+ const emaJwks = jose.createRemoteJWKSet(new URL(EMA_JWKS_URL));
5
6
  const ENTRA_V2_ISSUER_RE = /^https:\/\/login\.microsoftonline\.com\/[0-9a-f-]{36}\/v2\.0$/;
6
7
  const jwksByTenant = new Map();
7
8
  function entraJwks(tenantId) {
@@ -65,6 +66,10 @@ export async function validateJWT(token) {
65
66
  }
66
67
  return { valid: true };
67
68
  }
69
+ if (iss === EMA_ISSUER) {
70
+ await jose.jwtVerify(token, emaJwks, { issuer: EMA_ISSUER, audience: RESOURCE_URL });
71
+ return { valid: true };
72
+ }
68
73
  await jose.jwtVerify(token, clerkJwks, { issuer: CLERK_ISSUER });
69
74
  return { valid: true };
70
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upstash/context7-mcp",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "mcpName": "io.github.upstash/context7",
5
5
  "description": "MCP server for Context7",
6
6
  "repository": {
@@ -36,10 +36,10 @@
36
36
  "@modelcontextprotocol/sdk": "^1.29.0",
37
37
  "@types/express": "^5.0.4",
38
38
  "@upstash/redis": "^1.38.0",
39
- "commander": "^14.0.0",
39
+ "commander": "^13.1.0",
40
40
  "express": "^5.1.0",
41
41
  "jose": "^6.1.3",
42
- "undici": "^7.27.0",
42
+ "undici": "^6.26.0",
43
43
  "zod": "^4.4.3"
44
44
  },
45
45
  "devDependencies": {