mcp-oauth2-aws-cognito
If you are the rightful owner of mcp-oauth2-aws-cognito and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This repository demonstrates how to secure a Model Context Protocol (MCP) server using OAuth 2.1 authorization flows with AWS Cognito, implemented entirely with Node.js and Express.js.
The project showcases the integration of a Model Context Protocol (MCP) server with AWS Cognito using OAuth 2.1 authorization flows. It acts as a Resource Server (RS) while AWS Cognito functions as the Authorization Server (AS). The implementation includes OAuth 2.1 Authorization Code Flow with PKCE, Protected Resource Metadata (PRM) document discovery, dynamic discovery of Authorization Server metadata, and Dynamic Client Registration (DCR) support. Two client implementations are provided: a static client with pre-configured credentials and an auto-discovery client with dynamic registration. The architecture involves a client sending requests to the MCP server, which responds with metadata for authorization, allowing the client to perform OAuth flows and access protected resources.
Features
- OAuth 2.1 Authorization Code Flow with PKCE
- Protected Resource Metadata (PRM) document discovery
- Dynamic discovery of Authorization Server metadata
- Dynamic Client Registration (DCR) support
- Integration with AWS Cognito as Authorization Server