MCP + REST · Base44

Add the official WhatsApp API to your Base44 app

Base44 MCP connections help while you build; your running app sends messages through a backend function with the token as a secret.

Create a free account →Create free account →
MCP connectionsbackend functionssecretswebhooks

How it fits together

Base44 lets you add custom MCP servers to your account so the builder chat can use external tools while you build. Those MCP connections are not available to your running app (flows, automations or backend functions). For the live app, call the Gambot REST API from a Base44 backend function and keep the token in the app’s secrets.

Requirements

  • No Gambot account yet? Connect the server without a token and ask your agent to “set up WhatsApp with Gambot”. It creates a free-trial account for you (no API key needed) and hands you one link to connect your WhatsApp number to Meta in the browser — that single step must be done by a person. Prefer the browser? Create an account.
  • After WhatsApp is connected, copy your API token (gmbt_…) from Settings → General into an environment variable — never into the chat. Where the client supports it, sign in with OAuth on the hosted server instead and there is no token to copy.
  • MCP connections require a Base44 plan that includes them (Builder or higher at the time of writing).

Setup

1

Add the MCP connection

In Account Settings → MCP Connections add a server named Gambot with the URL below and choose OAuth.

2

Set up WhatsApp in the builder chat

Ask: “Use the Gambot MCP to set up the official WhatsApp API.” It creates the account and returns the Meta connection link.

3

Store the token

Save GAMBOT_TOKEN as an app secret (dashboard, or the Base44 CLI: base44 secrets set GAMBOT_TOKEN=…).

4

Add a backend function

Create the function below (base44/functions/send-whatsapp/entry.ts) and call it from your UI through the Base44 SDK.

MCP server URL for Base44

https://gambot-mcp.azurewebsites.net/mcp

Backend function: base44/functions/send-whatsapp/entry.ts

import { secrets } from "base44:runtime";

export default async function (req: Request): Promise<Response> {
  const { to, text } = await req.json();
  const res = await fetch("https://api.gambot.co.il/api/v1/messages/send-text", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${secrets.get("GAMBOT_TOKEN")}`, // read inside the handler
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ to, text }),
  });
  return new Response(await res.text(), {
    status: res.status,
    headers: { "Content-Type": "application/json" },
  });
}

Example prompts

You Use the Gambot MCP to set up WhatsApp for this app and tell me what I must do in the browser.

You Create a backend function that sends a WhatsApp message through Gambot using the GAMBOT_TOKEN secret.

You Add a second function that receives Gambot webhook events for incoming WhatsApp messages and stores them.

Troubleshooting

  • Tools not showing? Restart the client after editing its MCP config, then check its MCP/tools panel for “gambot”.
  • AUTHENTICATION_REQUIRED? The token is missing or invalid. Copy a fresh one from Settings → General.
  • CONVERSATION_WINDOW_CLOSED? The 24-hour window is closed — send an approved template instead. This is WhatsApp behavior, and the error tells the agent exactly that (template_required: true).
  • Is the WhatsApp number connected? Ask the agent to run gambot_setup_whatsapp_integration; it reports the exact state and the next step.
  • If the function returns 401, the secret is missing or wrong: read it with secrets.get() inside the handler (not at module load) and re-check the value.
  • Incoming messages: every Base44 backend function has its own HTTP endpoint, which you can register as the Gambot webhook URL.

Related

Add WhatsApp to your Base44 app

Connect the MCP server, finish the Meta step, and send the first message from a backend function.

Frequently asked questions

How do I add the official WhatsApp API to my application using Base44?

Add the Gambot MCP server (https://gambot-mcp.azurewebsites.net/mcp) under Account Settings → MCP Connections so the builder chat can set up your account, store your Gambot API token as an app secret, and add a backend function that calls https://api.gambot.co.il/api/v1/messages/send-text with that secret.

Can my running Base44 app call the MCP server?

No. Base44 MCP connections are only for the builder chat. The running app calls the REST API from a backend function.

How do I receive WhatsApp messages in Base44?

Create a backend function (each has its own HTTP endpoint) and register its URL with Gambot using POST /webhooks/forward or the gambot_register_webhook tool.