# 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. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Add to your `.mcp.json`: ```json { "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" } } } } ``` Create a free database at [console.upstash.com](https://console.upstash.com). Restart Claude Code. --- ## Intro Upstash MCP is a Model Context Protocol server that connects AI agents to Upstash serverless Redis and Kafka with 2,000+ GitHub stars. Cache data, implement rate limiting, manage session state, and publish messages to queues — all serverless with zero infrastructure and pay-per-request pricing. Your AI agent gains persistent key-value storage and messaging capabilities without deploying Redis or Kafka. Best for developers building AI applications that need caching or messaging without DevOps overhead. Works with: Claude Code, Cursor, any MCP client. Setup time: under 2 minutes. --- ## Available Tools ### Redis Operations ``` "Store the API response in cache with key 'weather:tokyo' and 60 second TTL" "Get the cached value for key 'user:123:preferences'" "Increment the rate limit counter for IP 192.168.1.1" "List all keys matching 'session:*'" ``` ### Rate Limiting ``` "Check if user_123 has exceeded 100 requests per minute" "Set up sliding window rate limiting: 1000 requests per hour per API key" ``` ### Pub/Sub (Kafka) ``` "Publish a message to the 'notifications' topic" "Show recent messages from the 'events' queue" ``` ## Why Serverless Redis | Traditional Redis | Upstash | |------------------|---------| | Manage server | Zero infrastructure | | Pay for idle | Pay per request | | Scale manually | Auto-scales | | Backup yourself | Built-in persistence | | TCP connections | REST API (edge-compatible) | ### Edge Compatible Works in Cloudflare Workers, Vercel Edge, Deno Deploy: ```typescript import { Redis } from "@upstash/redis"; const redis = Redis.fromEnv(); await redis.set("key", "value", { ex: 60 }); ``` ### Free Tier - 10,000 commands/day - 256MB storage - Global replication ### Key Stats - 2,000+ GitHub stars - Serverless Redis + Kafka - Pay-per-request pricing - Edge-compatible REST API - Free tier: 10K commands/day ### FAQ **Q: What is Upstash MCP?** A: An MCP server connecting AI agents to Upstash serverless Redis and Kafka for caching, rate limiting, and messaging with zero infrastructure. **Q: Is Upstash free?** A: Free tier: 10K commands/day. Pay-as-you-go after that. **Q: Can I use it for AI agent memory?** A: Yes, store conversation context, user preferences, and session data in Redis with TTL for automatic cleanup. --- ## Source & Thanks > Created by [Upstash](https://github.com/upstash). Licensed under MIT. > > [upstash](https://github.com/upstash/upstash-redis) — stars 2,000+ --- ## 快速使用 添加到 `.mcp.json`: ```json { "mcpServers": { "upstash": { "command": "npx", "args": ["-y", "@upstash/mcp-server"], "env": { "UPSTASH_REDIS_REST_URL": "https://你的.upstash.io", "UPSTASH_REDIS_REST_TOKEN": "你的令牌" } } } } ``` --- ## 简介 Upstash MCP 是连接 AI Agent 到 Upstash 无服务器 Redis 和 Kafka 的 MCP 服务器,GitHub 2,000+ stars。缓存、限流、消息队列,零基础设施,按请求付费。 --- ## 来源与感谢 > Created by [Upstash](https://github.com/upstash). Licensed under MIT. --- Source: https://tokrepo.com/en/workflows/e0ed3953-1666-435f-8a4b-f81b4d1447bb Author: MCP Hub