Minimal Redis-backed channel integration for Claude Code
Project description
Claude Code Redis Channels (claude-code-redis-channels)
A minimal Redis-backed channel integration for Claude Code, implemented in Python.
Overview
This package provides an MCP (Model Context Protocol) server that enables Claude Code to receive events and send replies via Redis. It supports multi-agent scenarios, inter-agent synchronization, and a synchronous "await" bridge for external callers.
Features
- Python-Native: Built with
mcpPython SDK andasyncio. - Multi-Agent Support: Route messages to specific agents via unique
AGENT_ID. - Two-Way Support: Reply to messages from Claude Code using a Redis
replytool. - Sync-over-Async: Await an agent's response via a blocking HTTP endpoint (
GET /await/{agent_id}). - Inter-Agent Coordination: Agents can wait for each other indefinitely using the
await_messagetool. - Minimal Dependencies: Only requires
mcp,redis,starlette, anduvicorn.
Setup
Requirements
- Python 3.12+
uv(recommended)
Installation
uv tool install .
Configuration
Add the server to your .mcp.json:
{
"mcpServers": {
"redis-channel": {
"command": "uv",
"args": ["run", "--package", "claude-code-redis-channels", "redis-channel"],
"env": {
"REDIS_URI": "redis://localhost:6379",
"AGENT_ID": "dallas-main",
"HTTP_PORT": "8000"
}
}
}
}
Await Endpoint (Sync Bridge)
The server can optionally host an HTTP endpoint that blocks until the agent sends a reply. This allows CLI scripts or microservices to "wait" for Claude to finish.
# In one terminal, wait for Claude's next message (indefinite wait)
curl "http://localhost:8000/await/dallas-main"
# In Claude Code:
# > reply chat_id="123" text="Task complete!"
Usage
Start Claude Code with the development channel flag:
claude --dangerously-load-development-channels server:redis-channel
Sending Messages
Send a JSON payload to a specific agent's inbox:
redis-cli PUBLISH claude:inbox:dallas-main '{"content": "Hello Dallas!", "meta": {"chat_id": "123"}}'
Inter-Agent Communication
Agents can wait for each other indefinitely within their session:
await_message(target_agent_id="other-agent")
Testing
A manual integration test script is included in scripts/test_mcp.py. It simulates a Claude Code session and verifies Redis communication.
uv run scripts/test_mcp.py
Note: Requires a running Redis instance on localhost:6379.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_code_redis_channels-0.1.0.tar.gz.
File metadata
- Download URL: claude_code_redis_channels-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7af76a5e41cd17aaff58af656dd5cecfb95e508b5ef3fce261589cc2369ecd3
|
|
| MD5 |
bac87320abb041cb23c83b437f3dad7f
|
|
| BLAKE2b-256 |
86612a0a07998455a7dd48f287b116b2a6ec7d56fcd5fc6a7dd3dbd0f59a9022
|
File details
Details for the file claude_code_redis_channels-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_code_redis_channels-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2bdd16906df8b9c76bf641a260bbcf5e4d214f72472ea642975b7c780097d64
|
|
| MD5 |
05c37bbf3073f4ca8c6a8cfc66aa8895
|
|
| BLAKE2b-256 |
9e74009bfb1f3346cffa9e5e689253aa12b634782a241d4b651cc01e79a79c0e
|