Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

subscribe

Subscribe to a Redis channel to receive real-time updates. Specify the channel to monitor data changes effectively.

Instructions

Subscribe to a Redis channel.

Args: channel: The Redis channel to subscribe to.

Returns: A success message or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes

Implementation Reference

  • The 'subscribe' tool handler: an async function decorated with @mcp.tool() that subscribes to a Redis channel using pubsub and returns a success or error message.
    @mcp.tool() async def subscribe(channel: str) -> str: """Subscribe to a Redis channel. Args: channel: The Redis channel to subscribe to. Returns: A success message or an error message. """ try: r = RedisConnectionManager.get_connection() pubsub = r.pubsub() pubsub.subscribe(channel) return f"Subscribed to channel '{channel}'." except RedisError as e: return f"Error subscribing to channel '{channel}': {str(e)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/redis/mcp-redis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server