MCP Server Authorization Example with AWS Cognito
MCP + OAuth2.1 + AWS Cognito Example MCP server exists for a simple reason — assistants are far more useful when they can act on MCP + OAuth2.1 + AWS Cognito Example directly instead of describing what you should do. MCP Server Authorization Example with AWS Cognito.
This repository demonstrates how to secure a Model Context Protocol (MCP) server using OAuth 2.1 authorization flows, implemented entirely with Node.js and Express.js. While this example uses AWS Cognito as the backing authorization server, the implementation is provider-agnostic and can work with any OAuth 2.1 compliant authorization server.
Once MCP + OAuth2.1 + AWS Cognito Example is connected, these are the calls the assistant has available:
Provider — agnostic OAuth 2.1 implementation (example uses AWS Cognito)Auto — discovery client with dynamic registration (DCR)Clients — Discover authorization servers dynamically without hardcoded provider-specific logicPre — registered** client credentials (if available for the server)Prerequisites — The Prerequisites tool exposed by this serverSetup — 1. Clone the repository bash git clone https://github.com/empires-security/mcp-oauth2-aws-cognito.git cd mcp-oauth2-aws-cognitoCleanup — 1. Cleanup AWS resources bash npm run cleanupYou will need one environment variable: CLIENT_SECRET. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.
Plenty of cloud and infrastructure servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. MCP + OAuth2.1 + AWS Cognito Example's toolset — Provider, Auto, Clients and 4 more — is a fair guide to whether it matches your workflow. It is maintained by empires-security; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| Tool | What it does |
|---|---|
| Provider | agnostic OAuth 2.1 implementation (example uses AWS Cognito) |
| Auto | discovery client with dynamic registration (DCR) |
| Clients | Discover authorization servers dynamically without hardcoded provider-specific logic |
| Pre | registered** client credentials (if available for the server) |
| Prerequisites | The Prerequisites tool exposed by this server. |
| Setup | 1. Clone the repository bash git clone https://github.com/empires-security/mcp-oauth2-aws-cognito.git cd mcp-oauth2-aws-cognito |
| Cleanup | 1. Cleanup AWS resources bash npm run cleanup |
| Variable | Description | Required |
|---|---|---|
| CLIENT_SECRET | Credential the server authenticates with. | Yes |
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.
AWS Labs' official server suite — current AWS docs, CDK guidance, cost analysis and service tools.
Cloud browsers for AI agents — automation sessions that run in Browserbase's fleet, not on your machine.
Workers, KV, R2 and D1 by conversation — Cloudflare's official remote servers for building and observability.
Dashboards, Prometheus and Loki queries, incidents and alerts — observability by conversation.