Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-aws-cognito

一个基于AWS Cognito的MCP服务器实现,提供用户认证和管理功能

article

README

🚀 AWS Cognito MCP 服务器

这是一个 Model Context Protocol (MCP) 服务器的实现,它能够连接到 AWS Cognito 进行身份验证和用户管理。该服务器提供了一系列工具,可处理用户认证流程,涵盖注册、登录、密码管理等功能。

🚀 快速开始

先决条件

  • 需配备 AWS 账户,并且已配置好 Cognito 用户池。
  • 安装 Node.js 18 或更高版本。

📦 安装指南

# 克隆仓库
git clone https://github.com/yourusername/mcp-server-aws-cognito.git

# 安装依赖项
cd mcp-server-aws-cognito
npm install

# 构建服务器
npm run build

📚 详细文档

AWS Cognito 配置

  1. 登录 AWS 控制台并导航至 Amazon Cognito。
  2. 创建用户池或使用现有用户池。
  3. 记下您的用户池 ID 和应用客户端 ID。
  4. 将这些值设置为环境变量或在 .env 文件中(仅當您使用 claude 代码时需要,而不是 claude 桌面):
AWS_COGNITO_USER_POOL_ID=your-user-pool-id
AWS_COGNITO_USER_POOL_CLIENT_ID=your-app-client-id

可用工具

| 工具名称 | 描述 | 参数 | |----------|-------|------| | sign_up | 注册新用户 | email: string, password: string | | sign_up_confirm_code_from_email | 使用确认代码验证账户 | username: string, confirmationCode: string | | sign_in | 用户登录 | username: string, password: string | | sign_out | 用户注销 | 无参数 | | getCurrentUser | 获取当前已登录用户 | 无参数 | | reset_password_send_code | 请求重置密码代码 | username: string | | reset_password_veryify_code | 使用验证代码重置密码 | username: string, code: string, newPassword: string | | change_password | 更改已登录用户的密码 | oldPassword: string, newPassword: string | | refresh_session | 刷新身份验证令牌 | 无参数 | | update_user_attributes | 更新用户属性 | attributes: Array of {name: string, value: string} | | delete_user | 删除当前已登录用户 | 无参数 | | resend_confirmation_code | 重新发送账户验证代码 | username: string | | verify_software_token | 验证 TOTP 进行 MFA | username: string, totpCode: string |

Inspector 提供一个 URL,用于在浏览器中访问调试工具。

与 Claude Desktop 使用

在开始之前,请确保已安装 Node.js(仅用于 npx)。

  1. 转到:设置 > 开发者 > 编辑配置。
  2. 将以下内容添加到您的 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"
      }
    }
  }
}

与 Claude Code 使用

Claude Code 的命令行界面提供以下命令:

  • claude add mcp-server: 添加一个新的 MCP 服务器。
  • claude update mcp-server: 更新现有的 MCP 服务器配置。
  • claude remove mcp-server: 删除 MCP 服务器配置。

开发信息

  • npm run dev: 使用开发模式运行服务器(自动重建)。
  • npm run build: 构建生产环境。
  • npm start: 在生产环境中启动服务器。
  • npm install: 安装项目依赖项。
READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client