wacm-mcp

v0.6.1
@codingmantra/wacm-mcp Checked 3 days ago Published 15 days ago

WACM MCP server for daily WhatsApp business operations & AI setup: contacts, inbox, templates, campaigns, AI brain, flows, CRM, eCommerce shop, payments…

Connect an MCP-compatible AI assistant to your WACM account using @codingmantra/wacm-mcp. The server runs locally over stdio and calls the WACM REST API with your account token. The server provides 138 tools (73 inspection reads and 65 operational actions), 5 resources, and 7 assistant prompts covering: Version 0.5.0 expands inspection and operational tooling to 138 tools across Flowmaker, Shop, Commerce, Template Management, Messaging, Contacts, Groups, Tags, Custom Fields, and CRM. Review the tool list before approving access in your client.

Summary extracted from the README.

WACM MCP server

Connect an MCP-compatible AI assistant to your WACM account using @codingmantra/wacm-mcp. The server runs locally over stdio and calls the WACM REST API with your account token. The server provides 138 tools (73 inspection reads and 65 operational actions), 5 resources, and 7 assistant prompts covering:

  • Contacts, Groups, Tags & Custom Fields: Full lifecycle CRUD, audience health preflight, bulk group/tag contact syncing, and custom field definitions.
  • Messaging & Inbox: Send text/media/template messages, schedule campaigns, inspect campaign analytics, manage inbox notes, agent assignments, status, snooze, and AI bot handoff.
  • WhatsApp Templates: Design, validate, create, update, sync from Meta, delete, browse starter/industry libraries, and generate/review with AI.
  • Flowmaker Visual Automations: Create, update, validate, duplicate, discard drafts, toggle active state, AI-generate flows, inspect 38+ node types (including regex triggers, 11-operator AND/OR branch conditions, WhatsApp Native Flows, Payments, Catalogs, Webhooks, and CRM actions), and inspect/clear step execution history.
  • eCommerce Store (Shop): Manage products and categories, track and update orders with shipping tracking links, inspect abandoned carts, recover carts into orders, send WhatsApp cart recovery reminders, and view store revenue KPIs.
  • Commerce & Payments: Inspect payment gateway readiness (Razorpay/Stripe), view payment transactions, generate and send WhatsApp payment links, inspect commerce orders, subscriptions, refunds, and retry failed webhook events.
  • CRM, Journeys, Reservations, Reminders, Omnichannel Email & WhatsApp Calling: Pipelines, leads, notes, activities, tasks, cohort reports, customer journeys, reservations, and voice call analytics.

Operational actions in 0.5.0

Version 0.5.0 expands inspection and operational tooling to 138 tools across Flowmaker, Shop, Commerce, Template Management, Messaging, Contacts, Groups, Tags, Custom Fields, and CRM. Review the tool list before approving access in your client. Creating/submitting templates or sending messages/campaigns can contact Meta; flow activation, payment link generation, cart recovery, contact/group/tag updates, task and lead changes, reservations, and order updates change workspace state. Use inspection/validation first, then invoke mutations only for the user-authorized operation and account. Backend roles, tenant scope, plans, and feature availability still apply.

Requirements

  • Node.js 20 or newer, with npm and npx available to your MCP client.
  • A WACM account with API access and a Sanctum API token from your workspace. Use a token associated with the account and role whose data you intend to access. API plan restrictions and conversation assignment visibility still apply.
  • An MCP client that supports local stdio servers.

Quick setup: Claude Desktop and Antigravity

Add this entry to your client's MCP configuration, replacing the token placeholder locally:

{
  "mcpServers": {
    "wacm": {
      "command": "npx",
      "args": ["-y", "@codingmantra/wacm-mcp@latest"],
      "env": {
        "WACM_API_TOKEN": "YOUR_WACM_SANCTUM_TOKEN"
      }
    }
  }
}

In Claude Desktop, open Settings → Developer → Edit Config, merge the entry into your existing configuration, then restart the app. In Antigravity, open MCP Servers → Manage MCP Servers → View raw config, merge the entry and refresh the servers. Client labels can vary by version. This package uses the standard local stdio interface; individual client UIs have not been tested for this release.

If the client cannot find npx, use its absolute path as command. With multiple configured servers, preserve their existing entries. Keep token-bearing configuration out of version control and shared screenshots. For reproducible installs, replace @latest with @0.5.2.

VS Code

Add a server to .vscode/mcp.json. The password input prompts for your token instead of saving it in the workspace file:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "wacm-token",
      "description": "WACM Sanctum API token",
      "password": true
    }
  ],
  "servers": {
    "wacm": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@codingmantra/wacm-mcp@latest"],
      "env": {
        "WACM_API_TOKEN": "${input:wacm-token}"
      }
    }
  }
}

Start the server from VS Code's MCP controls. Tool access also depends on your installed AI extension and its MCP support. Other clients can use the same command, arguments and environment with their own configuration format.

Claude Code

Merge this entry into your project's .mcp.json. Set WACM_API_TOKEN in the environment that launches Claude Code, so the secret is not stored in the project file:

{
  "mcpServers": {
    "wacm": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@codingmantra/wacm-mcp@latest"],
      "env": { "WACM_API_TOKEN": "${WACM_API_TOKEN}" }
    }
  }
}

Restart the session, review the project's MCP server approval and use /mcp to check the connection. This environment expansion is specific to clients that support it; it is not a universal replacement for the token placeholder in other clients. See the official Claude Code MCP reference.

Configuration

Variable Purpose
WACM_API_TOKEN Required for authenticated API operations. Send only your Sanctum token, without the Bearer prefix.
WACM_API_URL Optional origin, default https://app.wacm.in. Use an origin such as https://your-wacm.example, without /api/v1, paths, credentials or query strings. HTTPS is required except for localhost development.

The MCP client supplies environment variables. The server does not automatically load .env files. No token is needed to discover tools or read the static guide, but API calls without a token return setup guidance. There is no hosted MCP URL in this release.

To check the executable independently:

npx -y @codingmantra/wacm-mcp@latest --version
npx -y @codingmantra/wacm-mcp@latest --help

Starting without these flags waits for MCP protocol messages on stdin; ordinary terminal silence is expected. Operational diagnostics go to stderr, leaving stdout for MCP traffic.

Verify account access and upgrade

After starting the server, confirm the tool list for your installed version (138 in this release). Ask the assistant to call get_account_profile, then check that the returned account is the one you intended to connect. Tool discovery and --version can work without a token; a successful profile read verifies API authentication. Use IDs returned by that account for subsequent reads.

With @latest, the client resolves the npm release when it starts the process. An already running server stays on its version until restarted. Use @0.5.2 to pin the current documented release. After upgrading or rotating a token, restart the client's MCP process and check the connection again.

Tools (138)

Account, Contacts, Groups, Tags & Custom Fields

Tool Purpose
get_account_profile Read the authenticated account profile.
search_contacts Search contacts; filter by group, tag, subscription, and update time.
get_contact Read one contact with groups, tags, and custom fields.
get_contact_groups_and_fields Read assigned groups and custom field values for a contact.
create_contact Create or update a contact with groups, tags, and custom field values.
update_contact Update contact details, subscription state, groups, tags, or custom fields.
delete_contact Delete a contact from the workspace.
list_groups List or search contact groups with contact counts.
get_group Read details of a contact group (with optional contact list).
get_group_preflight Summarize stored WhatsApp reachability readiness for a group without sending probes.
create_group Create a new contact group.
update_group Rename a contact group.
delete_group Delete a contact group.
sync_group_contacts Attach, detach, or sync contacts in a contact group.
list_tags List or search contact tags with colors and contact counts.
get_tag Read details of a contact tag.
create_tag Create a new contact tag with optional hex color and description.
update_tag Update a contact tag's name, color, or description.
delete_tag Delete a contact tag and detach it from contacts.
sync_tag_contacts Attach, detach, or sync contacts on a tag.
list_contact_fields List or search custom contact fields.
get_contact_field Read details of a custom contact field.
create_contact_field Create a custom contact field (text, number, date, email, Select).
update_contact_field Update a custom contact field definition.
delete_contact_field Delete a custom contact field and its stored contact values.

Messaging, Campaigns & Inbox Conversations

Tool Purpose
send_message Send a free-form WhatsApp text or media message inside an active 24h window.
send_template_message Send an approved WhatsApp template message to a phone number.
list_campaigns List campaigns by search and type.
get_campaign_status Read a campaign and delivery statistics.
get_campaign_messages Inspect campaign message records with a status filter.
preview_campaign_audience Calculate deliverable audience size for proposed campaign targeting before launch.
create_campaign Create and launch/schedule a WhatsApp template broadcast campaign.
list_conversations List visible conversations.
get_conversation Read a conversation by its contact ID.
get_conversation_messages Read conversation history with an optional message cursor.
add_conversation_note Add an internal staff note to a conversation.
assign_conversation Assign or reassign a conversation to a workspace agent.
update_conversation_status Set conversation status to open or resolved.
snooze_conversation Snooze a conversation for N hours (or unsnooze).
toggle_ai_bot Enable or disable automated AI chatbot responses for a conversation.
mark_conversation_read Mark incoming conversation messages as read.

WhatsApp Template Management

Tool Purpose
list_templates List templates across all statuses; optional exact name filter.
get_template Read a template and its status.
get_template_capabilities Inspect WhatsApp template capabilities, AI generation availability, and opt-out keyword settings.
get_template_starters Read curated starter templates with opt-out mechanisms across marketing, utility, and welcome campaigns.
get_template_library Browse official industry template library by category, industry sector, and language.
create_template Create and submit a new WhatsApp template to Meta for review with strict placeholder & button rules.
update_template Edit a rejected WhatsApp template to fix compliance or copy issues and resubmit to Meta.
delete_template Delete a WhatsApp template from Meta and WACM (not permitted if used in active campaigns).
sync_templates Synchronize template statuses, quality ratings, and components directly from Meta Cloud API.
validate_template Validate template structure, numbered placeholders ({{1}}, {{2}}), buttons, and sample values before submission.
ai_generate_template Generate compliant, high-converting WhatsApp templates using AI from a prompt, category, and tone.
ai_review_template AI score or improve a WhatsApp template draft before Meta submission to minimize rejection risk.

Flowmaker Visual Automations

Tool Purpose
list_flows List or search conversational flows in this workspace.
get_flow Read conversational flow structure, trigger types, and node/edge configurations.
get_flow_node_types Retrieve comprehensive catalog of supported Flowmaker node types, handles, and design rules.
get_flow_history Read execution history and step logs for conversational flows and contacts.
create_flow Create a new conversational flow with name, active state, nodes, and edges.
update_flow Update flow graph structure (nodes & edges), name, or published/draft state.
toggle_flow_status Activate or pause a flow with automated structural pre-flight validation.
duplicate_flow Duplicate an existing conversational flow as a disabled copy for safe iteration.
discard_flow_draft Discard unpublished draft changes on a flow and revert to published graph.
delete_flow Safely delete a conversational flow and unlink automated replies.
clear_flow_history Clear Flowmaker execution history logs (all or scoped by flow_id/contact_id).
validate_flow Validate graph structure (orphan nodes, start triggers, edge handles, cycles) before saving.
ai_generate_flow Ask WACM AI to generate an optimized flow graph from a natural language prompt.

Flowmaker Node Schema & Edge Handle Matching Rules

When generating or updating flow graphs via create_flow or update_flow, edge sourceHandle strings must strictly match backend execution expectations:

  • Interactive Buttons (buttons / quick_replies):
    • data.settings: { body: "...", activeButtons: 2, button1: "Option 1", button2: "Option 2" } (Note: settings property is body, not message).
    • Edge routing handles are 1-indexed: button-1, button-2, button-3.
  • WhatsApp Templates (template):
    • data.settings: { selectedTemplateId: 123, parameters: { BODY_1: "{{order_customer_name}}", BODY_2: "{{order_total_amount}}" } }.
    • Quick reply button handles are 0-indexed: quick-reply-0, quick-reply-1, quick-reply-2.
    • Unconditional continuation handle: always (fires immediately, useful for parallel timer/follow-up paths).
  • Conditional Branch (branch):
    • data.settings: { conditions: [{ variable: "order_payment_method", operator: "contains", value: "COD" }], logicType: "and" }.
    • Edge routing handles: strictly "true" and "false".
  • Staff / External Notification (send_ext_message):
    • data.settings: { phone: "919662775074", message: "New COD Order #{{order_order_number}}" }.
    • Outgoing edge handle: always.
  • Order Created Trigger (order_created):
    • Webhook trigger automatically populates runtime state variables prefixed with order_: {{order_order_id}}, {{order_order_number}}, {{order_total_amount}}, {{order_payment_method}}, {{order_customer_name}}, {{order_customer_phone}}, {{order_customer_address}}, {{order_items_text}}, {{order_currency_symbol}}.

eCommerce Store (Shop)

Tool Purpose
get_shop_stats Read eCommerce store KPIs (product counts, order counts, revenue, and abandoned cart recovery stats).
list_shop_products List catalog products with pricing, availability, status, and category filters.
get_shop_product Read details of one catalog product.
create_shop_product Create a new eCommerce catalog product with pricing, SKU, stock, and category.
update_shop_product Update an existing eCommerce catalog product.
delete_shop_product Delete an eCommerce catalog product.
list_shop_categories List or search eCommerce product categories with product counts.
get_shop_category Read details of one eCommerce product category.
create_shop_category Create a new eCommerce product category.
update_shop_category Update an eCommerce product category.
delete_shop_category Delete an eCommerce product category.
list_shop_orders List or search customer eCommerce orders by status, payment status, contact, or source.
get_shop_order Read details of an eCommerce order.
update_shop_order_status Update order status, payment status, shipping tracking number/URL, and notes.
list_abandoned_carts List abandoned shopping carts with recovery status and customer info.
get_abandoned_cart Read details of a specific abandoned cart including cart items.
recover_abandoned_cart Convert an abandoned shopping cart into a Pending Shop Order.
notify_abandoned_cart Send a personalized WhatsApp recovery reminder message to an abandoned cart customer.

Commerce & Payment Gateways

Tool Purpose
get_commerce_settings Read Commerce gateway configuration status (Razorpay/Stripe readiness) and workspace payment totals.
list_commerce_payments List or filter payment transactions across Razorpay and Stripe.
get_commerce_payment Read full details of a payment transaction including linked refunds and payment link.
list_commerce_payment_links List generated payment links and their payment status.
create_commerce_payment_link Generate a Razorpay or Stripe payment link for a customer and optionally send via WhatsApp.
list_commerce_orders List Commerce payment orders with provider, status, and contact filters.
list_commerce_subscriptions List recurring subscriptions across Razorpay and Stripe.
get_commerce_subscription Read full details of a recurring Commerce subscription.
list_commerce_refunds List processed or pending payment refunds.
list_commerce_events List incoming payment webhook events (Razorpay/Stripe) and processing statuses.
retry_commerce_event Re-process a failed or pending Commerce webhook event.

CRM, Journeys, Reservations, Reminders, Email & WhatsApp Calling

Tool Purpose
list_crm_pipelines List sales pipelines and their active stages.
list_crm_leads List or search CRM leads/enquiries with pipeline, stage, owner, and follow-up filters.
get_crm_lead Read full details of a CRM lead/enquiry by lead_id.
list_crm_lead_notes List internal notes linked to a CRM enquiry.
list_crm_lead_activities List timeline activity history for a CRM enquiry.
list_crm_tasks List assigned CRM tasks and follow-up reminders.
get_crm_task Read full details of a specific CRM follow-up task by task_id and optional lead_id.
list_crm_lead_people List team members eligible to own this enquiry or receive assigned follow-up tasks.
get_crm_reports Read CRM cohort conversion reports, intake trends, and stage stay durations.
get_crm_automation_preferences Read the authenticated team member’s CRM notification preferences and verification status.
create_crm_lead Create a new CRM lead or enquiry.
update_crm_lead_stage Move a CRM lead to a new pipeline stage.
add_crm_lead_note Add an internal note to a CRM lead timeline.
create_crm_task Schedule a follow-up task with due date and assignee.
complete_crm_task Mark a CRM follow-up task completed with an outcome.
cancel_crm_task Cancel a CRM follow-up task with a reason.
list_journies List customer journeys and pipelines with stages, campaign triggers, and counts.
get_journey Read details of a journey pipeline, including all stages.
get_contact_stages Read all journey stages a contact currently belongs to across pipelines.
add_contact_to_journey Enroll a contact into a customer journey pipeline.
move_contact_journey_stage Move a contact to a specific stage in a customer journey.
list_reservations List or filter reservations by phone, status, or date range.
get_reservation Read details of a reservation by ID or external reference ID.
get_contact_reservations Read reservations for a specific contact ID.
create_reservation Book an appointment or reservation.
cancel_reservation Cancel or delete a reservation.
list_reminders List configured automated reminder rules and campaigns.
create_reminder Create an automated date/reservation reminder rule linked to a template.
update_reminder Update an existing automated reminder rule.
delete_reminder Delete an automated reminder rule.
get_email_status Read workspace SMTP configuration status and active sender settings.
list_email_templates List pre-configured email templates.
list_email_messages List unified CRM email messages with pagination and recipient search.
send_email Send a transactional or CRM email to a recipient or contact.
send_bulk_email Send bulk emails to a contact group or list of contacts.
list_whatsapp_calls List WhatsApp voice call history in this workspace.
get_whatsapp_call Read a WhatsApp call outcome, timing, agent and notes without SDP.
get_whatsapp_calling_status Read local calling configuration and last Meta synchronization status.
get_whatsapp_call_permission Check current Meta call permission and available actions for a contact.
get_whatsapp_call_statistics Read workspace call totals, answer rates, duration and direction breakdown.
get_whatsapp_call_performance Read daily call trends, peak hour, wait time and recent calls.

Resources and Prompts

Resources (5)

  • wacm://guide — Authentication, pagination and operational workflow guide.
  • wacm://conversations/{contact_id}/transcript — Live markdown transcript of recent messages.
  • wacm://leads/{lead_id}/dossier — Formatted dossier of a CRM lead, activities, and tasks.
  • wacm://flows/{flow_id}/blueprint — Full architectural blueprint of a Flowmaker automation flow (triggers, nodes, edges, and draft state).
  • wacm://shop/orders/{order_id}/summary — Complete eCommerce order summary including customer details, line items, payment status, and shipping tracking.

Assistant Prompts (7)

  • wacm_triage_conversation — Directs the assistant to inspect customer conversation messages, verify service window, summarize issue, and draft a response.
  • wacm_qualify_lead — Directs the assistant to review lead notes & activities, evaluate B2B criteria, suggest stage progression, and create tasks.
  • wacm_campaign_preflight_audit — Performs preflight validation on audience reachability, template approval, and sizing before launch.
  • wacm_build_optimized_flow — Guides the assistant to design, validate, and persist high-conversion WhatsApp flows with regex triggers, 11-operator AND/OR branch nodes, interactive buttons/lists, commerce nodes, and AI fallbacks.
  • wacm_create_optimized_template — Guides the assistant to design, validate, and submit a compliant WhatsApp template to Meta adhering to strict category, placeholder, and button guidelines.
  • wacm_recover_abandoned_carts_and_collect_payment — Guides the assistant through inspecting abandoned shopping carts, sending personalized WhatsApp recovery messages or payment links, and converting carts into orders.
  • wacm_segment_contacts_and_launch_campaign — Guides the assistant through segmenting contacts using groups, tags, and custom fields, running audience preflight checks, and launching or scheduling a targeted WhatsApp campaign.

The static wacm://guide resource explains authentication, pagination and interpretation. Tool schemas expose supported parameters. IDs must be positive integers, page limits are capped at 100, unknown parameters are rejected, and API response envelopes are preserved. Responses appear as JSON text and MCP structured content under result. MCP errors use isError: true with an error object, including the HTTP status when available.

Troubleshooting

  • 401: check that the token is current and belongs to this WACM installation.
  • 403: check API plan access and the account's permissions.
  • 404: verify the ID and whether it is visible to your account.
  • 429: wait for the returned retry interval before asking again. The server does not retry automatically.
  • Timeout: requests stop after 30 seconds. Check backend availability before repeating the read.
  • Large response: responses are limited to 2 MiB. Request a smaller page.
  • Redirect or HTML response: check that WACM_API_URL points directly to the API's origin. Redirects are deliberately not followed with credentials.
  • Windows process launch: clients that cannot spawn npx directly may need command: "cmd" with args: ["/c", "npx", "-y", "@codingmantra/wacm-mcp@latest"]. Check the client's launch logs and ensure Node.js is installed in its execution environment.

Credential fields and occurrences of the configured token are redacted from returned data. This does not anonymize contacts or messages; only connect the assistant to account data you want it to access.

Development and validation

The maintained source directory is wacm-laravel-app/packages/wacm-mcp in the WACM project. See RELEASING.md for the source layout, local client setup and future release workflow. The npm archive contains the compiled server; development and tests run from the project checkout.

npm ci
npm run typecheck
npm test
npm pack --dry-run

Integration tests launch the real stdio executable through the official MCP client against a local mock API. They exercise discovery, all 138 tool routes, authentication, strict inputs, credential redaction, HTTP errors, redirects, response limits and timeouts. The API routes were checked against the WACM Laravel implementation.

API reference: WACM developer documentation. Support: CodingMantra via WACM.

See LICENSE for proprietary package terms. Dependencies retain their respective licenses.