{"_id":"@asgardeo/mcp-node","_rev":"4-4773c15712888098e3ffc5c3c6237240","name":"@asgardeo/mcp-node","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.1":{"name":"@asgardeo/mcp-node","version":"0.0.1","keywords":["asgardeo","agents","mcp","mcp-node","mcp-auth","authorization","core"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@asgardeo/mcp-node@0.0.1","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"homepage":"https://github.com/asgardeo/mcp-node/tree/main/packages/mcp-node#readme","bugs":{"url":"https://github.com/asgardeo/mcp-node/issues"},"dist":{"shasum":"75900dc0f8972d2f7ab39cc26c40b6e64266d997","tarball":"https://registry.npmjs.org/@asgardeo/mcp-node/-/mcp-node-0.0.1.tgz","fileCount":26,"integrity":"sha512-CxDpro9EptNTPIlbRj8IKPqMDBBRLrYEM+AYRpWs9cOpHpIYW2b5qhkMIaFYR2cGU+cJDlfqsbltvKWt9Oz7PA==","signatures":[{"sig":"MEQCIGH55kA5TR6PZI0uv6olhZ1A+ZBVI8O8Xd61k9Clpgj3AiAHm5RiavT6RpBqMIMOirKMStBHsN3w2DxeNJVijHj0SA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67465},"main":"dist/cjs/index.js","type":"module","_from":"file:asgardeo-mcp-node-0.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"node ./scripts/build.js","clean":"rm -rf dist","fix:lint":"eslint --fix --ext .ts,.js src","build:cjs":"esbuild src/index.ts --bundle --platform=node --outfile=dist/cjs/index.js --format=cjs --sourcemap --minify --external:jose --external:node-fetch","build:esm":"esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --format=esm --sourcemap --minify --external:jose --external:node-fetch","build:types":"tsc --emitDeclarationOnly --declaration"},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"_resolved":"/tmp/337566ebd5f717204a39121e9c997b7e/asgardeo-mcp-node-0.0.1.tgz","_integrity":"sha512-CxDpro9EptNTPIlbRj8IKPqMDBBRLrYEM+AYRpWs9cOpHpIYW2b5qhkMIaFYR2cGU+cJDlfqsbltvKWt9Oz7PA==","repository":{"url":"git+https://github.com/asgardeo/mcp-node.git","type":"git","directory":"packages/mcp-node"},"_npmVersion":"10.9.2","description":"Node.js core for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"jose":"^6.0.10","tslib":"^2.8.1","node-fetch":"^3.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","esbuild":"^0.25.4","prettier":"^2.6.2","typescript":"~5.7.2","@types/node":"^22.15.3","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?4ee6f6be232d7631999d709a86b91612f1d34ce7","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?4ee6f6be232d7631999d709a86b91612f1d34ce7"},"_npmOperationalInternal":{"tmp":"tmp/mcp-node_0.0.1_1747665863888_0.6011385120674468","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@asgardeo/mcp-node","version":"0.1.0","keywords":["asgardeo","agents","mcp","mcp-node","mcp-auth","authorization","core"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@asgardeo/mcp-node@0.1.0","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"homepage":"https://github.com/asgardeo/mcp-node/tree/main/packages/mcp-node#readme","bugs":{"url":"https://github.com/asgardeo/mcp-node/issues"},"dist":{"shasum":"7d21981362214cb34d027832229a2afa2cea6949","tarball":"https://registry.npmjs.org/@asgardeo/mcp-node/-/mcp-node-0.1.0.tgz","fileCount":26,"integrity":"sha512-zv2o+RlQd5TzI8Jhq99Ibm+dtzSr3F7RAWbtgGUqSgvoMjYQP1eMnUmt6+tSk+nEwY5xO52NuiqR/cJU7kT/5A==","signatures":[{"sig":"MEUCIB/+aJxMpFCec97/6zjjZkqADfip+f9xM7ixf7ern3cqAiEAq3oJ+74IZJ1CzJoJrxjteyngPILjx4t2WReb4vl3ulM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67465},"main":"dist/cjs/index.js","type":"module","_from":"file:asgardeo-mcp-node-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"node ./scripts/build.js","clean":"rm -rf dist","fix:lint":"eslint --fix --ext .ts,.js src","build:cjs":"esbuild src/index.ts --bundle --platform=node --outfile=dist/cjs/index.js --format=cjs --sourcemap --minify --external:jose --external:node-fetch","build:esm":"esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --format=esm --sourcemap --minify --external:jose --external:node-fetch","build:types":"tsc --emitDeclarationOnly --declaration"},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"_resolved":"/tmp/26241afced99de593cb8fe0e09c19669/asgardeo-mcp-node-0.1.0.tgz","_integrity":"sha512-zv2o+RlQd5TzI8Jhq99Ibm+dtzSr3F7RAWbtgGUqSgvoMjYQP1eMnUmt6+tSk+nEwY5xO52NuiqR/cJU7kT/5A==","repository":{"url":"git+https://github.com/asgardeo/mcp-node.git","type":"git","directory":"packages/mcp-node"},"_npmVersion":"10.9.2","description":"Node.js core for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"jose":"^6.0.10","tslib":"^2.8.1","node-fetch":"^3.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","esbuild":"^0.25.4","prettier":"^2.6.2","typescript":"~5.7.2","@types/node":"^22.15.3","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?4ee6f6be232d7631999d709a86b91612f1d34ce7","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?4ee6f6be232d7631999d709a86b91612f1d34ce7"},"_npmOperationalInternal":{"tmp":"tmp/mcp-node_0.1.0_1747829740977_0.07504569680321893","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@asgardeo/mcp-node","version":"0.2.0","keywords":["asgardeo","agents","mcp","mcp-node","mcp-auth","authorization","core"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@asgardeo/mcp-node@0.2.0","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"homepage":"https://github.com/asgardeo/mcp-node/tree/main/packages/mcp-node#readme","bugs":{"url":"https://github.com/asgardeo/mcp-node/issues"},"dist":{"shasum":"a69d8057ba68d0ce741a13b2c383317eea64eece","tarball":"https://registry.npmjs.org/@asgardeo/mcp-node/-/mcp-node-0.2.0.tgz","fileCount":26,"integrity":"sha512-y/Cpd+E/ANr60aOdsdnioaek0REQScle6HZF0vMob5ymkf/0fLaSHy952otr93jeyrwpF6WVSpvtyY9Guuu/ug==","signatures":[{"sig":"MEQCICviV6ZcolcPWst11dLvYAVMqgGSHyYozyrUPKijlCfHAiAarATNS4+CuGQD3YJB5D20Pl/w0WmXLgWQiPCraBfyGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68404},"main":"dist/cjs/index.js","type":"module","_from":"file:asgardeo-mcp-node-0.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"node ./scripts/build.js","clean":"rm -rf dist","fix:lint":"eslint --fix --ext .ts,.js src","build:cjs":"esbuild src/index.ts --bundle --platform=node --outfile=dist/cjs/index.js --format=cjs --sourcemap --minify --external:jose --external:node-fetch","build:esm":"esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --format=esm --sourcemap --minify --external:jose --external:node-fetch","build:types":"tsc --emitDeclarationOnly --declaration"},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"_resolved":"/tmp/aedbb9055734984347438bd5b0945627/asgardeo-mcp-node-0.2.0.tgz","_integrity":"sha512-y/Cpd+E/ANr60aOdsdnioaek0REQScle6HZF0vMob5ymkf/0fLaSHy952otr93jeyrwpF6WVSpvtyY9Guuu/ug==","repository":{"url":"git+https://github.com/asgardeo/mcp-node.git","type":"git","directory":"packages/mcp-node"},"_npmVersion":"10.9.3","description":"Node.js core for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"jose":"^6.0.10","tslib":"^2.8.1","node-fetch":"^3.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","esbuild":"^0.25.4","prettier":"^2.6.2","typescript":"~5.7.2","@types/node":"^22.15.3","@wso2/eslint-plugin":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?4ee6f6be232d7631999d709a86b91612f1d34ce7","@wso2/prettier-config":"https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?4ee6f6be232d7631999d709a86b91612f1d34ce7"},"_npmOperationalInternal":{"tmp":"tmp/mcp-node_0.2.0_1755074869838_0.7452371165999863","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@asgardeo/mcp-node","version":"0.3.0","description":"Node.js core for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","keywords":["asgardeo","agents","mcp","mcp-node","mcp-auth","authorization","core"],"homepage":"https://github.com/asgardeo/mcp-auth-javascript/tree/main/packages/mcp-node#readme","bugs":{"url":"https://github.com/asgardeo/mcp-auth-javascript/issues"},"author":{"name":"WSO2"},"license":"Apache-2.0","type":"module","main":"dist/cjs/index.js","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/asgardeo/mcp-auth-javascript.git","directory":"packages/mcp-node"},"devDependencies":{"@types/node":"^22.15.3","@wso2/eslint-plugin":"git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/eslint-plugin","@wso2/prettier-config":"git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/prettier-config","esbuild":"^0.25.4","eslint":"8.57.0","prettier":"^2.6.2","typescript":"~5.7.2"},"publishConfig":{"access":"public"},"dependencies":{"jose":"^6.0.10","node-fetch":"^3.3.2","tslib":"^2.8.1"},"engines":{"node":">=18.0.0"},"scripts":{"clean":"rm -rf dist","build":"node ./scripts/build.js","build:types":"tsc --emitDeclarationOnly --declaration","build:esm":"esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js --format=esm --sourcemap --minify --external:jose --external:node-fetch","build:cjs":"esbuild src/index.ts --bundle --platform=node --outfile=dist/cjs/index.js --format=cjs --sourcemap --minify --external:jose --external:node-fetch","fix:lint":"eslint --fix --ext .ts,.js src","lint":"eslint --ext .ts,.js src"},"_id":"@asgardeo/mcp-node@0.3.0","_integrity":"sha512-M9+/I6wiCKD0FzVLcFEfQqaYV8kOKglyyWKchh8Ifhi1S4OTlyroxByXH/FiZ0gqg32i5Zn78P3nFbeAdY9Q2g==","_resolved":"/tmp/d4b1bfefa6d09717b9dd6e85978aa4a2/asgardeo-mcp-node-0.3.0.tgz","_from":"file:asgardeo-mcp-node-0.3.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-M9+/I6wiCKD0FzVLcFEfQqaYV8kOKglyyWKchh8Ifhi1S4OTlyroxByXH/FiZ0gqg32i5Zn78P3nFbeAdY9Q2g==","shasum":"43cc54c98593616b7345802fea781861174ffa89","tarball":"https://registry.npmjs.org/@asgardeo/mcp-node/-/mcp-node-0.3.0.tgz","fileCount":26,"unpackedSize":68457,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAFpHjylV3g/WQJIVrNRQJNGDp0AryF37MbdizbEAHJ5AiBJrYqAhXSeYJ3ZDjGHih6zgNmTa6mKqvq6PyMuwlnwkA=="}]},"_npmUser":{"name":"wso2-org","email":"techops@wso2.com"},"directories":{},"maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-node_0.3.0_1773937607338_0.3110503855759006"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-19T14:44:23.818Z","modified":"2026-03-19T16:26:47.639Z","0.0.1":"2025-05-19T14:44:24.071Z","0.1.0":"2025-05-21T12:15:41.242Z","0.2.0":"2025-08-13T08:47:50.007Z","0.3.0":"2026-03-19T16:26:47.488Z"},"bugs":{"url":"https://github.com/asgardeo/mcp-auth-javascript/issues"},"author":{"name":"WSO2"},"license":"Apache-2.0","homepage":"https://github.com/asgardeo/mcp-auth-javascript/tree/main/packages/mcp-node#readme","keywords":["asgardeo","agents","mcp","mcp-node","mcp-auth","authorization","core"],"repository":{"type":"git","url":"git+https://github.com/asgardeo/mcp-auth-javascript.git","directory":"packages/mcp-node"},"description":"Node.js core for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","maintainers":[{"name":"wso2-org","email":"techops@wso2.com"}],"readme":"# @asgardeo/mcp-node\n\n[![npm version](https://img.shields.io/npm/v/@asgardeo/mcp-node.svg?style=flat-square)](https://www.npmjs.com/package/@asgardeo/mcp-node)\n[![npm downloads](https://img.shields.io/npm/dm/@asgardeo/mcp-node.svg?style=flat-square)](https://www.npmjs.com/package/@asgardeo/mcp-node)\n\nNode.js core library for enforcing Model Context Protocol (MCP) authorization using Asgardeo.\n\n## Overview\n\nThis package provides the core functionality for implementing Model Context Protocol (MCP) based authorization in\nNode.js applications. It serves as the foundation for higher-level implementations like the Express middleware\n(`@asgardeo/mcp-express`).\n\nThis package is part of the\n[Asgardeo MCP Node.js SDKs monorepo](https://github.com/asgardeo/asgardeo-mcp-node#readme). For overall project\ninformation, contribution guidelines, and details on other related packages, please refer to the main repository.\n\n## Installation\n\n```bash\nnpm install @asgardeo/mcp-node\n# or\nyarn add @asgardeo/mcp-node\n# or\npnpm add @asgardeo/mcp-node\n```\n\n## Features\n\n- Authorization server metadata generation\n- Protected resource metadata generation\n- Token verification utilities\n\n## Usage\n\n```typescript\nimport {generateAuthorizationServerMetadata, generateProtectedResourceMetadata} from '@asgardeo/mcp-node';\n\nbaseUrl: string = 'https://api.asgardeo.io/<your-org-name>';\n\n// Generate authorization server metadata\nconst serverMetadata = generateAuthorizationServerMetadata({\n  baseUrl,\n});\n\n// Generate protected resource metadata\nconst resourceMetadata = generateProtectedResourceMetadata({\n  authorizationServers: [baseUrl],\n  resource: 'https://api.example.com',\n});\n```\n\n## API Reference\n\n### Metadata Generation\n\n#### generateAuthorizationServerMetadata(options)\n\nGenerates metadata for the authorization server.\n\n```typescript\nconst metadata = generateAuthorizationServerMetadata({\n  baseUrl: 'https://api.asgardeo.io',\n});\n```\n\n#### generateProtectedResourceMetadata(options)\n\nGenerates metadata for protected resources.\n\n```typescript\nconst metadata = generateProtectedResourceMetadata({\n  authorizationServers: ['https://api.asgardeo.io'],\n  resource: 'https://api.example.com',\n});\n```\n\n### Configuration\n\n#### McpAuthOptions\n\nConfiguration options used across MCP packages.\n\n```typescript\ninterface McpAuthOptions {\n  /** Base URL of the authorization server */\n  baseUrl: string;\n  /** Optional audience value for token validation */\n  audience?: string;\n}\n```\n\n### Token Verification\n\n#### validateToken(accessToken, jwksUri, options)\n\nVerifies a JWT access token using the authorization server's JWKS endpoint.\n\n```typescript\nimport {validateToken} from '@asgardeo/mcp-node';\n\nawait validateToken('<token>', 'https://api.asgardeo.io/oauth2/jwks', {\n  issuer: 'https://api.asgardeo.io/oauth2/token',\n  audience: 'mcp-client-id',\n  clockTolerance: 60,\n});\n```\n\n### Prerequisites\n\n- Node.js 16.x or later\n- pnpm 8.x or later\n\n### Setup\n\n1. Clone the repository\n2. Install dependencies:\n\n```bash\npnpm install\n```\n\n### Build\n\n```bash\npnpm build\n```\n\n### Lint\n\n```bash\npnpm lint\n```\n\n## License\n\nApache-2.0 - see the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}