Repository navigation
Releases
Releases · serversmx/mcp-chatwoot
v0.10.0
Added
- 15 core support-bot tools: account agent bot list/get/update and inbox assign/remove; internally paginated chronological transcript (latest 1-1000 messages, 20 s total time budget, default approximate PII masking, delivery
statusandcontent_attributes.external_errorper message); account message search; dashboard app list/create/update/delete; confined attachment download/upload (private note by default); CSAT responses and metrics. Contracts and version evidence. 115 core / 171 total tools. - MCP read/write annotations on all tools (
destructiveHintonly for deletes, sends to a customer and customer-facing configuration);MCP_READ_ONLYenforced in the existing gate and registry. OAuth stays closed: no new tool exposed by default andprivate_onlystill refuses every write exceptsend_message. MCP_ATTACHMENTS_DIRopt-in andMCP_ATTACHMENT_MAX_BYTES; files are isolated per account (<dir>/<account_id>/, created0700; download and send only touch the call's account directory), direct-child confinement, symlink/hard-link checks, no overwrite, byte limits (aContent-Lengthover the cap is refused up front and streaming stops at the cap). Downloads follow at most 3 redirects by hand (ActiveStorage), each only to theCHATWOOT_BASE_URLorigin, the optionalMCP_ATTACHMENT_PUBLIC_ORIGIN(internal base URL with public links; the destination is built from path and query on a fixed base URL,//hostand backslash paths are rejected and every hop is revalidated) or a host inMCP_ATTACHMENT_STORAGE_HOSTS(S3/CDN, empty by default); no API token or auth header is ever sent.MCP_ALLOW_PRIVATE_URLS: agent botoutgoing_url(update_agent_bot,enterprise_create_agent_bot,enterprise_update_agent_bot, which share one client method, andplatform_create_agent_bot/platform_update_agent_bot;MCP_PLATFORM_SAFE_MODEis unchanged) and dashboard app URLs reject loopback, link-local, private-range and internal hosts (localhost,169.254.169.254,10.x, single-label names, ...) unless this variable istrue. Names are also resolved (A and AAAA, 3 s) and rejected if they resolve to such an address (127.0.0.1.nip.io) or cannot be resolved; this is a partial defense (Chatwoot makes the request and DNS can change afterwards). A slow DNS can reject legitimate URLs after 3 s:MCP_ALLOW_PRIVATE_URLS=trueis the way out (it disables every check).MCP_ATTACHMENT_STORAGE_HOSTSentries are normalized like URLs (host:443matcheshttps://host/) and invalid ones stop the server at startup.MCP_TRANSCRIPT_TIME_BUDGET_MStunes the transcript budget.- Plugin 0.2.0: strict read-only bot diagnostics with conversation/time handoff to n8n; updated search and reports skills. Build supports new non-ignored skills and an external output directory; no real app ID or distributable is retained.
Changed
- Behavior change:
set_conversation_custom_attributesnow merges by default (merge: true): it reads the conversation's currentcustom_attributes, merges the received top-level keys on top and writes the result. The merge is shallow: a nested object you send replaces the existing nested object entirely. If the read does not return acustom_attributesobject nothing is written, and an empty input withmerge: trueis rejected (to clear all attributes passmerge: false). This is a client-side read-modify-write, not atomic (a concurrent write between the read and the write can be lost). Callers that relied on omitting keys to delete them must now passmerge: false, which keeps the previous replace behavior. Chatwoot 4.13 replaces the whole hash on POST and ignores amergeparameter. list_webhooksreturns the same fields as before plushas_secret(true/false, null if the API omits it); the secret value is never returned. Webhook secret rotation is not implemented: no verified API route.- Credential filtering also strips
token,api_token,api_access_token,refresh_token,client_secret,authorization,cookie(s),credentialsandpasswordfields and compares field names without case,-and_(apiAccessToken,HMACToken). In text, URLs are parsed: the whole userinfo password (even with@) and the value of query/fragment parameters whose decoded, normalized name isaccess_token,api_access_token,api_key,apikey,secret,passwordorhmac_tokenbecome[redacted], never the path; every other URL (signed storage URLs, SSO links, articles) is returned unchanged. Best effort for URLs (the strong guarantee is by field name): a URL in text ends at whitespace, quotes,<>or a backslash, closing punctuation is not trimmed from credential values, and strings that are JSON (even serialized several times) are sanitized as structures and re-serialized only if something changed, so valid JSON stays valid. MCP_SAFE_MODE(30 tools blocked in total): of the new writes it blocksset_inbox_agent_botandcreate_dashboard_app/update_dashboard_app/delete_dashboard_app(their URL receives conversation context).update_agent_botandenterprise_update_agent_botshare one policy, evaluated on the keys present (null included): name/description edits andoutgoing_url: ""stay allowed, any other key oroutgoing_urlvalue (which redirects every message of the bot's inboxes) is blocked.remove_inbox_agent_botstays available to stop a bot that answers twice.- Search inbox/date filters require advanced_search and may be ignored upstream; CSAT sent-survey totals only honor date filters.
Fixed
- Logs now show the name, message (truncated) and status code of errors instead of
{}(for example the MCP SDK rejecting a client probe). The stack, request config and response body are never logged.
v0.9.0
Added
- Optional OAuth listener for claude.ai and ChatGPT. A second listener (
OAUTH_PORT) in the same process accepts only OAuth 2.1 access tokens (JWT, verified withjose: issuer, audience,typ: at+jwt, algorithm,exp/iat/nbf, scope, subject and client allowlists, signing keys from a cached JWKS). The existing listener (PORT) keeps accepting onlyAUTH_TOKEN, and neither accepts the other's credentials. Closed by default: it exists only whenOAUTH_*variables are set, and an incomplete or invalid configuration aborts startup before any port is opened. OAUTH_ISSUER,OAUTH_JWKS_URL,OAUTH_RESOURCE,OAUTH_SCOPE,OAUTH_ALLOWED_SUBJECTS,OAUTH_ALLOWED_CLIENT_IDS,OAUTH_ALLOWED_TOOLS,OAUTH_ALLOWED_ACCOUNTS,OAUTH_PORT,OAUTH_JWT_ALGORITHMSandOAUTH_MESSAGE_MODE. The OAuth tool profile is pure configuration (validated at startup against the registered tools;public_*,platform_*andcreate_conversationcan never be exposed over OAuth because the account and message rules cannot be enforced on them, andprivate_onlyrefuses every write tool other thansend_message); the account allowlist applies to every call and filtersget_profile;OAUTH_MESSAGE_MODElimitssend_messageto private notes (default) or allows outgoing replies, andincomingmessages are always rejected there.- OAuth listener hardening: stateless MCP per request, JSON only with a 64 KiB body limit, no
Origin, oneAuthorizationheader,Cache-Control: no-store, request/header timeouts, a per-subject rate limit (120 requests per minute), protected resource metadata andWWW-Authenticatechallenges, and a JSON audit trail on stderr (identity, tool, result and non-sensitive identifiers; never message text or other arguments). - Input hardening on every transport: before dispatch, numeric IDs (
account_id,*_id,before,after,in_reply_to, ID arrays) must be positive safe integers (digit-only strings are accepted and coerced), string path segments (portal_id,inbox_identifier,contact_identifier) must be safe tokens (assignee_id/team_idstill accept0to remove an assignment; enum values are left to Chatwoot). The API clients also refuse paths with dot segments or query markers and percent-encode string path segments. - A single authorization gate shared by every listener decides which tools exist (enabled buckets, plus the OAuth allowlist) for both
tools/listandtools/call.
Security
- HTTP mode ran Enterprise and Help Center tools even when those buckets were disabled (
MCP_ENABLE_ENTERPRISE/MCP_ENABLE_HELP_CENTERwere only honored for listing). Disabled buckets are now neither listed nor callable in HTTP mode, as in STDIO mode. - HTTP mode without
AUTH_TOKENwas open to anyone. It now refuses to start unlessAUTH_TOKENis set, orMCP_HTTP_ALLOW_NO_AUTH=trueis set explicitly (a warning is logged). STDIO mode is unaffected. Breaking for HTTP deployments that relied on running withoutAUTH_TOKEN. - Debug logs no longer include tool arguments (they could contain message text and contact data); only the tool name is logged.
v0.8.1
Fixed
- HTTP mode: every response now sends
Cache-Control: no-store(health, MCP, 401/404 and body-parser errors), so a CDN in front of the server can no longer cache/healthor error pages. SSE streams keep the MCP SDK'sno-cache, no-transform.
CI
- Image builds time out after 20 minutes and run one at a time per ref (a newer
mainbuild supersedes an older one; tag builds are never cancelled).
v0.8.0
Changed
- BREAKING — list tools return a compact summary by default (≈ 73–93 % fewer tokens;
list_conversations32.7k → 4.4k tokens for 25 conversations):list_conversations,filter_conversations,get_contact_conversations,list_company_conversations,filter_company_conversations,list_contacts,search_contacts,filter_contacts,list_company_contacts,search_company_contacts,list_inboxes. Pagination meta is preserved. Passverbose: truefor the full Chatwoot object. This changes the default response shape: clients that read fields such asmessages,meta.sender,contact_inboxes[].inboxorworking_hoursmust passverbose: true, or set the newMCP_DEFAULT_VERBOSE=trueto keep the 0.7.x output.limitmarks truncated pages with alimitedfield. - All tool responses are compact JSON (no indentation), in every bucket.
filter_conversations,filter_contactsandfilter_company_conversationsnow document the filter item schema (attribute_key,filter_operatorenum,values,query_operatorenum).
Added
get_guide: short read-only usage guides (multi-account, filters, pagination, reports, safe mode, workflows).count_conversations: conversation counts grouped by status (optionally per inbox), inbox or age in calendar days, read from Chatwoot meta counts without downloading conversations. Flags inconsistent bucket sums.MCP_DEFAULT_VERBOSEenv var.limiton the list tools above;before/aftermessage paging onlist_messages.- 100 core tools, 156 in total.
Documentation
- README: "How it looks" screenshots (setup, multi-account, safety) generated from the real server against demo data; client setup for Claude Code, Claude Desktop and remote HTTP; distribution note (GHCR or source, not npm); credential filtering and updated safe-mode counts.
package.jsonis marked"private": trueto prevent accidental publishing to npm, where themcp-chatwootname belongs to an unrelated package.
v0.7.0 — Chatwoot 4.20 coverage, credential sanitization
Added
- Companies (CRM), 14 core tools:
list_companies,search_companies,get_company,create_company,update_company,delete_company,delete_company_custom_attributes,list_company_contacts,search_company_contacts,add_company_contact,remove_company_contact,list_company_conversations,filter_company_conversations,list_company_notes. Requires thecompaniesfeature on the Chatwoot account. list_message_templates: WhatsApp message templates of an inbox, with an optionalnamefilter.get_conversation_unread_countsanddelete_conversation_custom_attributes.- Help Center:
helpcenter_bulk_update_articles_status,helpcenter_bulk_update_articles_category,helpcenter_bulk_delete_articles,helpcenter_remove_portal_locale. - New optional params:
sort_byonlist_conversationsandfilter_conversations;in_reply_toonsend_message;q,types,since,untilandsortonenterprise_list_audit_logs. MCP_SAFE_MODEnow also blocksdelete_company,delete_company_custom_attributes,remove_company_contact,delete_conversation_custom_attributes,helpcenter_bulk_delete_articlesandhelpcenter_remove_portal_locale(26 tools in total).- Aligned with Chatwoot v4.20.3. 154 tools in total.
Security
- Tool responses are now sanitized before reaching the MCP client: credential fields are removed at any depth in every bucket (fixes #3). Covered keys:
provider_config,hmac_token,webhook_verify_token,auth_token,api_key,api_key_secret,imap_password,smtp_password,callback_auth_password,business_management_token,secret,otp_secret,access_token,pubsub_token(seesrc/utils/sanitize.ts).- Behavior change: tools that previously returned an
access_tokenor webhook/botsecret(e.g.get_profile, Platform agent bot/user tools,list_webhooks) no longer include it. Retrieve credentials from the Chatwoot dashboard instead.
- Behavior change: tools that previously returned an
- Updated dependencies to clear all
npm auditadvisories:@modelcontextprotocol/sdk: 1.29.0 → 1.32.2axios: 1.16.0 → 1.22.0express: 5.x → 5.3.0zod: 3.x → 4.6.7 (peer of the MCP SDK; not imported directly)
Changed
- The repository moved to the
serversmxorganization. The Docker image is now published asghcr.io/serversmx/mcp-chatwoot; the oldghcr.io/renatoascencio/mcp-chatwootno longer receives updates. - Images are built on GitHub-hosted runners for
linux/amd64andlinux/arm64. - New CI workflow runs lint, build and tests on Node 20 and 22 for every PR.
- Multi-account mode is easier to discover: the
account_iddescriptions,get_profileand the missing-account error point toget_profile, which lists the accounts the token can access.
Fixed
get_profilenow calls the root-level/api/v1/profileendpoint instead of the non-existent account-scoped path (fixes #2).get_conversation_countsnow uses/conversations/meta(the previous/conversations/countsroute does not exist in Chatwoot).set_conversation_prioritywithnonenow sendsnull, which is what Chatwoot expects to clear the priority.- The server reports its real version (read from
package.json) instead of a hardcoded value.
Upgrading
- Docker image:
ghcr.io/serversmx/mcp-chatwoot:0.7.0(multi-arch). - Tool outputs no longer include credentials (
access_token,secret,provider_config, …). If an integration relied on reading them through the MCP, get them from the Chatwoot dashboard instead.
v0.6.1
Changed
- Updated dependencies:
- `@modelcontextprotocol/sdk`: 1.26.0 → 1.29.0
- `axios`: 1.13.5 → 1.16.0
- `vitest`: 4.0.18 → 4.1.5
- `nock`: 14.0.11 → 14.0.14
- `@types/node`: 22.19.11 → 22.19.17
Internal
- Untracked `CLAUDE.md` (local-only AI assistant instructions)
- Build verified clean with TypeScript 5.9.3
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Summary
tvplus-mcp-chatwoot v0.6.0 expands from 81 to 133 MCP tools organized in 5 modular API buckets. Each bucket is opt-in with environment flags and has independent safety controls.
Buckets
| Bucket | Tools | Enable Flag | Auth | Safe Mode |
|---|---|---|---|---|
| Core | 81 | Always on | CHATWOOT_API_TOKEN |
MCP_SAFE_MODE (14 blocked) |
| Public | 12 | MCP_ENABLE_PUBLIC_API=true |
inbox_identifier |
N/A |
| Platform | 17 | MCP_ENABLE_PLATFORM_API=true |
CHATWOOT_PLATFORM_API_TOKEN |
MCP_PLATFORM_SAFE_MODE (11 blocked) |
| Enterprise | 8 | MCP_ENABLE_ENTERPRISE=true |
CHATWOOT_API_TOKEN |
MCP_SAFE_MODE (3 blocked) |
| Help Center | 15 | MCP_ENABLE_HELP_CENTER=true |
CHATWOOT_API_TOKEN |
MCP_SAFE_MODE (3 blocked) |
What's New
New API Buckets
- Public API (12 tools): Widget/client-facing endpoints — contacts, conversations, messages using
inbox_identifierauth - Platform API (17 tools): Super-admin operations — accounts, users, global agent bots. Uses separate
CHATWOOT_PLATFORM_API_TOKEN - Enterprise (8 tools): Audit logs, reporting events, account-scoped agent bots
- Help Center (15 tools): Portal, article, and category management for knowledge bases
Safety & Guardrails
MCP_SAFE_MODE=true: Blocks 20 destructive tools across core, enterprise, and help center bucketsMCP_PLATFORM_SAFE_MODE=true(default ON): Blocks all 11 platform write/delete operations. Only read operations allowed by default- All blocked error messages include: tool name, flag, and how to unblock
Testing
- 240 tests across 9 test files (up from 169 in v0.5.0)
- Exhaustive safe mode guardrail tests for all 31 blocked tools
- Tool registration tests: counts, uniqueness, naming conventions, schema validity
- HTTP-level mocking with Vitest + nock
Documentation
docs/SCOPE.md— Complete tool inventory for all 5 bucketsdocs/PLATFORM_SECURITY.md— Security guide with deployment examplesdocs/ENTERPRISE.md— Enterprise endpoints documentation.env.example— All flags documentedscripts/smoke/live-smoke.ts— Read-only live smoke test (npm run smoke:live)
Upgrade Guide
No breaking changes — fully backward compatible
Existing setups (core-only) work without changes. New buckets are disabled by default.
New environment variables
# Optional buckets (all default to false/disabled)
MCP_ENABLE_PUBLIC_API=true
MCP_ENABLE_PLATFORM_API=true
CHATWOOT_PLATFORM_API_TOKEN=your-platform-token # Required if platform enabled
MCP_PLATFORM_SAFE_MODE=true # Default ON — blocks writes
MCP_ENABLE_ENTERPRISE=true
MCP_ENABLE_HELP_CENTER=trueSecurity
- Platform API uses a separate token (
CHATWOOT_PLATFORM_API_TOKEN) distinct from the application token - Platform Safe Mode is ON by default — only read operations allowed until explicitly disabled
- MCP_SAFE_MODE blocks destructive operations across core, enterprise, and help center
- No secrets in logs, commits, or release artifacts
- See PLATFORM_SECURITY.md for detailed security guide
Full Changelog: v0.2.0...v0.6.0