MCP ConfigsApr 7, 2026·2 min read

Upstash MCP — Serverless Redis & Kafka for AI Agents

MCP server for Upstash serverless Redis and Kafka. Give AI agents access to caching, rate limiting, pub/sub, and message queues with zero infrastructure. Pay-per-request pricing. 2,000+ stars.

TL;DR
Upstash MCP lets AI agents like Claude Code access serverless Redis and Kafka for caching, rate limiting, and message queues.
§01

What it is

Upstash MCP is a Model Context Protocol server that gives AI agents access to Upstash's serverless Redis and Kafka services. With this MCP server configured, Claude Code or Cursor can create caches, set rate limits, publish messages, and manage queues through natural language tool calls.

It targets developers who use AI coding agents and need database operations without provisioning or managing infrastructure. Upstash's pay-per-request pricing means you only pay for what your agent uses.

§02

How it saves time or tokens

Without this MCP server, interacting with Redis or Kafka from an AI agent requires pasting connection strings, writing client code, and managing credentials manually in each conversation. The MCP server handles all of this: credentials are configured once, and the agent calls high-level tools like 'set key' or 'publish message' directly.

The estimated token cost for this workflow is approximately 2,400 tokens.

§03

How to use

  1. Add to your MCP configuration:
{
  "mcpServers": {
    "upstash": {
      "command": "npx",
      "args": ["-y", "@upstash/mcp-server"],
      "env": {
        "UPSTASH_REDIS_REST_URL": "https://your-db.upstash.io",
        "UPSTASH_REDIS_REST_TOKEN": "your-token"
      }
    }
  }
}
  1. Restart your AI agent (Claude Code or Cursor).
  1. Ask the agent to interact with Redis:
You: Cache the user profile for user_123 with a 1-hour TTL
Agent: I will use the Upstash Redis MCP to set the key...
§04

Example

# Example MCP tool calls the agent makes:

# Set a cache key with TTL
redis.set('user:123:profile', '{"name": "Alice"}', { ex: 3600 })

# Rate limiting check
redis.incr('ratelimit:api:user:123')
redis.expire('ratelimit:api:user:123', 60)

# Pub/Sub publish
redis.publish('notifications', '{"type": "alert", "msg": "deploy done"}')

# Kafka produce (if Kafka is configured)
kafka.produce('events', { key: 'user_123', value: '{"action": "login"}' })
§05

Related on TokRepo

§06

Common pitfalls

  • Upstash requires an account and API credentials. The MCP server does not work without valid UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN environment variables.
  • Pay-per-request pricing can accumulate if the AI agent runs many operations in a loop. Monitor your Upstash dashboard for unexpected usage spikes.
  • Kafka features require a separate Upstash Kafka instance with its own credentials. Redis and Kafka are configured independently.

Frequently Asked Questions

What is the difference between Upstash Redis and regular Redis?+

Upstash Redis is a serverless, HTTP-based Redis service. You do not manage servers or connections. It uses a REST API instead of the Redis protocol, which makes it work well with serverless functions and MCP servers. Data is persisted and replicated automatically.

Does the MCP server support all Redis commands?+

The MCP server exposes a curated set of Redis operations optimized for AI agent use cases: key-value operations, lists, sets, sorted sets, and pub/sub. Advanced commands like Lua scripting or cluster management are not exposed.

Can I use this with Claude Desktop?+

Yes. Add the MCP server configuration to your Claude Desktop's MCP config file. The same configuration works for Claude Code, Claude Desktop, and Cursor.

What is the pricing model?+

Upstash charges per request with a generous free tier. There is no fixed monthly cost for small usage. Check upstash.com for current pricing details and free tier limits.

Is my data encrypted?+

Upstash encrypts data in transit via HTTPS and at rest. The REST API uses token-based authentication. Do not store unencrypted secrets or PII in Redis keys without your own encryption layer.

Citations (3)
🙏

Source & Thanks

Created by Upstash. Licensed under MIT.

upstash — stars 2,000+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.