# Dyspatch MCP Server


The Dyspatch MCP server lets AI assistants interact with your Dyspatch account directly. Through natural language, you can create and review drafts, manage localizations, organize templates with tags and workspaces, and move content through your approval workflow — all without leaving your AI tool.

<div class="highlight tip">The Dyspatch MCP server is actively improving. Check the <a href="https://www.npmjs.com/package/dyspatch-mcp" target="_blank">npm package page</a> for the latest version and full technical details.</div>

## Prerequisites

- Node.js 20 or higher
- A Dyspatch API key ([how to create one](/administration/creating_api_keys/))
- An MCP-compatible client

## Setup

### Claude Code

Run this from your terminal:

```bash
claude mcp add dyspatch -e DYSPATCH_API_KEY=your_key -- npx dyspatch-mcp
```

### Claude Desktop

Add the following to your Claude Desktop config file:

- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "dyspatch": {
      "command": "npx",
      "args": ["dyspatch-mcp"],
      "env": {
        "DYSPATCH_API_KEY": "your_key"
      }
    }
  }
}
```

### Other MCP Clients

MCP is an open standard supported by a growing number of AI tools. If you're using a different client or need help connecting in a managed or enterprise environment, [contact our support team](mailto:support@dyspatch.io) or reach out to your IT team for setup assistance.

## API Keys

Generate your API key under **Developer Tools** in the [Dyspatch admin panel](https://app.dyspatch.io/admin/). Two permission levels are available:

| Permission | Use when... |
|---|---|
| **Read-only** | You want AI to read and reference templates, drafts, and localizations without making changes |
| **Read & Write** | You want AI to create drafts, update content, manage localizations, and move templates through your approval workflow |

<div class="highlight warning">Follow the principle of least privilege — use a read-only key unless you specifically need the AI to make changes.</div>

## What You Can Do

The MCP server exposes your entire template management workflow to AI:

- **Templates**: List, search, and retrieve published templates by name, folder, or workspace; render them with variable substitution to preview final output.
- **Drafts**: Create new drafts, review and edit content, submit for approval, approve or reject submissions, and duplicate existing drafts. Filter drafts by templateId to quickly find all drafts for a specific template.
- **Localizations**: Create language variants, update translations, and coordinate multi-market deployments — all from a single prompt. Review existing translated content for drafts and blocks with the translations endpoints.
- **Blocks**: Manage reusable content components and their localizations.
- **Customer Profiles**: Access stored Customer Profile data sets to render templates against different data scenarios — useful for previewing personalized content across multiple customer types without switching tools.
- **Themes**: Query and retrieve themes to understand how content will render across your design system.
- **Workspaces & Tags**: Organize templates into folder hierarchies and categorize them with custom tags.

## Best Practices

- **Be specific in your prompts**: "List all SMS templates tagged 'transactional' in the Payments workspace" gets better results than "show me templates."
- **Review before publishing**: AI-generated content should go through your normal approval workflow. Use drafts and your team's review process — don't skip steps just because AI wrote the copy.
- **Use read-only keys for exploration**: When asking AI to audit your template library, check localization coverage, or generate reports, a read-only key keeps changes off the table entirely.
- **Keep keys out of your code**: Pass `DYSPATCH_API_KEY` as an environment variable — never commit it to source control.
- **Scope your requests**: If you manage multiple workspaces, tell the AI which workspace to target to avoid unintended changes across your account.

## Full Technical Reference

For the complete list of available tools, configuration details, and version history, see the [dyspatch-mcp package on npm](https://www.npmjs.com/package/dyspatch-mcp).

Questions or feedback? Reach out to [support@dyspatch.io](mailto:support@dyspatch.io).
