# SDK, MCP and AI agents

## Node/TypeScript SDK

```bash
npm install @batler/sms
```

- Full types, automatic `Idempotency-Key` on sends, retries only for requests that are safe to repeat, `BatlerError` with `code`/`status`/`retryAfter`.
- `verifyWebhookSignature(secret, header, rawBody)` for webhooks.

## MCP server

AI agents (Claude Code, Claude Desktop, Cursor) can send SMS, OTP and check the balance through our MCP server:

```bash
claude mcp add batler-sms --env BATLER_API_KEY=bm_test_xxx -- npx -y @batler/sms-mcp
```

Tools: `send_sms`, `send_otp`, `verify_otp`, `get_message`, `list_campaigns`, `get_balance`. Start with a test key.

## Machine-readable docs

| File | What |
| --- | --- |
| [/openapi.json](https://smsprovider-web.vercel.app/openapi.json) | OpenAPI 3.1 — for code generation and collections (Postman/Bruno: Import → URL) |
| [/llms.txt](https://smsprovider-web.vercel.app/llms.txt) | Short index for agents |
| [/llms-full.txt](https://smsprovider-web.vercel.app/llms-full.txt) | All docs in one markdown file |
| `/docs/<page>.md` | Every page as raw markdown |

Every page has a **"Copy for AI"** button that copies a ready prompt: the system description, the relevant endpoints and an instruction to connect your app — paste it into Claude Code or Cursor inside your project.
