Skip to content

sendwithus/sendwithus-mcp

Repository files navigation

sendwithus-mcp

An MCP server that wraps the Sendwithus REST API as a set of tools.

Built with TypeScript, Bun, and the official @modelcontextprotocol/sdk.

Install

  • npm — published as sendwithus-mcp:

    npx -y sendwithus-mcp
  • MCPB bundle — grab sendwithus-mcp-<version>.mcpb from the GitHub Releases page and drop it into Claude Desktop (or any MCPB-aware host).

Tools

Each Sendwithus v1 endpoint is exposed as one MCP tool:

  • Templates: templates_list, templates_get, templates_get_locale, templates_create, templates_update, templates_update_locale, templates_add_locale, templates_delete, templates_delete_locale, template_versions_list, template_versions_get, template_versions_create, template_versions_update
  • Send: send_email, resend_email, render_template
  • Logs: logs_get, logs_get_events
  • Snippets: snippets_list, snippets_get, snippets_create, snippets_update, snippets_delete
  • Customers: customers_get, customers_upsert, customers_delete, customers_get_logs
  • Drip campaigns: drip_campaigns_list, drip_campaigns_get, drip_campaigns_activate, drip_campaigns_deactivate, drip_campaigns_deactivate_all
  • i18n: i18n_pot_download, i18n_po_upload
  • Batch: batch_execute

Configuration

Set SENDWITHUS_API_KEY in the environment.

Use with Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "sendwithus": {
      "command": "node",
      "args": ["/absolute/path/to/sendwithus-mcp/dist/index.js"],
      "env": { "SENDWITHUS_API_KEY": "sk_..." }
    }
  }
}

Or, for development without building:

{
  "mcpServers": {
    "sendwithus": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/sendwithus-mcp/src/index.ts"],
      "env": { "SENDWITHUS_API_KEY": "sk_..." }
    }
  }
}

Use with Claude Code

claude mcp add sendwithus -- bun run /absolute/path/to/sendwithus-mcp/src/index.ts

Then set SENDWITHUS_API_KEY in the environment Claude Code is launched from, or pass it via --env SENDWITHUS_API_KEY=....

Develop

This project ships two distributables:

  1. A plain Node CLI bundle (dist/index.js) — published to npm and consumed by the claude mcp add / claude_desktop_config.json snippets above.
  2. An MCPB bundle (sendwithus-mcp-<version>.mcpb) — a single-file installable for Claude Desktop and other MCPB-aware hosts.

Prerequisites

  • Bun ≥ 1.1 (dev, tests, and the npm-target build).
  • Node.js ≥ 20 (runs the bundled MCPB server and the published CLI).
bun install

Daily development

bun run dev                # run the server from source over stdio
bun run inspect            # launch MCP Inspector against the source server
bun run test               # offline unit tests (mocked, CI-safe)
bun run test:integration   # live tests against api.sendwithus.com (needs SENDWITHUS_API_KEY)
bun run test:all           # both suites
bun run typecheck          # tsc --noEmit
bun run lint               # biome check
bun run format             # biome format --write

Live integration tests

bun run test:integration exercises every MCP tool against the real Sendwithus API. The suite is opt-in (the default bun run test stays offline). It creates throwaway resources prefixed with mcp-it-<runId>- and deletes them in afterAll.

Env var Required Effect
SENDWITHUS_API_KEY for the suite to actually run Without it, every integration suite skips cleanly (exit 0)
SENDWITHUS_RUN_SENDS optional Set to 1/true to enable send_email, resend_email, logs_get, logs_get_events
SENDWITHUS_TEST_RECIPIENT required when SENDWITHUS_RUN_SENDS is on Address that receives the one test email per run

Note: customer mutations (customers_upsert, customers_delete) cannot be performed with Sendwithus test API keys — the suite detects this and verifies tool round-trip only.

Building the Node CLI (dist/)

bun run build                          # bun build → dist/index.js with a node shebang
SENDWITHUS_API_KEY=... bun run start   # node dist/index.js

The output is published as the sendwithus-mcp bin (see bin in package.json).

Building the MCPB bundle

The MCPB pipeline lives in scripts/ and is driven from npm scripts:

npm run mcpb:sync-version  # copy version from package.json → manifest.json
npm run mcpb:build         # esbuild → mcpb-dist/{server.js,manifest.json}
npm run mcpb:pack          # validate manifest, produce sendwithus-mcp-<version>.mcpb
npm run mcpb               # all of the above end-to-end

manifest.json (at the repo root) is the source of truth for the MCPB manifest. The build copies it into mcpb-dist/ next to the bundled server.js, and mcpb:pack zips that directory using @anthropic-ai/mcpb.

Both mcpb-dist/ and *.mcpb are gitignored — they're build artifacts. Bump the version in package.json before running the pipeline; the sync script propagates it into the manifest.

Releasing

  1. Bump version in package.json.
  2. bun run test && bun run typecheck && bun run lint.
  3. bun run build → publish to npm (or npm publish).
  4. npm run mcpb → attach the produced sendwithus-mcp-<version>.mcpb to the GitHub release.

About

Official sendwithus MCP server

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors