{"_id":"@brionmario-experimental/mcp-express","_rev":"4-7ba38ad668bcc6b6dcee4a8c3c34c6f0","name":"@brionmario-experimental/mcp-express","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@brionmario-experimental/mcp-express","version":"0.0.1","keywords":["asgardeo","agents","mcp","mcp-express","mcp-auth","authorization"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@brionmario-experimental/mcp-express@0.0.1","maintainers":[{"name":"brionmario","email":"brionbmp@gmail.com"}],"homepage":"https://github.com/asgardeo/mcp-express/tree/main/packages/mcp-express#readme","bugs":{"url":"https://github.com/asgardeo/mcp-express/issues"},"dist":{"shasum":"d3d3180b3dcd6865826eb0bea199cde0b10f499b","tarball":"https://registry.npmjs.org/@brionmario-experimental/mcp-express/-/mcp-express-0.0.1.tgz","fileCount":37,"integrity":"sha512-sruJnvriw5ajtQfdu1WtC68CT/M1/ElD5kOW1+TGXWeIe6AIYfwFSGo/b7yEWCnA7AyKlpokV5SeLM5VzuLGLA==","signatures":[{"sig":"MEUCIHJ+5C4rZpZfl9we8cmPbQkyh52MD6VvpbnUbPkXfjwoAiEA20SXaY/mTVhT4zEliqhDXZAadQ6csY4rMKTMbcfkqHc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36934},"main":"dist/cjs/index.js","type":"module","_from":"file:brionmario-experimental-mcp-express-0.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"tsc -p tsconfig.lib.json","fix:lint":"eslint --fix --ext .ts,.js src"},"_npmUser":{"name":"brionmario","email":"brionbmp@gmail.com"},"_resolved":"/tmp/6fc554a8bf49432b68de31bdbe4f027e/brionmario-experimental-mcp-express-0.0.1.tgz","_integrity":"sha512-sruJnvriw5ajtQfdu1WtC68CT/M1/ElD5kOW1+TGXWeIe6AIYfwFSGo/b7yEWCnA7AyKlpokV5SeLM5VzuLGLA==","repository":{"url":"git+https://github.com/asgardeo/mcp-express.git","type":"git","directory":"packages/mcp-express"},"_npmVersion":"10.9.2","description":"Express middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"cors":"^2.8.5","tslib":"^2.8.1","express":"^4.21.2","@brionmario-experimental/mcp-node":"^0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","prettier":"^2.6.2","typescript":"~5.7.2","@types/cors":"^2.8.17","@types/node":"^22.15.3","@types/express":"^4.17.21","@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"},"peerDependencies":{"express":">=4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-express_0.0.1_1746521336024_0.6643036550886661","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@brionmario-experimental/mcp-express","version":"0.0.2","keywords":["asgardeo","agents","mcp","mcp-express","mcp-auth","authorization"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@brionmario-experimental/mcp-express@0.0.2","maintainers":[{"name":"brionmario","email":"brionbmp@gmail.com"}],"homepage":"https://github.com/asgardeo/mcp-express/tree/main/packages/mcp-express#readme","bugs":{"url":"https://github.com/asgardeo/mcp-express/issues"},"dist":{"shasum":"80d1b1e8f7658e385bbbe10172f612278e4de636","tarball":"https://registry.npmjs.org/@brionmario-experimental/mcp-express/-/mcp-express-0.0.2.tgz","fileCount":21,"integrity":"sha512-SX4inC+sEpGtewcqC6yGpIBiC6QPJGmmkYSAUxtVla+n7DmGpAYi8ZUHXTTl9w+TMYAbJpvT3Uy1CMg6cRWlQQ==","signatures":[{"sig":"MEQCIBgIEjvfaJOSt54V//1t15NBed379HY1AE9wLCSGRABjAiA36h5V6BpD7l3ZyHettTElf5+LQM5Mei7K7UaZ/sfNog==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39845},"main":"dist/cjs/index.js","type":"module","_from":"file:brionmario-experimental-mcp-express-0.0.2.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"tsc -p tsconfig.lib.json","fix:lint":"eslint --fix --ext .ts,.js src"},"_npmUser":{"name":"brionmario","email":"brionbmp@gmail.com"},"_resolved":"/tmp/8d0e475c901f744075036814a84e4a08/brionmario-experimental-mcp-express-0.0.2.tgz","_integrity":"sha512-SX4inC+sEpGtewcqC6yGpIBiC6QPJGmmkYSAUxtVla+n7DmGpAYi8ZUHXTTl9w+TMYAbJpvT3Uy1CMg6cRWlQQ==","repository":{"url":"git+https://github.com/asgardeo/mcp-express.git","type":"git","directory":"packages/mcp-express"},"_npmVersion":"10.9.2","description":"Express middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"cors":"^2.8.5","tslib":"^2.8.1","express":"^4.21.2","@brionmario-experimental/mcp-node":"^0.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","prettier":"^2.6.2","typescript":"~5.7.2","@types/cors":"^2.8.17","@types/node":"^22.15.3","@types/express":"^4.17.21","@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"},"peerDependencies":{"express":">=4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-express_0.0.2_1746525571005_0.045724415236344296","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@brionmario-experimental/mcp-express","version":"0.0.3","keywords":["asgardeo","agents","mcp","mcp-express","mcp-auth","authorization"],"author":{"name":"WSO2"},"license":"Apache-2.0","_id":"@brionmario-experimental/mcp-express@0.0.3","maintainers":[{"name":"brionmario","email":"brionbmp@gmail.com"}],"homepage":"https://github.com/asgardeo/mcp-express/tree/main/packages/mcp-express#readme","bugs":{"url":"https://github.com/asgardeo/mcp-express/issues"},"dist":{"shasum":"7e0409f81c307142ba8349a9f8da9adf02cbd064","tarball":"https://registry.npmjs.org/@brionmario-experimental/mcp-express/-/mcp-express-0.0.3.tgz","fileCount":21,"integrity":"sha512-442mP6ZEfXYdGBl/OFuLr8fBZFM8x0a7fDR35f49OHCWdO8uDI6y4vO4O28VorkdWb0IG/tVYBPteAe404jcvQ==","signatures":[{"sig":"MEQCIFbdPXHeIjxSV2KEF1vjtBQMa/VKtPY5rX/R+5wiBUsJAiAkQS0RVlJ08v5jAbpzeGfT55y93FwDr1QoOjaCJAa9uw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39721},"main":"dist/cjs/index.js","type":"module","_from":"file:brionmario-experimental-mcp-express-0.0.3.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/cjs/index.js"},"scripts":{"lint":"eslint --ext .ts,.js src","build":"tsc -p tsconfig.lib.json","fix:lint":"eslint --fix --ext .ts,.js src"},"_npmUser":{"name":"brionmario","email":"brionbmp@gmail.com"},"_resolved":"/tmp/049d02242e3c1a87555b4a0810519bd0/brionmario-experimental-mcp-express-0.0.3.tgz","_integrity":"sha512-442mP6ZEfXYdGBl/OFuLr8fBZFM8x0a7fDR35f49OHCWdO8uDI6y4vO4O28VorkdWb0IG/tVYBPteAe404jcvQ==","repository":{"url":"git+https://github.com/asgardeo/mcp-express.git","type":"git","directory":"packages/mcp-express"},"_npmVersion":"10.9.2","description":"Express middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"cors":"^2.8.5","tslib":"^2.8.1","express":"^4.21.2","@brionmario-experimental/mcp-node":"^0.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","prettier":"^2.6.2","typescript":"~5.7.2","@types/cors":"^2.8.17","@types/node":"^22.15.3","@types/express":"^4.17.21","@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"},"peerDependencies":{"express":">=4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-express_0.0.3_1746529752347_0.1613466476700487","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@brionmario-experimental/mcp-express","version":"0.0.4","description":"Express middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","keywords":["asgardeo","agents","mcp","mcp-express","mcp-auth","authorization"],"homepage":"https://github.com/asgardeo/mcp-express/tree/main/packages/mcp-express#readme","bugs":{"url":"https://github.com/asgardeo/mcp-express/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-express.git","directory":"packages/mcp-express"},"devDependencies":{"@types/cors":"^2.8.17","@types/express":"^4.17.21","@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","esbuild":"^0.25.4","eslint":"8.57.0","prettier":"^2.6.2","typescript":"~5.7.2"},"peerDependencies":{"express":">=4"},"publishConfig":{"access":"public"},"dependencies":{"cors":"^2.8.5","express":"^4.21.2","tslib":"^2.8.1","@brionmario-experimental/mcp-node":"^0.0.4"},"engines":{"node":">=18.0.0"},"scripts":{"clean":"rm -rf dist","build":"node 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:express --external:cors --external:@brionmario-experimental/mcp-node","build:cjs":"esbuild src/index.ts --bundle --platform=node --outfile=dist/cjs/index.js --format=cjs --sourcemap --minify --external:express --external:cors --external:@brionmario-experimental/mcp-node","fix:lint":"eslint --fix --ext .ts,.js src","lint":"eslint --ext .ts,.js src"},"_id":"@brionmario-experimental/mcp-express@0.0.4","_integrity":"sha512-AivRPEzJVVcU1R4ccFn2Rtu6+Bi8nFo/GPW67HyjWLy6ureZVx9+DcK9vtue1MC88H4DGF9GTGMO/APUZrxeXA==","_resolved":"/tmp/0a13835309b5ebd249f47d40fa371fbe/brionmario-experimental-mcp-express-0.0.4.tgz","_from":"file:brionmario-experimental-mcp-express-0.0.4.tgz","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-AivRPEzJVVcU1R4ccFn2Rtu6+Bi8nFo/GPW67HyjWLy6ureZVx9+DcK9vtue1MC88H4DGF9GTGMO/APUZrxeXA==","shasum":"9a728eb23c1afd303923d920e85fc4565ee0cee3","tarball":"https://registry.npmjs.org/@brionmario-experimental/mcp-express/-/mcp-express-0.0.4.tgz","fileCount":20,"unpackedSize":59004,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBhbOsVsWOKLvDUy9GvlMxMvpMIqjSRM0u/Qc9JgIXadAiBHnY43QPBVZVDJ1PlE9JYVeS6AdBYdFU8OgSd71xXWpg=="}]},"_npmUser":{"name":"brionmario","email":"brionbmp@gmail.com"},"directories":{},"maintainers":[{"name":"brionmario","email":"brionbmp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-express_0.0.4_1746630936178_0.06758473451435365"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-06T08:48:55.916Z","modified":"2025-05-07T15:15:36.674Z","0.0.1":"2025-05-06T08:48:56.211Z","0.0.2":"2025-05-06T09:59:31.184Z","0.0.3":"2025-05-06T11:09:12.538Z","0.0.4":"2025-05-07T15:15:36.483Z"},"bugs":{"url":"https://github.com/asgardeo/mcp-express/issues"},"author":{"name":"WSO2"},"license":"Apache-2.0","homepage":"https://github.com/asgardeo/mcp-express/tree/main/packages/mcp-express#readme","keywords":["asgardeo","agents","mcp","mcp-express","mcp-auth","authorization"],"repository":{"type":"git","url":"git+https://github.com/asgardeo/mcp-express.git","directory":"packages/mcp-express"},"description":"Express middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.","maintainers":[{"name":"brionmario","email":"brionbmp@gmail.com"}],"readme":"# @brionmario-experimental/mcp-express\n\nExpress middleware for enforcing Model Context Protocol (MCP) authorization using Asgardeo.\n\n## Overview\n\nThis package provides Express middleware that implements Model Context Protocol (MCP) based authorization for Express.js applications. It integrates with Asgardeo for authentication and authorization services.\n\n## Installation\n\n```bash\nnpm install @brionmario-experimental/mcp-express\n# or\nyarn add @brionmario-experimental/mcp-express\n# or \npnpm add @brionmario-experimental/mcp-express\n```\n\n## Features\n\n- Easy-to-use Express middleware\n- Protected route handling\n- Automatic metadata endpoint setup\n- Built-in CORS support\n- Seamless integration with Asgardeo\n\n## Usage\n\n```typescript\nimport express from 'express';\nimport { McpAuthServer, protectedRoute } from '@brionmario-experimental/mcp-express';\n\nconst app = express();\n\n// Initialize MCP authentication server\napp.use(McpAuthServer());\n\n// Public routes\napp.get('/api/public', (req, res) => {\n  res.json({ message: 'This is a public endpoint' });\n});\n\n// Protected routes\napp.use('/api/protected', protectedRoute, (req, res) => {\n  res.json({ message: 'This is a protected endpoint' });\n});\n```\n\n## API Reference\n\n### Middleware\n\n#### McpAuthServer(options?)\nInitializes the MCP authentication server middleware. This sets up the necessary endpoints for MCP authentication.\n\n```typescript\nimport { McpAuthServer } from '@brionmario-experimental/mcp-express';\n\napp.use(McpAuthServer({\n  providers: [Asgardeo()]\n}));\n```\n\n#### protectedRoute\nMiddleware to protect routes that require authentication.\n\n```typescript\nimport { protectedRoute } from '@brionmario-experimental/mcp-express';\n\napp.use('/api/protected', protectedRoute, protectedRoutes);\n```\n\n### Configuration\n\nThe middleware can be configured with the following options:\n\n```typescript\ninterface McpAuthOptions {\n  providers: McpAuthProvider[];  // Array of authentication providers\n}\n\ninterface McpAuthProvider {\n  baseUrl: string;  // Base URL of the authentication provider\n}\n```\n\n## Example\n\nHere's a complete example of setting up an Express server with MCP authentication:\n\n```typescript\nimport express from 'express';\nimport { McpAuthServer, protectedRoute } from '@brionmario-experimental/mcp-express';\n\nconst app = express();\nconst port = process.env.PORT || 3000;\n\napp.use(express.json());\n\n// Initialize MCP authentication\napp.use(McpAuthServer());\n\n// Public routes\napp.use('/api', publicRoutes);\n\n// Protected routes with MCP authentication\napp.use('/api/protected', protectedRoute, protectedRoutes);\n\n// Error handling\napp.use((err, req, res, next) => {\n  console.error(err.stack);\n  res.status(500).json({ error: 'Something broke!' });\n});\n\napp.listen(port, () => {\n  console.log(`Server is running on port ${port}`);\n});\n```\n\n## Development\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```bash\npnpm install\n```\n\n### Build\n```bash\npnpm build\n```\n\n### Lint\n```bash\npnpm lint\n```\n\n## License\n\nApache-2.0 - see the [LICENSE](LICENSE) file for details.","readmeFilename":"README.md"}