{"_id":"middy-mcp","_rev":"4-20729a4b828e2727010696aa2b12a329","name":"middy-mcp","dist-tags":{"latest":"0.1.6"},"versions":{"0.0.1":{"name":"middy-mcp","version":"0.0.1","keywords":["mcp","model context protocol","middy","middleware","aws","lambda"],"author":{"name":"Frédéric Barthelet","email":"frederic.barthelet@gmail.com"},"license":"MIT","_id":"middy-mcp@0.0.1","maintainers":[{"name":"bartheletf","email":"frederic.barthelet@gmail.com"}],"homepage":"https://github.com/fredericbarthelet/middy-mcp#readme","bugs":{"url":"https://github.com/fredericbarthelet/middy-mcp/issues"},"dist":{"shasum":"c2ed0582230e8d0011ac0a700596a8d53a7c39cc","tarball":"https://registry.npmjs.org/middy-mcp/-/middy-mcp-0.0.1.tgz","fileCount":9,"integrity":"sha512-GrrHT5h5+mZwg35RqxDnZWGe9TXpdfrSC0XU+MzrF6XLzutxG81zZaATDTcykUCOt+WNTBGEiHiUWo7hWH7tFw==","signatures":[{"sig":"MEQCIBySdnH/euya+2bMT+C59/opKnQfPlrknzJfXjwqxdCXAiBCtzF6NcW0KkA9WvRZgwfuHoca5SxxeVPH2Su9B+BkiQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14205},"main":"dist/index.js","type":"module","_from":"file:middy-mcp-0.0.1.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"bartheletf","email":"frederic.barthelet@gmail.com"},"_resolved":"/private/var/folders/3l/yhsqp95j5r74t928y8nd9f9r0000gn/T/1dfcadf618e8d034f66049e014aeea1c/middy-mcp-0.0.1.tgz","_integrity":"sha512-GrrHT5h5+mZwg35RqxDnZWGe9TXpdfrSC0XU+MzrF6XLzutxG81zZaATDTcykUCOt+WNTBGEiHiUWo7hWH7tFw==","repository":{"url":"git+https://github.com/fredericbarthelet/middy-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Middy middleware for Model Context Protocol server","directories":{},"_nodeVersion":"20.18.3","dependencies":{"zod":"^3.24.2","http-errors":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.2","@middy/core":"^6.1.6","@types/node":"^22.14.0","@types/aws-lambda":"^8.10.148","@types/http-errors":"^2.0.4","@modelcontextprotocol/sdk":"^1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/middy-mcp_0.0.1_1743782376829_0.33732527202599494","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"middy-mcp","version":"0.1.1","keywords":["mcp","model context protocol","middy","middleware","aws","lambda"],"author":{"name":"Frédéric Barthelet","email":"frederic.barthelet@gmail.com"},"license":"MIT","_id":"middy-mcp@0.1.1","maintainers":[{"name":"bartheletf","email":"frederic.barthelet@gmail.com"}],"homepage":"https://github.com/fredericbarthelet/middy-mcp#readme","bugs":{"url":"https://github.com/fredericbarthelet/middy-mcp/issues"},"dist":{"shasum":"a62f54e836c099fcfd367a14d6c55a9cf74d6de0","tarball":"https://registry.npmjs.org/middy-mcp/-/middy-mcp-0.1.1.tgz","fileCount":9,"integrity":"sha512-xokqO521Cin1d80J2Iaepw9s8Domm7FWOf3fhBZFGG3/HK3IW3DHcMEfc+XzQm85XFZl3ZqCzVgxlGpeKxDdcA==","signatures":[{"sig":"MEYCIQDgr7oJjb9DgHrjfssBqd7QwWuJ1t3NIMhmpcIt43SqZQIhALscKEyS8cJDkkcOsKXvqmOUEXQHEWPTXcdmBgs4K+rr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14205},"main":"dist/index.js","type":"module","_from":"file:middy-mcp-0.1.1.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"bartheletf","email":"frederic.barthelet@gmail.com"},"_resolved":"/private/var/folders/3l/yhsqp95j5r74t928y8nd9f9r0000gn/T/9d7120c571543a8d7bca62f50557a9b0/middy-mcp-0.1.1.tgz","_integrity":"sha512-xokqO521Cin1d80J2Iaepw9s8Domm7FWOf3fhBZFGG3/HK3IW3DHcMEfc+XzQm85XFZl3ZqCzVgxlGpeKxDdcA==","repository":{"url":"git+https://github.com/fredericbarthelet/middy-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Middy middleware for Model Context Protocol server","directories":{},"_nodeVersion":"20.18.3","dependencies":{"zod":"^3.24.2","http-errors":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.2","@middy/core":"^6.1.6","@types/node":"^22.14.0","@types/aws-lambda":"^8.10.148","@types/http-errors":"^2.0.4","@modelcontextprotocol/sdk":"^1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/middy-mcp_0.1.1_1744280409007_0.24660607172480375","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"middy-mcp","version":"0.1.5","keywords":["mcp","model context protocol","middy","middleware","aws","lambda"],"author":{"name":"Frédéric Barthelet","email":"frederic.barthelet@gmail.com"},"license":"MIT","_id":"middy-mcp@0.1.5","maintainers":[{"name":"bartheletf","email":"frederic.barthelet@gmail.com"}],"homepage":"https://github.com/fredericbarthelet/middy-mcp#readme","bugs":{"url":"https://github.com/fredericbarthelet/middy-mcp/issues"},"dist":{"shasum":"186b2c07f16b31d90ca793b0b127914667bb004e","tarball":"https://registry.npmjs.org/middy-mcp/-/middy-mcp-0.1.5.tgz","fileCount":9,"integrity":"sha512-Hz7zYPxGl6eE7qT+X/NdMAfTa1PcEkFRjx0nNbTcI0EZcJbq9nDWGTy5Y6i9La9rZIbxLVNxl0bO8p7D4MV9oQ==","signatures":[{"sig":"MEUCIHyN/oLYp+BBeNQZUQT4r3o0zqg9kmCfV4FXyD1CRddPAiEAjeLB69F+F3dMlSX9qqQQbMcPfGrQxGZBsc2vYJxxJYc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14459},"main":"dist/index.js","type":"module","_from":"file:middy-mcp-0.1.5.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"bartheletf","email":"frederic.barthelet@gmail.com"},"_resolved":"/tmp/97325f35e469af2d70e3afc03e57bc66/middy-mcp-0.1.5.tgz","_integrity":"sha512-Hz7zYPxGl6eE7qT+X/NdMAfTa1PcEkFRjx0nNbTcI0EZcJbq9nDWGTy5Y6i9La9rZIbxLVNxl0bO8p7D4MV9oQ==","repository":{"url":"git+https://github.com/fredericbarthelet/middy-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Middy middleware for Model Context Protocol server","directories":{},"_nodeVersion":"20.19.1","dependencies":{"zod":"^3.24.2","http-errors":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.2","@middy/core":"^6.1.6","@types/node":"^22.14.0","@types/aws-lambda":"^8.10.148","@types/http-errors":"^2.0.4","@modelcontextprotocol/sdk":"^1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/middy-mcp_0.1.5_1746569609498_0.4437709745884597","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"middy-mcp","description":"Middy middleware for Model Context Protocol server","version":"0.1.6","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/fredericbarthelet/middy-mcp.git"},"type":"module","keywords":["mcp","model context protocol","middy","middleware","aws","lambda"],"author":{"name":"Frédéric Barthelet","email":"frederic.barthelet@gmail.com"},"license":"MIT","devDependencies":{"@middy/core":"^6.1.6","@modelcontextprotocol/sdk":"^1.8.0","@types/aws-lambda":"^8.10.148","@types/http-errors":"^2.0.4","@types/node":"^22.14.0","typescript":"^5.8.2","vitest":"^3.1.1"},"dependencies":{"http-errors":"^2.0.0","zod":"^3.24.2"},"scripts":{"test":"vitest","build":"tsc"},"_id":"middy-mcp@0.1.6","bugs":{"url":"https://github.com/fredericbarthelet/middy-mcp/issues"},"homepage":"https://github.com/fredericbarthelet/middy-mcp#readme","_integrity":"sha512-oPedOi2gIwKGcIOtbzZF2f8qYKb6gP726mhzcYjSgjwTHyWgWDwN6P22UfPNC3stPlGe8SijDyleukwlH/4dWA==","_resolved":"/tmp/5cf9403209f9381869ee74ef5fd03779/middy-mcp-0.1.6.tgz","_from":"file:middy-mcp-0.1.6.tgz","_nodeVersion":"20.19.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-oPedOi2gIwKGcIOtbzZF2f8qYKb6gP726mhzcYjSgjwTHyWgWDwN6P22UfPNC3stPlGe8SijDyleukwlH/4dWA==","shasum":"b018d5517556c568e0f6f3effdbb3fabc11cc0c5","tarball":"https://registry.npmjs.org/middy-mcp/-/middy-mcp-0.1.6.tgz","fileCount":9,"unpackedSize":14459,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE/Wp83ARiDSt2BL41XRziF41njAPNsjeVpuU4Ham/4lAiEA3C6xhzkrW5BlM3EFmp6sAGRamXQfqzLGlNiPZXDcyHY="}]},"_npmUser":{"name":"bartheletf","email":"frederic.barthelet@gmail.com"},"directories":{},"maintainers":[{"name":"bartheletf","email":"frederic.barthelet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/middy-mcp_0.1.6_1746570158151_0.7505465955846344"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-04T15:59:36.756Z","modified":"2025-05-06T22:22:38.502Z","0.0.1":"2025-04-04T15:59:37.008Z","0.1.1":"2025-04-10T10:20:09.161Z","0.1.5":"2025-05-06T22:13:29.667Z","0.1.6":"2025-05-06T22:22:38.323Z"},"bugs":{"url":"https://github.com/fredericbarthelet/middy-mcp/issues"},"author":{"name":"Frédéric Barthelet","email":"frederic.barthelet@gmail.com"},"license":"MIT","homepage":"https://github.com/fredericbarthelet/middy-mcp#readme","keywords":["mcp","model context protocol","middy","middleware","aws","lambda"],"repository":{"type":"git","url":"git+https://github.com/fredericbarthelet/middy-mcp.git"},"description":"Middy middleware for Model Context Protocol server","maintainers":[{"name":"bartheletf","email":"frederic.barthelet@gmail.com"}],"readme":"# Middy MCP\n\nA Middy middleware for Model Context Protocol (MCP) server integration with AWS Lambda functions.\n\n## Description\n\nMiddy MCP is a middleware that enables seamless integration between AWS Lambda functions and Model Context Protocol servers. It provides a convenient way to handle MCP requests and responses within your Lambda functions using the Middy middleware framework. It supports requests sent to AWS Lambda from API Gateway (both REST API / v1 and HTTP API / v2) using the Proxy integration, as well as requests sent form an ALB.\n\n> Disclaimer: hosting your MCP server this way is only compatible with MCP clients using at least protocol version 2025-03-26.\n\n## Install\n\n```bash\npnpm install middy-mcp\n```\n\n## Requirements\n\n- Node.js >= 18.0.0\n- Middy >= 6.0.0\n\n## Usage\n\nThis middleware can throw HTTP exceptions, so it can be convenient to use it in combination with the `@middy/http-error-handler`.\n\nHereafter is an exemple of a minimal Lambda function handler file. Deploy this lambda as a proxy integration on a `POST` route of your API Gateway and you're good to go.\n\n```typescript\nimport middy from \"@middy/core\";\nimport httpErrorHandler from \"@middy/http-error-handler\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\n\nimport mcpMiddleware from \"middy-mcp\";\n\n// Create an MCP server\nconst server = new McpServer({\n  name: \"Lambda hosted MCP Server\",\n  version: \"1.0.0\",\n});\n\n// Add an addition tool\nserver.tool(\"add\", { a: z.number(), b: z.number() }, async ({ a, b }) => ({\n  content: [{ type: \"text\", text: String(a + b) }],\n}));\n\nexport const handler = middy()\n  .use(mcpMiddleware({ server }))\n  .use(httpErrorHandler());\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to open an issue or to submit a pull request 🚀!\n","readmeFilename":"README.md"}