Upstash MCP Server

Upstash MCP Server
官方

模型上下文协议(MCP)是一种新的标准化协议,用于管理大型语言模型(LLM)和外部系统之间的上下文。 在此存储库中,我们提供了一个安装程序以及一个用于 Upstash Developer API 的 MCP 服务器。

AI集成系统
访问服务器

Tools

redis_database_create_new

Create a new Upstash redis database. NOTE: Ask user for the region and name of the database. NOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.

redis_database_delete

Delete an Upstash redis database.

redis_database_list_databases

List all Upstash redis databases. Only their names and ids. NOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.

timestamps_to_date

Use this tool to convert a timestamp to a human-readable date

redis_database_run_multiple_redis_commands

Run multiple Redis commands on a specific Upstash redis database

redis_database_run_single_redis_command

Run a single Redis command on a specific Upstash redis database. NOTE: For discovery, use SCAN over KEYS. Use TYPE to get the type of a key. NOTE: SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]

redis_database_get_details

Get further details of a specific Upstash redis database. Includes all details of the database including usage statistics. db_disk_threshold: Total disk usage limit. db_memory_threshold: Maximum memory usage. db_daily_bandwidth_limit: Maximum daily network bandwidth usage. db_request_limit: Total number of commands allowed. All sizes are in bytes NOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.

redis_database_update_regions

Update the read regions of an Upstash redis database.

redis_database_reset_password

Reset the password of an Upstash redis database.

redis_database_get_usage_last_5_days

Get PRECISE command count and bandwidth usage statistics of an Upstash redis database over the last 5 days. This is a precise stat, not an average. NOTE: Ask user first if they want to see stats for each database seperately or just for one.

redis_database_get_stats

Get SAMPLED usage statistics of an Upstash redis database over a period of time (1h, 3h, 12h, 1d, 3d, 7d). Use this to check for peak usages and latency problems. Includes: read_latency_mean, write_latency_mean, keyspace, throughput (cmds/sec), diskusage NOTE: If the user does not specify which stat to get, use throughput as default.

redis_database_create_backup

Create a backup of a specific Upstash redis database. NOTE: Ask user to choose a name for the backup

redis_database_delete_backup

Delete a backup of a specific Upstash redis database.

redis_database_restore_backup

Restore a backup of a specific Upstash redis database. A backup can only be restored to the same database it was created from.

redis_database_list_backups

List all backups of a specific Upstash redis database.

redis_database_set_daily_backup

Enable or disable daily backups for a specific Upstash redis database.

README

Upstash MCP 服务器

smithery badge

模型上下文协议 (MCP) 是一种用于管理大型语言模型 (LLM) 和外部系统之间上下文的新的标准化协议。 在此存储库中,我们提供了一个安装程序以及一个用于 Upstash Developer API 的 MCP 服务器。

这允许您使用任何 MCP 客户端,通过自然语言与您的 Upstash 帐户进行交互,例如:

  • "在 us-east-1 中创建一个新的 Redis 数据库"
  • "列出我的数据库"
  • "列出 users-db 中以 "user:" 开头的键"
  • "创建一个备份"
  • "给我过去 7 天的吞吐量峰值"

用法

要求

如何在本地使用

为 Claude Desktop 安装

要通过 Smithery 自动为 Claude Desktop 安装 Upstash MCP 服务器,请运行以下命令:

npx -y @smithery/cli@latest install @upstash/mcp-server --client claude

<details> <summary>不使用 Smithery 安装</summary>

npx @upstash/mcp-server init <UPSTASH_EMAIL> <UPSTASH_API_KEY>

这将编辑您的 MCP 配置文件,并为 Upstash 添加一个条目。

</details>

为 Cursor 安装

要通过 Smithery 自动为 Cursor 安装 Upstash MCP 服务器,请运行以下命令:

npx -y @smithery/cli@latest install @upstash/mcp-server --client cursor

<details> <summary>不使用 Smithery 安装</summary>

将以下命令添加到 Cursor 中的 MCP 配置。 有关更多信息,请查看 Cursor MCP 文档

npx -y @upstash/mcp-server run <UPSTASH_EMAIL> <UPSTASH_API_KEY>

</details>

为 Windsurf 安装

要通过 Smithery 自动为 Windsurf 安装 Upstash MCP 服务器,请运行以下命令:

npx -y @smithery/cli@latest install @upstash/mcp-server --client windsurf

<details> <summary>不使用 Smithery 安装</summary>

将以下命令添加到 Windsurf 中的 MCP 配置。 有关更多信息,请查看 Windsurf MCP 文档

npx -y @upstash/mcp-server run <UPSTASH_EMAIL> <UPSTASH_API_KEY>

</details>

使用 Docker 运行

您还可以使用提供的 Docker 镜像来运行服务器。

docker build -t upstash-mcp .

# 运行 stdio 服务器,将此命令添加到您的 MCP 配置
docker run --rm -i \
  -e UPSTASH_EMAIL=<UPSTASH_EMAIL> \
  -e UPSTASH_API_KEY=<UPSTASH_API_KEY> \
  upstash-mcp

故障排除

常见问题

由于您的 shell 和系统 PATH 之间的差异,您的 mcp 客户端可能难以找到正确的二进制文件。

要解决此问题,您可以通过在 shell 中运行 which npxwhich docker 来获取二进制文件的完整路径,并将 MCP 配置中的 npxdocker 命令替换为完整的二进制文件路径。

Node 版本管理器

如果您使用的是像 nvm 或 fnm 这样的 node 版本管理器,请查看此问题。 您应该将 MCP 配置中的 node 命令更改为 node 二进制文件的绝对路径。

其他故障排除

请参阅 MCP 文档中的故障排除指南。 您也可以通过 Discord 与我们联系。

工具

Redis

  • redis_database_create_backup
  • redis_database_create_new
  • redis_database_delete
  • redis_database_delete_backup
  • redis_database_get_details
  • redis_database_list_backups
  • redis_database_list_databases
  • redis_database_reset_password
  • redis_database_restore_backup
  • redis_database_run_multiple_redis_commands
  • redis_database_run_single_redis_command
  • redis_database_set_daily_backup
  • redis_database_update_regions
  • redis_database_get_usage_last_5_days
  • redis_database_get_stats

开发

克隆项目并运行:

pnpm install
pnpm run watch

这将持续构建项目并监视更改。

对于测试,您可以在与项目相同的目录中创建一个 .env 文件,其中包含以下内容:

UPSTASH_EMAIL=<UPSTASH_EMAIL>
UPSTASH_API_KEY=<UPSTASH_API_KEY>

这将用于设置 Claude 配置和运行 mcp inspector。

使用 Claude Desktop 进行测试

要为本地开发安装 Claude Desktop 配置,请运行以下命令:

pnpm run setup

这会将一个 upstash 条目添加到您的 MCP 配置文件,该条目指向该软件包的本地构建。

{
  "upstash": {
    "command": "node",
    "args": ["<path-to-repo>/dist/index.js", "run", "<UPSTASH_EMAIL>", "<UPSTASH_API_KEY>"]
  }
}

注意:node 版本管理器的相同问题也适用于此处。 如果您使用的是 node 版本管理器,请查看用法部分中的说明。

您现在可以使用 Claude Desktop 运行 Upstash 命令。

要实时查看 MCP 服务器的日志,请运行以下命令:

pnpm run logs

使用 MCP Inspector 进行测试

您还可以使用 MCP Inspector 来测试这些工具。

pnpm run inspector