
Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems. In this repository, we provide an installer as well as an MCP Server for Upstash Developer API's.
This lets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Upstash account, e.g.:
- "Create a new Redis database in us-east-1"
- "List all databases"
- "See keys starting with "user:" in users-db"
- "Create a backup"
- "Give me the spikes in throughput for the last 7 days"
Usage
Requirements
How to use locally
Installing for Cursor
Add this command to the mcp list in cursor. For more info, check the Cursor MCP docs.
npx -y @upstash/mcp-server run <UPSTASH_EMAIL> <UPSTASH_API_KEY>
Installing via npx
- Run
npx @upstash/mcp-server init <UPSTASH_EMAIL> <UPSTASH_API_KEY>
. This installs the mcp server for claude.
- Restart Claude Desktop
- You should now be able to use Upstash commands in Claude Desktop
See the troubleshooting guide in the MCP documentation. You can also reach out to us at Discord.
NOTE: If you are using a node version manager like nvm or fnm, please check this issue. You should change the node
command in the MCP config to the absolute path of the node binary.
Installing via Smithery
To install Upstash for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @upstash/mcp-server --client claude
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
Development
Clone the project and run:
bun install
npm run watch
This will continuously build the project and watch for changes.
For testing, you can create a .env
file in the same directory as the project with the following content:
UPSTASH_EMAIL=<UPSTASH_EMAIL>
UPSTASH_API_KEY=<UPSTASH_API_KEY>
This will be used for setting the Claude config and running mcp inspector.
Testing with Claude Desktop
To install the Claude Desktop config for local development, run the following command:
npm run setup
This will add an upstash
entry to your MCP config file that points to the local build of the package.
{
"upstash": {
"command": "node",
"args": ["<path-to-repo>/dist/index.js", "run", "<UPSTASH_EMAIL>", "<UPSTASH_API_KEY>"]
}
}
NOTE: The same issue with node version manager applies here. Please look at the note in the usage section if you are using a node version manager.
You can now use Claude Desktop to run Upstash commands.
To view the logs from the MCP Server in real time, run the following command:
npm run logs
Testing with MCP Inspector
You can also use the MCP Inspector to test the tools.
npm run inspector
[
{
"description": "Create a new Upstash redis database. nNOTE: Ask user for the region and name of the database.nNOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.n",
"inputSchema": {
"properties": {
"name": {
"description": "Name of the database.",
"type": "string"
},
"primary_region": {
"description": "Primary Region of the Global Database.",
"enum": [
"us-east-1",
"us-west-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
"ap-southeast-1",
"ap-southeast-2",
"sa-east-1"
],
"type": "string"
},
"read_regions": {
"description": "Array of read regions of the db",
"items": {
"enum": [
"us-east-1",
"us-west-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
"ap-southeast-1",
"ap-southeast-2",
"sa-east-1"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"name",
"primary_region"
],
"type": "object"
},
"name": "redis_database_create_new"
},
{
"description": "Delete an Upstash redis database.",
"inputSchema": {
"properties": {
"database_id": {
"description": "The ID of the database to delete.",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
},
"name": "redis_database_delete"
},
{
"description": "List all Upstash redis databases. Only their names and ids.nNOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.n",
"inputSchema": {
"properties": {},
"type": "object"
},
"name": "redis_database_list_databases"
},
{
"description": "Get further details of a specific Upstash redis database. Includes all details of the database including usage statistics.ndb_disk_threshold: Total disk usage limit.ndb_memory_threshold: Maximum memory usage.ndb_daily_bandwidth_limit: Maximum daily network bandwidth usage.ndb_request_limit: Total number of commands allowed.nAll sizes are in bytesnnNOTE: Don't show the database ID from the response to the user unless explicitly asked or needed.nn ",
"inputSchema": {
"properties": {
"database_id": {
"description": "The ID of the database to get details for.",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
},
"name": "redis_database_get_details"
},
{
"description": "Update the read regions of an Upstash redis database.",
"inputSchema": {
"properties": {
"id": {
"description": "The ID of your database.",
"type": "string"
},
"read_regions": {
"description": "Array of the new read regions of the database. This will replace the old regions array. Available regions: us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-southeast-1, ap-southeast-2, sa-east-1",
"items": {
"enum": [
"us-east-1",
"us-west-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
"ap-southeast-1",
"ap-southeast-2",
"sa-east-1"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"id",
"read_regions"
],
"type": "object"
},
"name": "redis_database_update_regions"
},
{
"description": "Reset the password of an Upstash redis database.",
"inputSchema": {
"properties": {
"id": {
"description": "The ID of your database.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"name": "redis_database_reset_password"
},
{
"description": "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.nNOTE: Ask user first if they want to see stats for each database seperately or just for one.",
"inputSchema": {
"properties": {
"id": {
"description": "The ID of your database.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"name": "redis_database_get_usage_last_5_days"
},
{
"description": "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.nIncludes: read_latency_mean, write_latency_mean, keyspace, throughput (cmds/sec), diskusagenNOTE: If the user does not specify which stat to get, use throughput as default.",
"inputSchema": {
"properties": {
"id": {
"description": "The ID of your database.",
"type": "string"
},
"period": {
"description": "The period of the stats.",
"enum": [
"1h",
"3h",
"12h",
"1d",
"3d",
"7d"
],
"type": "string"
},
"type": {
"anyOf": [
{
"const": "read_latency_mean",
"type": "string"
},
{
"const": "write_latency_mean",
"type": "string"
},
{
"const": "keyspace",
"description": "Number of keys in db",
"type": "string"
},
{
"const": "throughput",
"description": "commands per second (sampled), calculate area for estimated count",
"type": "string"
},
{
"const": "diskusage",
"description": "Current disk usage in bytes",
"type": "string"
}
],
"description": "The type of stat to get"
}
},
"required": [
"id",
"period",
"type"
],
"type": "object"
},
"name": "redis_database_get_stats"
},
{
"description": "Create a backup of a specific Upstash redis database.nNOTE: Ask user to choose a name for the backup",
"inputSchema": {
"properties": {
"backup_name": {
"description": "A name for the backup.",
"type": "string"
},
"database_id": {
"description": "The ID of the database to create a backup for.",
"type": "string"
}
},
"required": [
"database_id",
"backup_name"
],
"type": "object"
},
"name": "redis_database_create_backup"
},
{
"description": "Delete a backup of a specific Upstash redis database.",
"inputSchema": {
"properties": {
"backup_id": {
"description": "The ID of the backup to delete.",
"type": "string"
},
"database_id": {
"description": "The ID of the database to delete a backup from.",
"type": "string"
}
},
"required": [
"database_id",
"backup_id"
],
"type": "object"
},
"name": "redis_database_delete_backup"
},
{
"description": "Restore a backup of a specific Upstash redis database. A backup can only be restored to the same database it was created from.",
"inputSchema": {
"properties": {
"backup_id": {
"description": "The ID of the backup to restore.",
"type": "string"
},
"database_id": {
"description": "The ID of the database to restore a backup to.",
"type": "string"
}
},
"required": [
"database_id",
"backup_id"
],
"type": "object"
},
"name": "redis_database_restore_backup"
},
{
"description": "List all backups of a specific Upstash redis database.",
"inputSchema": {
"properties": {
"database_id": {
"description": "The ID of the database to list backups for.",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
},
"name": "redis_database_list_backups"
},
{
"description": "Enable or disable daily backups for a specific Upstash redis database.",
"inputSchema": {
"properties": {
"database_id": {
"description": "The ID of the database to enable or disable daily backups for.",
"type": "string"
},
"enable": {
"description": "Whether to enable or disable daily backups.",
"type": "boolean"
}
},
"required": [
"database_id",
"enable"
],
"type": "object"
},
"name": "redis_database_set_daily_backup"
},
{
"description": "Run a single Redis command on a specific Upstash redis database.nNOTE: For discovery, use SCAN over KEYS. Use TYPE to get the type of a key.nNOTE: SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]",
"inputSchema": {
"properties": {
"command": {
"description": "The Redis command to run. Example: ['SET', 'foo', 'bar', 'EX', 100]",
"items": {
"type": "string"
},
"type": "array"
},
"database_rest_token": {
"description": "The REST token of the database.",
"type": "string"
},
"database_rest_url": {
"description": "The REST URL of the database. Example: https://***.upstash.io",
"type": "string"
}
},
"required": [
"database_rest_url",
"database_rest_token",
"command"
],
"type": "object"
},
"name": "redis_database_run_single_redis_command"
},
{
"description": "Run multiple Redis commands on a specific Upstash redis database",
"inputSchema": {
"properties": {
"commands": {
"description": "The Redis commands to run. Example: [['SET', 'foo', 'bar'], ['GET', 'foo']]",
"items": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "array"
},
"database_rest_token": {
"description": "The REST token of the database.",
"type": "string"
},
"database_rest_url": {
"description": "The REST URL of the database. Example: https://***.upstash.io",
"type": "string"
}
},
"required": [
"database_rest_url",
"database_rest_token",
"commands"
],
"type": "object"
},
"name": "redis_database_run_multiple_redis_commands"
},
{
"description": "Use this tool to convert a timestamp to a human-readable date",
"inputSchema": {
"properties": {
"timestamps": {
"description": "Array of timestamps to convert",
"items": {
"type": "number"
},
"type": "array"
}
},
"required": [
"timestamps"
],
"type": "object"
},
"name": "timestamps_to_date"
}
]