MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / verifyMcpAccessToken

Function verifyMcpAccessToken

apps/cloud/src/mcp/jwt.ts:99–119  ·  view source on GitHub ↗
(
  token: string,
  jwks: JWTVerifyGetKey,
  options: {
    readonly issuer: string;
    readonly audience: string;
  },
)

Source from the content-addressed store, hash-verified

97 );
98
99export const verifyMcpAccessToken = (
100 token: string,
101 jwks: JWTVerifyGetKey,
102 options: {
103 readonly issuer: string;
104 readonly audience: string;
105 },
106) =>
107 Effect.gen(function* () {
108 const { payload } = yield* Effect.tryPromise({
109 try: () =>
110 jwtVerify(token, jwks, {
111 ...workosAccessTokenOptions,
112 issuer: options.issuer,
113 audience: options.audience,
114 }),
115 catch: classifyJwtVerificationError,
116 }).pipe(withJwtVerificationSpan);
117
118 return identityFromClaims(payload);
119 });
120
121export const verifyWorkOSMcpAccessToken = (
122 token: string,

Callers 2

Calls 1

identityFromClaimsFunction · 0.85

Tested by

no test coverage detected