AWS Cognito MCP server

Integrates with AWS Cognito to provide user authentication flows including sign-up, sign-in, password management, account verification, and multi-factor authentication for secure identity management.
Back to servers
Setup instructions
Provider
gitCarrot
Release date
Mar 24, 2025
Language
TypeScript

This MCP server implementation connects to AWS Cognito for user authentication and management. It provides tools for handling various authentication flows including sign-up, sign-in, password management, and more through Claude's Model Context Protocol.

Prerequisites

  • AWS account with Cognito User Pool configured
  • Node.js 18 or higher

Installation

# Clone the repository
git clone https://github.com/yourusername/mcp-server-aws-cognito.git

# Install dependencies
cd mcp-server-aws-cognito
npm install

# Build the server
npm run build

AWS Cognito Configuration

  1. Log in to your AWS Console and navigate to Amazon Cognito
  2. Create a User Pool or use an existing one
  3. Note your User Pool ID and App Client ID
  4. Set these values as environment variables or in a .env file (you need .env file only when you use Claude code, not Claude desktop):
AWS_COGNITO_USER_POOL_ID=your-user-pool-id
AWS_COGNITO_USER_POOL_CLIENT_ID=your-app-client-id

Available Authentication Tools

The server provides the following authentication tools:

Tool Name Description Parameters
sign_up Register a new user email: string, password: string
sign_up_confirm_code_from_email Verify account with confirmation code username: string, confirmationCode: string
sign_in Authenticate a user username: string, password: string
sign_out Sign out the current user None
getCurrentUser Get the current signed-in user None
reset_password_send_code Request password reset code username: string
reset_password_veryify_code Reset password with verification code username: string, code: string, newPassword: string
change_password Change password for signed-in user oldPassword: string, newPassword: string
refresh_session Refresh the authentication tokens None
update_user_attributes Update user profile attributes attributes: Array of {name: string, value: string}
delete_user Delete the current signed-in user None
resend_confirmation_code Resend account verification code username: string
verify_software_token Verify TOTP for MFA username: string, totpCode: string

Using with Claude Desktop

Before starting make sure Node.js is installed on your desktop for npx to work.

  1. Go to: Settings > Developer > Edit Config

  2. Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "aws-cognito-mcp-server": {
      "command": "/path/to/mcp-server-aws-cognito/build/index.js",
      "env": {
        "AWS_COGNITO_USER_POOL_ID": "your-user-pool-id",
        "AWS_COGNITO_USER_POOL_CLIENT_ID": "your-app-client-id"
      }
    }
  }
}

Using with Claude Code

To use this MCP server with Claude Code:

  1. Install Claude Code by following the instructions at Claude Code Documentation

  2. Add the MCP server to Claude Code:

claude mcp add "aws-cognito-mcp" npx tsx index.ts
  1. Verify it's been added:
claude mcp list
  1. Run Claude with your MCP server:
claude

Debugging

The Inspector provides a URL to access debugging tools in your browser. You can launch it with:

npm run inspector

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "aws-cognito-mcp-server" '{"command":"/path/to/mcp-server-aws-cognito/build/index.js","env":{"AWS_COGNITO_USER_POOL_ID":"your-user-pool-id","AWS_COGNITO_USER_POOL_CLIENT_ID":"your-app-client-id"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "aws-cognito-mcp-server": {
            "command": "/path/to/mcp-server-aws-cognito/build/index.js",
            "env": {
                "AWS_COGNITO_USER_POOL_ID": "your-user-pool-id",
                "AWS_COGNITO_USER_POOL_CLIENT_ID": "your-app-client-id"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "aws-cognito-mcp-server": {
            "command": "/path/to/mcp-server-aws-cognito/build/index.js",
            "env": {
                "AWS_COGNITO_USER_POOL_ID": "your-user-pool-id",
                "AWS_COGNITO_USER_POOL_CLIENT_ID": "your-app-client-id"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later