MCP Server
Connect Claude and other AI assistants to the Kraiter API using the Model Context Protocol server.
The @kraiter/mcp-server package lets AI assistants like Claude interact with your Kraiter account directly — creating contacts, sending emails, managing sequences, and more — via the Model Context Protocol (MCP).
The server is a thin layer over the @kraiter/sdk: it translates MCP tool calls into SDK method calls and returns the results as structured text.
Installation
npm install -g @kraiter/mcp-serverOr install locally in a project:
npm install @kraiter/mcp-serverConfiguration
The MCP server requires a KRAITER_API_KEY environment variable. Generate one from Settings in the dashboard.
Claude Desktop
Add the following to your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"kraiter": {
"command": "npx",
"args": ["-y", "@kraiter/mcp-server"],
"env": {
"KRAITER_API_KEY": "your-api-key-here"
}
}
}
}Claude Code
Add the server to your project's .claude/settings.json:
{
"mcpServers": {
"kraiter": {
"command": "npx",
"args": ["-y", "@kraiter/mcp-server"],
"env": {
"KRAITER_API_KEY": "your-api-key-here"
}
}
}
}Cursor
Add the server in Cursor Settings > MCP or in your .cursor/mcp.json:
{
"mcpServers": {
"kraiter": {
"command": "npx",
"args": ["-y", "@kraiter/mcp-server"],
"env": {
"KRAITER_API_KEY": "your-api-key-here"
}
}
}
}Running manually
You can also run the server directly:
KRAITER_API_KEY=your-api-key-here npx @kraiter/mcp-serverOr if installed globally:
KRAITER_API_KEY=your-api-key-here kraiter-mcp-serverAvailable tools
The MCP server exposes 49 tools across 8 resource categories:
| Resource | Tools | Description |
|---|---|---|
| Contacts | 7 | Create, read, update, delete, and upsert contacts |
| Events | 4 | Track events and list event history |
| Templates | 6 | Manage email templates and preview renders |
| Sequences | 7 | Manage drip campaigns and contact enrolment |
| Campaigns | 9 | Organise sequences and templates into campaigns |
| Segments | 7 | Define audience segments and check membership |
| Domains | 5 | Register and verify sending domains |
| Send | 4 | Send transactional emails and view send history |
See the full tool reference for details on every tool.
Error handling
When an API call fails, the MCP server returns an error response with a descriptive message. The error includes:
- HTTP status code and message for API errors
- Error code (e.g.
VALIDATION_ERROR,NOT_FOUND) when available - Details for validation failures (e.g. which field failed)
- Timeout indication for network timeouts
Errors are returned to the AI assistant as tool errors (isError: true) so it can reason about what went wrong and retry or adjust its approach.
Example conversation
Once configured, you can ask Claude things like:
- "Create a contact for alice@example.com with firstName Alice"
- "Show me all contacts"
- "Send a welcome email to alice@example.com using the welcome-template"
- "Check if bob@example.com is in the premium-users segment"
- "List all active campaigns"
- "What sequences is contact con_abc123 enrolled in?"