{"id":27042759,"url":"https://github.com/fredericbarthelet/middy-mcp","last_synced_at":"2025-04-09T18:30:12.749Z","repository":{"id":286140033,"uuid":"960447870","full_name":"fredericbarthelet/middy-mcp","owner":"fredericbarthelet","description":"Middy middleware for Model Context Protocol server hosting on AWS Lambda","archived":false,"fork":false,"pushed_at":"2025-04-04T15:32:21.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T15:36:09.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredericbarthelet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-04T13:01:02.000Z","updated_at":"2025-04-04T15:32:24.000Z","dependencies_parsed_at":"2025-04-04T15:47:51.662Z","dependency_job_id":null,"html_url":"https://github.com/fredericbarthelet/middy-mcp","commit_stats":null,"previous_names":["fredericbarthelet/middy-mcp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericbarthelet%2Fmiddy-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericbarthelet%2Fmiddy-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericbarthelet%2Fmiddy-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericbarthelet%2Fmiddy-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredericbarthelet","download_url":"https://codeload.github.com/fredericbarthelet/middy-mcp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289382,"owners_count":20914463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-05T04:31:31.067Z","updated_at":"2025-04-05T04:31:45.247Z","avatar_url":"https://github.com/fredericbarthelet.png","language":"TypeScript","funding_links":[],"categories":["📚 Projects (1974 total)"],"sub_categories":["MCP Servers"],"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\u003e 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 \u003e= 18.0.0\n- Middy \u003e= 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 }) =\u003e ({\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericbarthelet%2Fmiddy-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredericbarthelet%2Fmiddy-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericbarthelet%2Fmiddy-mcp/lists"}