K AVAILABLE
← BACK TO PROJECT

PROJECT

Enterprise Slack Model Context Protocol (MCP) Server

Production-ready Model Context Protocol server enabling Claude, Antigravity, and AI Agents to securely inspect Slack channels, send messages, and dispatch Block Kit rich alerts.

2026AI & Backend EngineershippedAI Agents & Protocols

SYSTEM / ARCHITECTURE

How it fits together

  1. 01FastMCP protocol engine with support for stdio and Server-Sent Events (SSE) transports.
  2. 02Zero-pollution logging architecture strictly routing debug logs to stderr to maintain JSON-RPC stream integrity.
  3. 03In-memory cached human-readable channel name-to-ID resolver.
  4. 04Asynchronous Slack Web API client with automated rate-limit exponential backoff.
  5. 05Block Kit card builder generating structured telemetry and severity-coded alert cards.
MCP Tools Exposed
4 Tools
Channel Resolution
<50ms
Protocol Safety
Zero Stdout Leak

Overview

As AI agents evolve from conversational toys to proactive automation engines, they require standard protocols to interact with external tools and communication platforms. The Model Context Protocol (MCP), open-sourced by Anthropic, has emerged as the open standard for tool integration.

This project delivers a production-ready Enterprise Slack MCP Server built in strictly typed Python using Anthropic's official mcp SDK and Slack's slack-sdk. It enables Claude Desktop, Cursor, Antigravity IDE, and custom agentic frameworks to inspect channel histories, send messages, and post rich Block Kit cards with zero risk of protocol corruption.

---

🏗 System Architecture

The MCP server implements a decoupled client-server transport model:

  • FastMCP Protocol Engine — Handles JSON-RPC 2.0 handshake, schema serialization, and tool registry over both stdio and SSE (Server-Sent Events) transports.
  • Protocol Isolation & Stderr Safety — In standard stdio MCP communication, any accidental print() or library debug statement sent to stdout breaks the JSON-RPC packet stream. We implement structured logging routed strictly through stderr to ensure uninterrupted host connectivity.
  • Automated Channel Name-to-ID Resolution — Allows agents to refer to channels by human-readable names (e.g., #deployments, #eng-alerts) instead of rigid Slack CIDs, maintaining an in-memory TTL cache to minimize API roundtrips.
  • Slack Web API Integration — Asynchronous wrapper over official Slack SDK methods with automatic rate limit retry backoff.
  • Block Kit Rich Card Dispatcher — Formats system metrics, alert severities (INFO, WARNING, ERROR, CRITICAL), and deep-link action buttons into native Slack message payloads.

---

🛠 Exposed MCP Tools

1. slack_list_channels — Discovers all public and private workspace channels with member counts, topics, and access permissions. 2. slack_read_channel_history — Fetches the latest $N$ messages from a specified channel, stripping raw JSON to provide clean, token-efficient context to the model. 3. slack_send_message — Dispatches standard text or threaded replies with markdown styling. 4. slack_post_rich_alert — Generates multi-section Block Kit cards with contextual tags, key-value telemetry, and visual alert indicators.

---

🚀 Integration & Reliability

  • Full Pytest Suite with Mocked Slack APIs — Verified 100% test coverage across tool dispatchers, channel resolvers, and error boundary handling.
  • Zero Config Overhead for LLM Hosts — Configured for one-click startup in claude_desktop_config.json and agent tool orchestration workflows.
TOPICS:
MCP ProtocolAI AgentsPythonSlack SDKBlock KitAsyncIOClaude Desktop