Skip to main content
The redis MCP adapter connects to Redis with an address (host:port), optional ACL username/password, and a logical database index. It provides key-value helpers (GET, SET, INCR, TTL management) plus a generic redis_run_command escape hatch for any Redis command. Use it for caching, rate limiting, session state, distributed counters, idempotency guards, and lightweight coordination alongside Postgres or MySQL backends.

Prerequisites

  • A Redis server (standalone, Sentinel, or managed — ElastiCache, Memorystore, etc.) reachable from AgentRuntime
  • Connection address as host:port and optional ACL username/password
  • Logical database index if not using the default (0)
  • TLS requirements understood if your provider requires encrypted connections (configure at the network/proxy layer)
  • project_contributor access

Connect in AgentRuntime

1

Create a connection

Go to Connections and click New custom connection to create a connection with your Redis settings:
  • Addr — server address as host:port (e.g. redis.example.com:6379)
  • Password — Redis password or ACL secret (omit for unauthenticated Redis)
  • Username — ACL username when required (omit for password-only auth)
  • DB — logical database index (default 0)
2

Add redis MCP instance

Go to MCP, click Add instance for redis, wire your connection on Instance config, set the profile active, and save.
3

Test connectivity

Add a workflow with mcp_callredis_run_command with command: "PING". Run it to confirm the server responds before production use.
4

Verify key operations (optional)

Run mcp_callredis_set with a test key and short TTL, then redis_get to confirm read/write access on the selected DB index.
See Authentication for binding connections to MCP instances.

What you can build

  • Rate-limited API callsredis_incr on a per-tenant key → branch workflow when count exceeds threshold.
  • Idempotency guardredis_exists on a webhook event ID → skip duplicate processing with redis_set + TTL.
  • Cache warming — Scheduled fetch from Postgresredis_set with ttl_seconds for fast Autopilot lookups.
  • Distributed counterredis_incr / redis_decr for usage metering → sync totals to billing on interval.

Tools

ToolDescription
redis_run_commandRun any Redis command with arguments
redis_ttlGet the remaining TTL for a Redis key in seconds
redis_decrDecrement an integer value at a Redis key by 1
redis_getGet the string value stored at a Redis key
redis_setStore a string value at a Redis key, with an optional TTL
redis_delDelete one or more Redis keys
redis_existsCheck whether a Redis key exists
redis_expireSet a Redis key TTL in seconds
redis_incrIncrement an integer value at a Redis key by 1

Example

Cache an API response for one hour:
{
  "id": "cache-result",
  "type": "mcp_call",
  "name": "Cache API response",
  "tool_name": "redis_set",
  "tool_args": {
    "key": "cache:weather:{{input.city}}",
    "value": "{{steps.fetch-weather.result.body}}",
    "ttl_seconds": 3600
  },
  "depends_on": ["fetch-weather"],
  "timeout_s": 10
}

Configuration

KeyRequiredDefaultDescription
redis_addrNo127.0.0.1:6379Redis server address as host:port
redis_usernameNoACL username when Redis AUTH requires it
redis_passwordNoRedis password or ACL secret
redis_dbNo0Logical database index (0–15 on default Redis)

Troubleshooting

IssueFix
Connection refusedVerify Addr, TLS requirements, and firewall rules
NOAUTH / WRONGPASSSet Password and Username to match ACL or legacy AUTH config
Key not found on redis_getCheck found in the response; keys may have expired (use redis_ttl)
redis_incr on non-integerEnsure the key holds an integer string or delete and recreate it
Wrong data returnedConfirm DB index matches the namespace your app uses