# 📬 manychat-mcp-server

A lightweight **FastMCP**-based server to send Instagram messages using the **ManyChat API**, supporting both plain text messages and call buttons. Designed for seamless integration into custom automations or chatbot workflows.

---

## 🚀 Features

- ✅ Send plain Instagram messages via ManyChat
- 📞 Support for messages with call buttons
- 🔐 Uses environment variables for secure API key management
- ⚡ Built on `httpx` with async support
- 🧩 Compatible with MCP agents for multi-protocol workflows

---

## 🛠️ Installation

```bash
pip install manychat-mcp-server
```

---

## ⚙️ Configuration Example

Here's how you can register the server in your MCP configuration:

```json
{
  "servers": {
    "instagram_messenger": {
      "command": "uvx",
      "args": [
        "manychat-mcp-server"
      ],
      "env": {
        "MANYCHAT_API_KEY": "${input:manychat_api_key}"
      }
    }
  }
}
```

> ✅ **Note:** Replace `manychat_api_key` with your actual API key or a secure input binding.

---

## 🧩 Available Tools

### `send_instagram_message`
Send a plain text message to a ManyChat Instagram subscriber.

**Args:**
- `subscriber_id`: Recipient's subscriber ID
- `message`: Message text
- `message_tag`: (Optional) Tag like `ACCOUNT_UPDATE`

---

### `send_call_button_message`
Send a message with a call-to-action button (e.g., phone call).

**Args:**
- `subscriber_id`: Recipient's subscriber ID
- `message`: Message text
- `phone_number`: The phone number for the call button
- `button_caption`: (Optional) Button caption (default: "Call me")
- `message_tag`: (Optional) Message tag (default: "ACCOUNT_UPDATE")

---

## 📁 Project Structure

```
manychat_mcp_server/
├── mcp_server.py         # Entry point MCP server
├── manychat.py           # All API request logic
└── __init__.py
```

---

## 📝 License

MIT License © 2025 [Your Name or Organization]

