MCP for coding agents
channelstack mcp serves the attach CLI's commands as MCP tools over stdio. A coding agent that is building your bot can then try it the way you would by hand: post as a person, read what the bot answered, see what was delivered and called, redeliver, and look again.
Add it to your coding agent#
Most coding agents take an MCP server as a command in a JSON config:
{
"mcpServers": {
"channelstack": { "command": "npx", "args": ["channelstack", "mcp"] }
}
}
In Claude Code, claude mcp add channelstack -- npx channelstack mcp registers the same server (add --scope project to write it to .mcp.json). Other agents (Cursor, Codex, Windsurf) take the same command and args in their own MCP settings file.
The MCP server attaches to the running channelstack server on its first tool call, not when it starts, so the coding agent can launch it before you start the server. It finds the server the way the CLI does: through server.json, or --server <url> in args with CHANNELSTACK_TOKEN in its environment. If the server isn't reachable, the tool call returns that as an error and the next call tries again.
The server and the bot still need to run, as for the CLI:
CHANNELSTACK_SLACK_WEBHOOK_URL=http://localhost:3000/slack/events npx channelstack start
npx channelstack env > .env.local # then start the bot with it
The tools#
Every tool acts in the shared dev session, the same one the CLI and the UI use, and prints what the matching CLI command prints. Every channel has the same tools (decision 0028): channel is slack, github, linear, notion, resend, google or discord.
| Tool | Inputs | Same as |
|---|---|---|
say | channel, as, in (a place by name, e.g. "#support"), text | channelstack <channel> say |
reply | channel, as, text, to? | channelstack <channel> reply |
react | channel, as, emoji (e.g. ":eyes:"), on? | channelstack <channel> react (Slack, GitHub and Linear) |
show | channel?, in?, thread?, json? | channelstack <channel> show; without channel, channelstack show |
<channel>_act | action, params?, as?, in?, on? | channelstack <channel> <action>: everything else its people do (slack_act, github_act, …) |
tail | none | channelstack tail, but each call returns only what happened since the last one (everything, the first time) |
list_deliveries | channel?; every channel's without it | channelstack deliveries |
redeliver | channel?, delivery? (last, the default, or an id from list_deliveries) | channelstack redeliver |
openai_respond | text?, when?, times? (-1 for every call), tool?, args? (JSON) | channelstack openai respond: what the fake OpenAI answers the bot's next model calls |
openai_calls | none | channelstack openai calls |
asis a person's name, such asana. The person is created the first time the name is used.innames a place: a Slack channel ("#support"), a GitHub issue or pull request by its title (in the org's publicdevrepository), a Linear issue by its title (in a team named Dev), a Notion page by its title, an email thread by its subject, a Discord channel ("#support").saymakes it the first time, with the person and the bot in it.to,onandthreadtake"last"(the default: the newest entry of the channel's most recently active place), or"<place>:<entry>", assayandreplyprint it andshowwithjsonlists the entries' ids.openai_respondscripts the bot's model when the bot is on the fake OpenAI (OPENAI_BASE_URLfromchannelstack env). There is no default answer: a model call nothing scripted gets a 400 (channelstack_no_script). Thetextmay use{lastUserText}and{toolResult};whenanswers only calls whose newest user message has that text; withtool, the model calls that tool first, withargs, andtextanswers its result.<channel>_act's actions are generated from the channel's routes: each thing its people do that isn't a read (click,stop,selecton Slack;review,merge,labelon GitHub;delegate,setState,prompton Linear; …). The tool's description lists each action with its values.paramstakes them by name; a person or the app ("app") by name, a reference as"last"or an id. A reference the action needs and isn't given comes from the target: the entryonnames, the newest one in the placeinnames, or the newest anywhere. Withoutas, whoever started the target's thread acts (slack_actstoppresses Stop as the person who asked).
The loop#
This is what a coding agent does with the tools while it works on the bot:
-
Act as a person. If the bot's model is the fake OpenAI, script it first:
openai_respondwith{ "text": "Here's what I found.", "times": -1 }. Thensaywith{ "channel": "slack", "as": "ana", "in": "#support", "text": "@my-agent summarize today" }returnsana said it in #support (C0A1B2C3D4E:1732451234.000100). Follow up withreply,react, orslack_actwith{ "action": "click", "params": { "button": "Approve" } }. -
Read the answer.
showreturns the most recently active place as a person reads it:ana: @my-agent summarize today my-agent: Here's what I found about "summarize today".The bot answers asynchronously. If its reply isn't there yet, call
showagain. -
See why.
tailreturns the events delivered to the bot (→ slack app_mention 200) and the API calls it made (← slack chat.postMessage 200). A failed delivery, or a call refused with an error code, is usually the bug.openai_callsshows what the bot asked its model and what the model answered. -
Change the bot, then send the same event again.
list_deliverieswith{ "channel": "slack" }lists each delivery's id, event, outcome and attempts.redeliverwith that id sends it again, the way Slack retries it, and returnsRetried Ev0A1B2C3D4E (slack). A bot that now answers twice doesn't handle retries. -
Check again with
show.
Once the bot behaves, the agent pins it down in a test (Writing tests), which gets a fresh session and creates its own people.
Errors#
A mistake comes back as the tool's error, in one sentence, the same sentence the CLI prints: an unknown delivery id, a missing as, a server that isn't running. The coding agent reads it and tries again; nothing crashes.
What it never returns#
The tools return the same text as show, tail, deliveries and openai calls. None of it carries the server's bearer token, which stays in server.json and in the MCP server's memory. Don't paste the tokens from .env.local into the chat either: the coding agent doesn't need them to use the tools.
The skill#
channelstack's repository has a skill for coding agents in skills/channelstack/SKILL.md. It tells the agent how to set up the server and the MCP config, runs it through the loop above, and shows the test to write afterwards. Copy it into your coding agent's skills folder, for example .claude/skills/channelstack/SKILL.md for Claude Code.
The docs, for your coding agent#
The docs themselves are served for agents too, so a coding agent can look up the API while it writes your tests:
-
An MCP server for the docs at
https://channelstack.dev/mcp(Streamable HTTP, no sign-in) with three read-only tools:search_docsfinds the sections that answer a question,read_docreads a page, andlist_docslists them all. Add it to an agent as a remote server:{ "mcpServers": { "channelstack-docs": { "type": "http", "url": "https://channelstack.dev/mcp" } } }In Claude Code,
claude mcp add --transport http channelstack-docs https://channelstack.dev/mcpdoes the same. The menu next to Copy page at the top of every docs page installs it in Cursor or VS Code in one click. -
Every page as Markdown: add
.mdto its URL (/docs/guide/live-mode.md), or ask for it withAccept: text/markdown. Every example comes with all three languages. -
llms.txt lists every page by section, and llms-full.txt has all of them in one file.
-
Copy page copies the page's Markdown for a chat, and its menu opens the page in ChatGPT, Claude, Codex or Cursor.