MCP Channels is the ChatCLI push notification system that allows receiving real-time messages from MCP servers via SSE (Server-Sent Events). With channels, the agent can react to external events like CI failures, monitoring alerts, and deploy notifications without polling.
MCP Channels only works with MCP servers that support SSE transport and implement push notifications. Stdio servers do not support channels.
Concept
Unlike traditional tool calls (request-response), channels allow MCP servers to proactively send messages to ChatCLI:
MCP Server (SSE)
|
| push notification
v
ChatCLI MCP Manager
|
v
Channel Buffer (circular, 100 msgs)
|
v
Auto-inject (last 5) in system prompt
|
v
Agent reacts to the event
How It Works
SSE connection
ChatCLI maintains a persistent SSE connection with each MCP server that supports channels. The connection is established automatically on startup.
Message reception
Push messages are received via SSE and stored in a circular buffer per channel. Each channel stores up to 100 messages.
Auto-injection into prompt
The last 5 messages from each active channel are automatically injected into the system prompt on the next turn. This allows the agent to “see” the most recent events.
Agent reaction
The agent can react to injected events, taking actions like investigating failures, reading logs, or notifying the user.
Circular Buffer
Each channel maintains a circular buffer of 100 messages . When the buffer is full, the oldest messages are automatically discarded:
Channel: ci-pipeline
[97] 14:30:01 Build #456 started (branch: feature/auth)
[98] 14:32:15 Tests passed: 142/142
[99] 14:32:45 Build #456 succeeded
[100] 14:35:00 Deploy to staging started
──── buffer full, oldest messages discarded ────
The buffer size (100) is sufficient for most use cases. Important messages should be processed by the agent in real time, not stored indefinitely.
Auto-Injection into System Prompt
The last 5 messages from each active channel are automatically injected into the system prompt:
## MCP Channel Notifications
### ci-pipeline (last 5):
- [14:32:45] Build #456 succeeded
- [14:35:00] Deploy to staging started
- [14:35:30] Staging deploy completed
- [14:36:00] Smoke tests: 3/3 passed
- [14:40:00] Build #457 started (branch: main)
### alerts (last 5):
- [14:33:00] WARNING: CPU usage above 80% on prod-api-2
- [14:38:00] RESOLVED: CPU usage normalized on prod-api-2
Auto-injection consumes system prompt tokens. If you have many active channels, consider using /channel inject selectively instead of auto-injection.
Commands
Command Description /channel listLists all available channels and their status (messages in buffer, last message) /channel injectManually injects the most recent messages from all channels into the next turn /channel <name>Shows the messages from the specified channel
Listing Channels
MCP Channels:
ci-pipeline 12 messages last: 14:40:00 (auto-inject: on)
alerts 3 messages last: 14:38:00 (auto-inject: on)
deployments 0 messages last: never (auto-inject: off)
Viewing a Channel
Channel: ci-pipeline (12 messages)
[14:30:01] Build #456 started (branch: feature/auth)
[14:31:00] Linting passed
[14:31:30] Unit tests: 142/142 passed
[14:32:00] Integration tests: 38/38 passed
[14:32:15] Tests passed: 142/142
[14:32:45] Build #456 succeeded
[14:33:00] Docker image pushed: registry.io/app:456
[14:35:00] Deploy to staging started
[14:35:30] Staging deploy completed
[14:36:00] Smoke tests: 3/3 passed
[14:38:00] Build #457 started (branch: main)
[14:40:00] Build #457: tests running...
Manual Injection
Injected 10 channel messages into next turn context.
ci-pipeline: 5 messages
alerts: 5 messages
Configuring Servers with Channels
MCP servers that support channels must be configured with SSE transport:
{
"mcpServers" : [
{
"name" : "ci-monitor" ,
"transport" : "sse" ,
"url" : "http://mcp-ci:8080/sse" ,
"enabled" : true ,
"channels" : [ "ci-pipeline" , "deployments" ]
},
{
"name" : "alertmanager" ,
"transport" : "sse" ,
"url" : "http://mcp-alerts:8080/sse" ,
"enabled" : true ,
"channels" : [ "alerts" ]
}
]
}
The channels field is optional. If omitted, ChatCLI accepts all channels the server sends. If specified, only the listed channels are subscribed to.
Use Cases
CI/CD Pipeline Receive build, test, and deploy notifications in real time. The agent can automatically investigate failures.
Monitoring Alerts Receive alerts from Prometheus, Grafana, or Datadog and let the agent analyze metrics and logs.
Deploy Events Track staging and production deploys with real-time status notifications.
External Webhooks Convert webhooks from GitHub, Jira, or Slack into MCP notifications for the agent.
Next Steps
MCP Integration Configure MCP servers with channel support.
Hooks System Combine channels with hooks for reactive automations.