home / mcp / whatsapp business api mcp server

WhatsApp Business API MCP Server

MCP Server generated by mcp.ag2.ai

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ag2-mcp-servers-whatsapp-business-api": {
      "command": "python",
      "args": [
        "mcp_server/main.py",
        "stdio"
      ],
      "env": {
        "CONFIG": "{...}",
        "SECURITY": "YOUR_API_KEYS",
        "CONFIG_PATH": "mcp_server/mcp_config.json"
      }
    }
  }
}

You run an MCP server that exposes an OpenAPI-defined API locally or over transport, enabling client code to access and test the WhatsApp Business API endpoints in a consistent, strongly-typed way. This server translates between your client requests and the API surface it mirrors, making development and integration smoother.

How to use

Launch the MCP server in stdio mode to run as a local process. Your client can connect to it just like any other MCP server, using the standard MCP transport patterns your tooling supports. Start it from your development environment and point your client to the local instance. If you need to change how you start the server, you can adjust the transport mode or pass configuration via environment variables.

How to install

Prerequisites: Python 3.9 or newer, along with pip and uv.

1. Clone the project directory to your workstation.

2. Change into the project directory.

3. Install development dependencies.

pip install -e ".[dev]"
```

Alternative using uv: 
```
uv pip install --editable ".[dev]"

Additional sections

Configuration and running notes for the MCP server are described in the environment and startup sections. You can influence behavior by setting environment variables and choosing a transport mode when starting the server.

Security and environment variables are documented for controlling access and runtime behavior. For example, you can provide a JSON configuration via a file path or a JSON string, and you can supply security-related values such as API keys through dedicated environment variables.

Development tools are used to ensure code quality and reliability. Linting is performed with a linter, type checking with a static type checker, and tests with a test runner. Pre-commit hooks are configured to run automatically on commits.

Running the server in development typically uses the following command structure, with the exact script path and mode depending on how you choose to start it.

Available tools

ruff

Linting and formatting tool used to check code quality and apply consistent style.

mypy

Static type checker to catch type errors before runtime.

pytest

Test runner used to execute unit tests and validate changes.

pre-commit

Pre-commit hooks that run checks before every commit to ensure code quality.

hatch

Build and publish tool used for packaging and versioning.