Arsel MCP Server
Official# Arsel MCP Server
An [MCP](https://modelcontextprotocol.io) server for [Arsel](https://arsel.sa). It lets AI agents such as Claude Code, Cursor and Claude Desktop read your contacts, lists, campaigns, campaign results, templates and message logs, build segments, draft and send campaigns, send transactional messages, and build automations for you to turn on.
It is a thin client over the [Arsel API](https://docs.arsel.sa). Every tool is one API call made as you, on the organization you connect, so the agent sees exactly what you'd see through the API.
> **It can send.** Send tools deliver transactional email, SMS, WhatsApp and push, send or schedule campaigns, and record events that start automations. Your client asks you to approve every send, and the agent is told to show you what will go out and to whom first. It cannot turn an automation on or off; you do that from the Arsel dashboard.
## Requirements
- An Arsel account that is an admin of the organization you want to connect.
## Setup
### Connect with your Arsel account (recommended)
Add the server by its URL. Your client opens a browser window: sign in to Arsel, pick the organization and click **Allow**.
**Claude (claude.ai and Claude Desktop):** Settings → Connectors → Add custom connector → `https://mcp.arsel.sa/mcp`.
**Claude Code:**
```bash
claude mcp add --transport http arsel https://mcp.arsel.sa/mcp
```
Then run `/mcp` and choose **Authenticate**.
**Cursor, VS Code and other clients:** add `https://mcp.arsel.sa/mcp` as a remote (HTTP) server.
The connection has full access to that organization. An admin can see and disconnect it in the dashboard under **Integration → Connected Apps**.
### Headless and local setup (API key)
Where nobody can sign in in a browser (CI, servers, scripts) or to run the server on your own machine, use an API key. Create one in the dashboard under **API keys**.
Node.js 22 or later is needed to run the server locally.
#### Claude Code
```bash
claude mcp add arsel -e ARSEL_API_KEY=be_xxxxxxxx -- npx -y @arsel.sa/mcp
```
#### Cursor
Add this to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project:
```json
{
"mcpServers": {
"arsel": {
"command": "npx",
"args": ["-y", "@arsel.sa/mcp"],
"env": { "ARSEL_API_KEY": "be_xxxxxxxx" }
}
}
}
```
#### Claude Desktop
Open **Settings → Developer → Edit Config** and add the same `mcpServers` entry as for Cursor.
#### Remote (Streamable HTTP)
Clients that support remote servers can connect over HTTP and send the key as a Bearer token. They don't need Node.
```bash
claude mcp add --transport http arsel https://mcp.arsel.sa/mcp \
--header "Authorization: Bearer be_xxxxxxxx"
```
```json
{
"mcpServers": {
"arsel": {
"url": "https://mcp.arsel.sa/mcp",
"headers": { "Authorization": "Bearer be_xxxxxxxx" }
}
}
}
```
## Tools
| Area | Tools |
| --- | --- |
| Contacts | `list-contacts` `get-contact` `create-contact` `update-contact` |
| Lists | `list-lists` `get-list` `create-list` `update-list` `add-contacts-to-list` `remove-contacts-from-list` |
| Tags | `list-tags` `get-tag` `create-tag` `update-tag` `add-tag-to-contacts` `remove-tag-from-contacts` |
| Segments | `list-segments` `get-segment` `create-segment` `update-segment` |
| Data model | `list-contact-properties` `get-contact-property` `create-contact-property` `update-contact-property` `list-events` `get-event` `create-event` `update-event` |
| Email campaigns | `list-email-campaigns` `get-email-campaign` `create-email-campaign` `update-email-campaign` `get-email-campaign-stats` |
| SMS campaigns | `list-sms-campaigns` `get-sms-campaign` `create-sms-campaign` `update-sms-campaign` `get-sms-campaign-stats` |
| Push campaigns | `list-push-campaigns` `get-push-campaign` `create-push-campaign` `update-push-campaign` `get-push-campaign-stats` |
| Automations | `list-automations` `get-automation` `create-automation` `update-automation` `clone-automation` `list-automation-runs` `get-automation-run` |
| In-app campaigns | `list-in-app-campaigns` `get-in-app-campaign` `create-in-app-campaign` `update-in-app-campaign` `clone-in-app-campaign` `get-in-app-campaign-stats` |
| Templates | `list-templates` `get-template` `create-template` `update-template` `list-gallery-categories` `list-gallery-templates` `get-gallery-template` `copy-gallery-template` |
| WhatsApp templates | `list-whatsapp-templates` `get-whatsapp-template` `create-whatsapp-template` `update-whatsapp-template` |
| Message logs | `list-emails` `get-email` `list-sms-messages` `get-sms-message` `list-whatsapp-messages` `get-whatsapp-message` `list-push-notifications` `get-push-notification` |
| Push devices | `list-contact-push-devices` `get-push-device-import` |
| Account | `list-email-domains` `get-email-domain` `create-email-domain` `verify-email-domain` `list-sms-senders` `get-usage` |
| Sending | `send-email` `send-sms` `send-whatsapp` `send-push` `send-email-campaign` `send-sms-campaign` `send-push-campaign` `cancel-email-campaign` `cancel-sms-campaign` `cancel-push-campaign` `activate-in-app-campaign` `send-event` |
There are no delete tools. Read tools are marked read-only, so clients can run them without asking you each time. Create, update and send tools ask for your approval first. Send tools are also marked as reaching outside Arsel, and a send that fails with a timeout or server error is reported as possibly delivered, so the agent checks the message log or campaign status instead of sending again.
A few writes take effect as soon as they run, with no draft to review afterwards: `update-segment` changes who the campaigns and automations using that segment reach, and `create-whatsapp-template` and `update-whatsapp-template` submit the template to Meta for review. The agent is told to confirm these with you before calling them.
## Security
- **One organization per connection.** The API scopes every call to the organization you connected or that owns the key, and the server holds no data of its own.
- **Rate limits** are the API's own limits for your organization. When one is hit, the agent is told how long to wait.
- **Remote mode keeps no sessions.** Each request is handled with the credential it carries and then forgotten.
- OAuth access tokens last 15 minutes and are tied to this server; disconnecting an app in the dashboard stops it on its next request.
- Treat your API key like a password. Give the agent a key you can revoke from the dashboard at any time.
## Running the server yourself
```bash
ARSEL_API_KEY=be_xxxxxxxx npx @arsel.sa/mcp # stdio, for one user
npx @arsel.sa/mcp --http --port 8077 # HTTP; clients sign in with OAuth or send a key
```
| Option | Default | |
| --- | --- | --- |
| `--key` | `$ARSEL_API_KEY` | API key for stdio mode |
| `--http` | off | Serve Streamable HTTP at `/mcp` instead of stdio |
| `--port` | `$PORT` or `8077` | HTTP port |
| `--host` | `127.0.0.1` | Bind address. Use `0.0.0.0` behind a load balancer |
| `--allowed-hosts` | | Comma-separated `Host` names to accept, e.g. `mcp.example.com` |
| `--api-url` | `$ARSEL_API_URL` or `https://api.arsel.sa/v1` | Arsel API base URL |
| `--public-url` | `$ARSEL_MCP_PUBLIC_URL` or `https://mcp.arsel.sa` | Public URL of this server; the OAuth token audience |
| `--auth-server` | `$ARSEL_AUTH_SERVER` or `https://api.arsel.sa` | OAuth authorization server |
On `127.0.0.1` the server rejects foreign `Host` and `Origin` headers, which blocks DNS rebinding. When you bind to `0.0.0.0` behind a proxy, set `--allowed-hosts`. `GET /health` answers `200` for load-balancer checks. The repo includes a `Dockerfile` for this mode.
## Development
```bash
npm install
npm run typecheck
npm test
npm run build
npm run inspector # try the tools in the MCP Inspector
```
`tests/contract.test.ts` checks every tool against `openapi/arsel-api.json`: the operation exists, and the tool's parameters, required fields and enums match the API. `npm run openapi:update` refreshes the snapshot from the live API, and the test then shows any drift.
## License
MIT
TDQS
Scored across 96 tools
Despite 96 tools, the surface is organized by channel and by verb, so an agent can generally tell send-email (transactional) from send-email-campaign (marketing) and list-templates from list-gallery-templates. The few risky pairs — update-contact's list_ids replacing memberships vs add-contacts-to-list, and the parallel create/get/update/send families per channel — are called out explicitly in the descriptions, so misselection is unlikely but not impossible.
Nearly everything follows kebab-case verb_noun with the channel slotted in (create-sms-campaign, get-push-campaign-stats, cancel-email-campaign), which is predictable and lets agents infer missing siblings. Minor deviations exist, e.g. add-contacts-to-list / remove-tag-from-contacts (prepositional forms) and copy-gallery-template / activate-in-app-campaign, which break the strict channel-resource ordering.
96 tools is far beyond a comfortable surface; even though the four messaging channels legitimately multiply each operation, much of the count comes from symmetric but low-value repetition (five near-identical *-campaign-stats tools, five send-* vs five send-*-campaign). An agent must scan a very large catalog to find the right variant, raising selection cost considerably.
Coverage of the core lifecycle is strong: contacts, lists, tags, segments, campaigns per channel, automations, templates, domains, senders, events, transactional sends and usage all have create/get/list/update paths, and documented limitations (automations cannot be enabled here) are explicit. The notable gap is deletion/archival — no delete for contacts, lists, tags, segments, templates, properties, events or WhatsApp templates — plus no in-app pause/cancel counterpart to cancel-*-campaign.