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.
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install e0ed3953-1666-435f-8a4b-f81b4d1447bb --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
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.
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.
How to use
- 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"
}
}
}
}
- Restart your AI agent (Claude Code or Cursor).
- 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...
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"}' })
Related on TokRepo
- MCP Integrations -- Database tools and MCP servers for AI agents
- AI Tools for Automation -- Workflow automation with AI agents
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.
常见问题
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.
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.
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.
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.
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.
引用来源 (3)
- Upstash MCP GitHub— Upstash MCP server for serverless Redis and Kafka
- Upstash Documentation— Upstash provides serverless Redis with REST API
- MCP Specification— Model Context Protocol for AI agent tool integration
TokRepo 相关
来源与感谢
Created by Upstash. Licensed under MIT.
讨论
相关资产
Turbopuffer MCP — Serverless Vector DB for AI Agents
MCP server for Turbopuffer serverless vector database. Sub-10ms search, zero ops, auto-scaling. Perfect for AI agent memory and RAG without managing infrastructure. 1,200+ stars.
Redis MCP Server — Official Redis for AI Agents
Official Redis MCP server enabling AI agents to manage Redis data via natural language. Supports strings, hashes, lists, sets, streams, JSON, pub/sub, and vector search. MIT license.
Neon MCP — Serverless Postgres via AI Agents
MCP server for Neon serverless Postgres. Create projects, branch databases, run SQL, optimize queries via natural language. Safe migration workflow with branching. MIT, 574+ stars.
Apify MCP Server — 8,000+ Web Scrapers for Agents
Apify MCP Server connects agents to Apify Actors via a hosted endpoint (mcp.apify.com) or local run, turning thousands of web scrapers into callable tools.