WA MCP
Agent setup guide

A WhatsApp bot without the Business API: OpenAI or ChatGPT?

Looking for a WhatsApp ChatGPT integration or a bot without the Business API? WA MCP documents a worker that drafts replies using the OpenAI API. Start with one allowed chat and review the draft before enabling sends.

Decide what should happen to a message

A useful first test is a direct message from one consenting contact asking when you are free. The agent connector can produce a proposed reply, save it locally and leave the original conversation alone. You can inspect the suggestion, the contact selected and how much conversation history reached the provider before giving any program permission to send.

The connector is a worker that runs alongside the linked Go bridge. It can call the OpenAI API, an OpenAI-compatible endpoint, Anthropic, Ollama or your own reply service. The OpenAI preset takes an API key. You review the proposed reply in the WA MCP worker or with its agent tools. A ChatGPT subscription does not supply API credentials.

Test a provider with a sample

From a source checkout with the workspace dependencies installed, start with the OpenAI example in the agent guide. Put your API key in the environment of the worker. Keep the secret out of the JSON file. The provider can charge for a test request even when the number is unlinked and no WhatsApp message is sent.

uv run wa-mcp agent-test --help

Select the configuration file through WA_MCP_CONFIG. With the provider configured, run uv run wa-mcp agent-test to submit a synthetic event. Inspect the preview and timing. This isolates the provider configuration from phone pairing, chat selection and the live event feed. If the test fails, check which key and endpoint that preset expects before changing your bridge settings.

Limit the first live conversation

Merge the agent settings into the configuration your bridge already uses. Replace the contact in this example with an exact address-book name or identifier that you control. The empty allow list permits nobody. Denied chats and senders take precedence over allowed ones.

{
  "agent": {
    "enabled": true,
    "provider": "openai",
    "mode": "draft",
    "allow_chats": ["Alice"],
    "history": 0
  }
}

Starting with zero history lets you inspect how the provider handles a single question. The documented default includes up to ten previous messages. Add context deliberately when a reply depends on something said earlier. The provider receives identifiers, names, message text and any transcript or selected history. Choose a test contact who understands where the conversation will be processed.

Start or restart the bridge with that config. Run uv run wa-mcp agent with the same configuration in another terminal. For multiple numbers, select the intended account explicitly and keep one worker per number. Send a fresh incoming message from the allowed contact. Old messages arriving during history sync cannot trigger a reply.

Inspect a draft and the decision

In a source checkout with toolset selection, enable the agent tools along with core tools in the MCP server configuration, then restart the client connection. Use get_agent_status to inspect the mode, pending count and most recent successful poll. Use list_agent_drafts to inspect the suggestion. If a generated answer is inappropriate, leave it pending and adjust the prompt or the amount of context before another test.

An empty draft list can have several explanations. Confirm that the worker was running when the new message arrived. Check the exact allowed chat and whether a deny rule applies. Outgoing messages are skipped. A group must be listed explicitly, and the account must actually be mentioned. A per-chat cooldown also suppresses repeated triggers. Test with a fresh direct message after the interval.

Understand approval and stopping

Draft mode works while sending is disabled. Approval mode can ask in the worker terminal or leave a pending draft for approval from an MCP client when the worker is headless. Sending still depends on the bridge's outbound settings. Quiet hours can queue an approved reply, so a queued result and a delivered message represent different stages.

The pause switch persists across restarts and cancels pending agent schedules. A send already handed to WhatsApp may complete. After resuming, use a new event to test the configuration. A stopped worker can miss live events. Keep a human review step when testing a different provider, prompt or set of allowed chats.

The linked account uses the unofficial WhatsApp Web protocol. WhatsApp can restrict or ban the account. Draft mode helps you review what the software proposes, and it gives you a way to evaluate a provider without enabling outbound messages.

Questions

Does this WhatsApp bot without the Business API connect to ChatGPT?

The documented connector uses an OpenAI API key or another configured provider. WA MCP does not document a native ChatGPT app setup. The worker can save drafts with sending disabled.

Can I test a WhatsApp reply before linking a phone?

Yes. Set up a provider and run wa-mcp agent-test with a synthetic event. It can incur provider usage charges. Live drafts need a linked, running bridge and an allowed chat.

Read the project agent connector guide