@cig-chat/mcp

@cig-chat/mcp

MCP server for the cig.chat API that lets you connect Claude, Cursor, or any MCP client to your cig.chat bot to manage subscribers, tags, flows, WhatsApp templates, broadcasts, and shop operations in plain language.

Category
访问服务器

README

@cig-chat/mcp

MCP server for the cig.chat API. Connect Claude, Cursor, or any MCP client to your cig.chat bot and drive subscribers, tags, flows, WhatsApp templates, broadcasts and the shop in plain language.

243 API operations · 250 tools · 13 toolsets.

This package is a client for your own cig.chat account. It ships with no credentials and no default account. You supply your own bot token at setup, it stays on your machine, and it is never logged, echoed or transmitted anywhere except to app.cig.chat.


1. Get your API token

  1. Sign in to cig.chat.
  2. Open the bot you want to control.
  3. Go to Settings → API and copy the token.

One token controls exactly one bot. There is no workspace-wide token and no bot selector — to work with a second bot, add a second server entry with that bot's token.

Treat the token like a password: it can read your subscriber list and send messages on your behalf. Never commit it, never paste it into a chat, and rotate it in cig.chat if it leaks.

2. Add the server

Claude Code

claude mcp add cigchat --env CIGCHAT_API_TOKEN=your-token-here -- npx -y @cig-chat/mcp

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "cigchat": {
      "command": "npx",
      "args": ["-y", "@cig-chat/mcp"],
      "env": { "CIGCHAT_API_TOKEN": "your-token-here" }
    }
  }
}

Cursor

Same shape, in ~/.cursor/mcp.json.

3. Check it works

CIGCHAT_API_TOKEN=your-token-here npx -y @cig-chat/mcp --check

Then ask your assistant: "Which cig.chat bot am I connected to?" — it will call cigchat_whoami.


Safety

This server can spend money and cannot undo what it does. Read this section before you enable it for a production bot.

Every tool is available by default. That includes broadcasting to your entire subscriber list. The protections are:

Protection What it does
Named by risk Every fan-out tool is cigchat_broadcast_*, every 1:1 send cigchat_send_*. One deny rule covers the class.
Confirmation step broadcast and destructive tools refuse the first call and return an impact statement, an audience count, and a one-time token.
Argument binding The token is bound to a hash of the exact arguments — approval for a 12-person test cannot be replayed on a 50,000-person blast.
No blind retry A rate-limited send or broadcast is never retried automatically, because the messages may already have gone out.
Credential masking API keys in responses are truncated to ***last4; your token never appears in output.

Your MCP client's approval prompt is the real gate. This server can present the facts; only you can approve. Do not enable auto-approval for cigchat_broadcast_*.

Recommended settings for a production bot

"env": {
  "CIGCHAT_API_TOKEN": "your-token-here",
  "CIGCHAT_MAX_BROADCAST_RECIPIENTS": "500",
  "CIGCHAT_ALLOW": "read,write,send"
}

That keeps everyday work available, caps any broadcast, and leaves fan-out off entirely.

Trying it safely

"env": { "CIGCHAT_API_TOKEN": "your-token-here", "CIGCHAT_DRY_RUN": "true" }

Every write becomes a no-op that reports exactly what it would have sent. Reads still work.


Configuration

Variable Default Purpose
CIGCHAT_API_TOKEN — Required. Your bot-scoped token.
CIGCHAT_TOOLSETS all all, dynamic, or a comma-separated list of toolset ids.
CIGCHAT_ALLOW all tiers Which risk tiers to expose: read,write,send,broadcast,destructive.
CIGCHAT_CONFIRM_TIERS broadcast,destructive Which tiers require a confirmation token.
CIGCHAT_DRY_RUN false true makes every write a no-op that echoes the request.
CIGCHAT_MAX_BROADCAST_RECIPIENTS 0 (no cap) Refuse broadcasts above this audience size.
CIGCHAT_RPS 5 Client-side request rate limit.
CIGCHAT_MAX_RETRIES 3 Retry attempts for rate limits and server errors.
CIGCHAT_MAX_RESPONSE_CHARS 20000 Truncate long responses instead of flooding context.
CIGCHAT_BASE_URL https://app.cig.chat/api Override the API base URL.

Toolsets

250 tools is a lot of context on clients that send every schema up front. Narrow with CIGCHAT_TOOLSETS, or set it to dynamic to start with just the core tools and let the assistant switch on what it needs.

Id Tools Covers
core 4 Identity, lookup, toolset discovery. Always on.
subscribers 40 Find, create, update subscribers; tags, labels, fields, opt-in.
flow 43 Sub-flows, tags, user/bot fields, shortcuts, closing notes, segments.
conversations 2 Conversation history and agent activity.
whatsapp 8 WhatsApp and Facebook utility templates.
messaging 21 Sends and broadcasts.
shop 49 Products, variants, orders, discounts, locations, carts.
team 17 Ticket lists, labels, agent groups.
ai 13 AI agents and tasks, OpenAI embeddings.
integrations 30 Third-party integration credentials, mini-apps.
workspace 17 Workspace settings, members, analytics.
templates 3 Flow templates and install links.
escape 1 cigchat_api_call for anything not wrapped.

Full list: docs/TOOLS.md.


Names instead of ids

cig.chat identifies most things by opaque ids like f123t456. You do not have to know them — every tool accepts the entity's name and resolves it:

"Tag Dana as VIP customers" → resolves VIP customers → f123t456 → tags her.

If a name is ambiguous the server refuses and lists the candidates rather than guessing. Use cigchat_resolve to browse what exists.

WhatsApp templates

Template variables are defined when the template is approved, so ask first:

cigchat_describe_whatsapp_template({ name: "order_ready" })
→ expected_variables: ["HEADER_IMAGE", "BODY_1", "BODY_2"]

Then send with those exact keys. Getting this wrong on a broadcast is an expensive way to discover a typo.


Troubleshooting

Symptom Cause
401 / credentials failed Token is wrong, revoked, or from a different bot. Regenerate in Settings → API.
A tool is missing Its toolset or tier is disabled. Run cigchat_list_toolsets.
429 rate limited Lower CIGCHAT_RPS. Sends are never auto-retried — check whether the message went out before re-running.
422 field is required An array parameter needs objects, not strings: [{"tag_ns":"f1t1"}].
Broadcast returns requires_confirmation Working as designed. Show the impact statement to a human, then re-call with the token.

Development

npm install
npm run spec:pull   # refresh spec/openapi.json from the live API
npm run gen         # regenerate tools from the spec + spec/overrides.ts
npm test
npm run build

Tools are generated from the vendored OpenAPI document; spec/overrides.ts is the only hand-maintained mapping. Generated output is committed, so an upstream API change shows up as a reviewable diff.

Links

License

MIT © Dialogue Online Services LTD

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选