Skip to main content

📮 A Redis-based abstracted backend (abe) for Slack MCP server message queue.

Project description

Redis Message Queue Backend for Slack MCP Server

A production-ready Redis Streams-based message queue backend implementation for the Slack MCP Server project. This backend extends message queue capabilities to support Redis, enabling reliable, scalable, and high-performance Slack event processing.

Status & Quality

CI/CD & Testing

CI Documentation Documentation Build Check

Code Coverage & Quality

codecov Quality Gate Status Reliability Rating Security Rating Maintainability Rating

Code Style & Standards

Code style: black linting: pylint Imports: isort Type Checked: mypy

Package Info

PyPI version Supported Versions License: MIT

Downloads

Downloads Downloads/Month Downloads/Week


Overview

abe-redis is a Redis Streams-based message queue backend that integrates seamlessly with the Slack MCP Server's component loading mechanism. It provides a reliable, scalable solution for handling Slack events using Redis as the message queue infrastructure.

Key Features

  • 🔌 Plug-and-Play: Install via pip and configure with environment variables
  • Redis Streams: Modern stream-based message processing with consumer groups
  • 🚀 Production Ready: Connection pooling, error handling, and retry logic built-in
  • 🔄 Async-First: Built for modern Python async/await patterns
  • 📦 Universal Compatibility: Works with any project using the same component loading mechanism
  • 🧪 Well Tested: Comprehensive unit and integration tests with high coverage
  • 📚 Fully Documented: Complete API reference and usage examples

Python Version Support

Python 3.12, 3.13

Quick Start

Installation

Install the package via pip:

pip install abe-redis

Configuration

Configure your environment to use Redis as the message queue backend:

export QUEUE_BACKEND=redis
export REDIS_URL=redis://localhost:6379/0

Start Redis

Using Docker (recommended):

docker run -d --name redis-mcp -p 6379:6379 redis:7-alpine

Basic Usage

import asyncio
from slack_mcp_plugin.backends.queue import RedisMessageQueueBackend

async def main():
    # Create backend from environment variables
    backend = RedisMessageQueueBackend.from_env()

    # Publish a message
    await backend.publish("slack:events", {"type": "message", "text": "Hello Redis!"})

    # Consume messages
    async for message in backend.consume():
        print(f"Received: {message}")
        break

    await backend.close()

asyncio.run(main())

Architecture

The Redis backend uses Redis Streams for reliable message queueing:

  • Persistent Storage: Messages stored in Redis Streams with configurable retention
  • Consumer Groups: Distributed consumption across multiple workers
  • Automatic Acknowledgment: Messages acknowledged after successful processing
  • Stream Pattern Matching: Automatically discovers and consumes from slack:* streams
  • Connection Pooling: Efficient connection management with configurable pool size

Configuration Options

Environment Variable Required Default Description
QUEUE_BACKEND Yes - Must be set to redis
REDIS_URL Yes redis://localhost:6379/0 Redis connection URL
REDIS_PASSWORD No None Redis authentication password
REDIS_SSL No false Enable SSL/TLS connection
REDIS_MAX_CONNECTIONS No 10 Maximum connection pool size
REDIS_STREAM_MAXLEN No 10000 Maximum stream length for trimming

Documentation

For comprehensive documentation, including API references, examples, and development guides:

📚 Full Documentation

Quick Links

Development

Prerequisites

  • Python 3.12 or 3.13
  • Redis 6.0+ (7.0+ recommended)
  • uv or pip package manager

Setup Development Environment

# Clone the repository
git clone https://github.com/Chisanan232/MCP-BackEnd-Message-Queue-Redis.git
cd MCP-BackEnd-Message-Queue-Redis

# Install dependencies
uv sync

# Start Redis for testing
docker run -d --name redis-dev -p 6379:6379 redis:7-alpine

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=slack_mcp_plugin --cov-report=html

Code Quality

The project follows strict code quality standards:

Run quality checks:

# Format code
uv run black slack_mcp_plugin/ test/

# Lint code
uv run pylint slack_mcp_plugin/

# Sort imports
uv run isort slack_mcp_plugin/ test/

# Type check
uv run mypy slack_mcp_plugin/

Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and quality checks
  5. Commit your changes (git commit -m 'feat: add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

Support

If you encounter any issues or have questions:


Made with ❤️ for the Slack MCP Server ecosystem

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abe_redis-0.0.3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abe_redis-0.0.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file abe_redis-0.0.3.tar.gz.

File metadata

  • Download URL: abe_redis-0.0.3.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for abe_redis-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4a7559980c71b080bad5419661f9e9957ea3fcb04e4317eabf12fad1481d2975
MD5 38d4b1ca57c501c30bb107fc70dba230
BLAKE2b-256 2b926451caedb1696de0096a9b29499583f5ec3ae86c1477dfeff946afb99455

See more details on using hashes here.

File details

Details for the file abe_redis-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: abe_redis-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for abe_redis-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 acca820eab60daf0e010e297a7f8d2982da37d3a3cac3b31bdbaecf51d2f5c08
MD5 f161c4999f5aadb7105b6533a573a7a1
BLAKE2b-256 5ad87f1a15a5cdd8cc1d6bef9fb926c9332a12cae8ca5fb69db547dee1f3282a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page