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 with your API key in a single command. Use -s user to make it available across all projects, or omit it for the current project only:
claude mcp add kraiter -s user -e KRAITER_API_KEY=your-api-key-here -- npx -y @kraiter/mcp-serverThe -e flag scopes the API key to the Kraiter server process rather than making it available to other MCP servers managed by Claude Code.
Alternatively, add the server config to your project's .mcp.json:
{
"mcpServers": {
"kraiter": {
"command": "npx",
"args": ["-y", "@kraiter/mcp-server"],
"env": {
"KRAITER_API_KEY": "your-api-key-here"
}
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.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 62 tools across 10 resource categories:
| Resource | Tools | Description |
|---|---|---|
| Contacts | 12 | Create, read, update, delete, upsert contacts; list sends, sequences, segments, and timeline |
| Events | 3 | Track events and list event history |
| Templates | 7 | Upsert email templates, preview renders, and manage versions |
| Sequences | 10 | Upsert drip campaigns, manage contact enrolment, versions, and dry runs |
| Campaigns | 9 | Organise sequences and templates into campaigns |
| Segments | 5 | Define and manage audience segments |
| Domains | 5 | Register and verify sending domains |
| Send | 4 | Send transactional emails and view send history |
| Scheduled Sends | 2 | List and inspect scheduled sends |
| Metrics | 5 | Tenant, sequence, and template metrics |
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?"