chat-sdk-mcp
Integrates with Slack through the Chat SDK Slack adapter, allowing agents to read channels and threads, fetch and post messages, reply, edit, delete, react, open DMs, and look up users and channel information.
Integrates with Telegram through the Chat SDK Telegram adapter, allowing agents to read chats and threads, fetch and post messages, reply, edit, delete, react where supported, send DMs, and look up users and channel information.
Integrates with WhatsApp through the Chat SDK WhatsApp adapter, allowing agents to read conversations, fetch and post messages, reply, edit, delete, react where supported, send direct messages, and look up users and chat information.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
chat-sdk-mcp
npm package:
chat-sdk-mcp
MCP server for Chat SDK. It gives AI agents the chat channels your bot already has, Slack, Telegram, WhatsApp, Teams or any other adapter, through the tools Chat SDK defines in chat/ai: read threads and messages, post, reply, edit, delete, react, open DMs and look users up. It runs over stdio or Streamable HTTP, as a CLI, inside your own MCP server, or as a serverless route.
Installation
pnpm add chat-sdk-mcp chat @modelcontextprotocol/serverAdd the adapters your bot uses, such as @chat-adapter/slack. ESM only, Node >= 20. chat and @modelcontextprotocol/server are peers, so you control their versions.
Related MCP server: Slack MCP Server
Usage
From an MCP client
Point CHAT_MCP_ADAPTERS at the catalog adapters you use. Each one reads its own variables, the same ones it reads in a bot:
{
"mcpServers": {
"chat": {
"command": "npx",
"args": ["chat-sdk-mcp"],
"env": {
"CHAT_MCP_ADAPTERS": "slack,telegram",
"SLACK_BOT_TOKEN": "xoxb-…",
"SLACK_SIGNING_SECRET": "…",
"TELEGRAM_BOT_TOKEN": "…"
}
}
}
}Run it from the project that has chat-sdk-mcp and the adapters installed. A missing adapter fails at startup with the package to install.
Inside your own MCP server
registerChatTools adds the tools to any MCP server, next to your own:
import { McpServer } from "@modelcontextprotocol/server";
import { CHAT_MCP_INSTRUCTIONS, registerChatTools } from "chat-sdk-mcp";
import { bot } from "./lib/bot";
const server = new McpServer(
{ name: "my-app", version: "1.0.0" },
{ instructions: CHAT_MCP_INSTRUCTIONS },
);
const tools = registerChatTools(server, { chat: bot, preset: "reader" });
tools.fetch_messages?.update({ description: "Read a support conversation." });It returns the SDK handle of each tool, so you can rename, describe, wrap, disable or remove any of them.
Serverless
createChatMcpHandler serves the tools over Streamable HTTP, statelessly, from any fetch runtime: Vercel Functions, Next.js route handlers, Hono, Bun or Workers.
import { createChatMcpHandler } from "chat-sdk-mcp";
import { bot } from "@/lib/bot";
const mcp = createChatMcpHandler({ chat: bot });
export async function POST(request: Request): Promise<Response> {
if (
request.headers.get("authorization") !== `Bearer ${process.env.MCP_TOKEN}`
) {
return new Response("Unauthorized", { status: 401 });
}
return mcp.fetch(request);
}The handler checks no credentials, so authenticate the request first. With Vercel's mcp-handler, register the tools on the server it gives you:
import { createMcpHandler } from "mcp-handler";
import { CHAT_MCP_INSTRUCTIONS, registerChatTools } from "chat-sdk-mcp";
const handler = createMcpHandler(
(server) => {
registerChatTools(server, { chat: bot });
},
{ instructions: CHAT_MCP_INSTRUCTIONS },
);
export { handler as GET, handler as POST };Configuration
createChatMcpServer, registerChatTools and createChatMcpHandler take the same options:
Option | Default | Description |
| – | The |
| – | Several |
| – | How the |
| every tool | Chat SDK's |
| – | Confine the tools to one thread or channel id, as in Chat SDK |
|
| Confine a thread scope to that thread alone |
Without code
The CLI, and loadConfig from chat-sdk-mcp/config, build the Chat from one of these:
CHAT_MCP_ADAPTERS: catalog slugs such asslack,telegram, each built with its own variables, andCHAT_MCP_STATEfor the state adapter (memory by default).CHAT_MCP_CONFIG: a JSON file, inline JSON, or a module that exports your bot asdefaultorbot, such as./lib/bot.ts.
The JSON form is new Chat({ adapters, state, userName, logger }) with each adapter replaced by an entry. An entry is a catalog slug, the key by default, or a package and its factory, and config is the factory's argument. ${VAR} and ${VAR:-default} read the environment, so secrets stay out of the file:
{
"adapters": {
"slack": {},
"telegram": { "config": { "mode": "webhook" } },
"whatsapp": {
"packageName": "chat-adapter-wwebjs",
"factoryExport": "createWWebJSAdapter",
"config": { "adapterName": "whatsapp" }
}
},
"state": { "slug": "redis", "config": { "url": "${REDIS_URL}" } }
}For several bots, put one such object per id under bots: { "bots": { "sales": { … }, "support": { … } } }.
import { createChatMcpServer } from "chat-sdk-mcp";
import { loadConfig } from "chat-sdk-mcp/config";
const server = createChatMcpServer(await loadConfig("./chat-sdk-mcp.json"));Environment variables
Variable | Default | Description |
| – | Catalog slugs of the adapters to build, comma-separated |
|
| Catalog slug of the state adapter, with |
| – | JSON file, inline JSON, or a module exporting your bot |
|
| The bot's |
| every tool |
|
|
|
|
|
|
|
| – |
|
chat-sdk-mcp serves stdio, and chat-sdk-mcp http serves Streamable HTTP.
Tools
Most tools are Chat SDK's own, from chat/ai, with the same inputs and behavior. chat-sdk-mcp adds what its toolset leaves out. Thread ids (slack:C123:1700000000.000100) and channel ids (slack:C123) are full Chat SDK ids.
Tool | What it does | Annotations |
| Each adapter, with the tools that work on it | read-only |
| The bot ids, with several bots | read-only |
| A thread's messages, paged | read-only |
| A channel's top-level messages, paged | read-only |
| One message by id | read-only |
| A thread's channel and whether it is a DM | read-only |
| A channel's threads, paged | read-only |
| The people in a thread, bots left out | read-only |
| A channel's name, member count and visibility | read-only |
| A user's profile, | read-only |
| Post in a thread, or reply to a message in it with | |
| Post at the top of a channel | |
| DM a user | |
| The DM thread with a user, to read or post | idempotent |
| Show the typing indicator | idempotent |
| Mark a message as read | idempotent |
| React to a message | idempotent |
| Edit the bot's message | destructive |
| Delete a message | destructive |
| Remove a reaction | destructive |
get_user, send_direct_message and open_dm take an adapter when Chat SDK cannot tell it from the user id, as with WhatsApp numbers. Chat SDK's thread subscriptions are left out, since they change how a live bot answers.
list_adapters lists, for each adapter, the tools it implements, and for adapters built from the catalog also leaves out what the catalog says it lacks. A tool an adapter cannot do fails with a message that says so.
Results and errors
A result is the tool's output as structuredContent and the same JSON as text. A result that can be null comes under its key, such as { "user": null }. An error, from Chat SDK, the platform or chat-sdk-mcp, is a tool error carrying its message, such as Rate limited by slack, retry after 30s. Nothing wraps either, so a host that wants its own envelope can wrap the tools with their handles.
Limits
Adapters are fixed when the
Chatis built. Change the configuration and restart to add one.chat-sdk-mcp next to a live bot: reading cached history, as WhatsApp and Telegram keep it, needs the bot's own state adapter. Telegram in polling mode allows a single consumer, so set
"mode": "webhook"for chat-sdk-mcp when the bot already polls.No credentials go through tools. They stay in the environment or the config.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Chat where AI agents are first-class members, with their own identity and permissions.
Group chat for people and AI agents: read and send messages, files, polls, notes and boards.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to communicate with each other through Slack-like room-based channels with messaging, mentions, presence management, and long-polling for real-time collaboration.74 npm5MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Slack workspaces through comprehensive channel management, messaging, direct messages, search functionality, and user management capabilities.305 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Slack workspaces through natural language, supporting channel management, message operations, user profiles, reactions, and threaded conversations.-
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Slack workspaces, including listing channels, posting messages, replying to threads, adding reactions, and retrieving user information.1019 npmMIT