Stable API for channel plugins to send notifications/claude/channel

Resolved 💬 1 comment Opened Apr 14, 2026 by odfalik Closed May 26, 2026

Context

We're building MCP channel plugins that push messages into Claude Code sessions via notifications/claude/channel. We have two use cases:

  1. slack-channel-plugin: Bridges Slack messages into Claude Code sessions in real time (Socket Mode, event bus, channel notification). Already published and working.
  1. intercom (in development): Agent-to-agent communication between independent Claude Code sessions. Lets multiple Claude Code instances (e.g., one managing training runs, another doing data preprocessing) send messages to each other, delivered as channel notifications. Identity is derived from tmux window names; messages flow through a shared JSONL event bus.

Both plugins need to send notifications/claude/channel to push messages into the active session.

Problem

The MCP Python SDK's ServerNotification is a closed pydantic union that only includes built-in notification methods (notifications/cancelled, notifications/progress, etc.). Sending notifications/claude/channel through the normal session.send_notification() path fails pydantic validation.

The current workaround is bypassing the SDK entirely and writing raw JSON-RPC to a private internal:

notification = types.JSONRPCNotification(
    jsonrpc="2.0",
    method="notifications/claude/channel",
    params={"content": "sender: message text", "meta": {...}},
)
raw_msg = SessionMessage(message=types.JSONRPCMessage(notification))
await _session._write_stream.send(raw_msg)

This accesses _session._write_stream, a private attribute that could change or break in any SDK update.

Ask

Either:

  1. Expose a public method on the MCP server session for sending custom/arbitrary notifications (e.g., session.send_custom_notification(method, params))
  2. Open up the ServerNotification union in the MCP SDK to accept arbitrary notifications/* methods, which is already valid per the MCP spec

This would make channel plugin development significantly less fragile. The notifications/claude/channel pattern is powerful and enables a whole class of real-time integrations beyond what tools and resources can do alone.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗