Claude Code Integration

Use Transactional with Claude Code for AI-powered email management in your terminal.

Claude Code Integration

Claude Code is Anthropic's AI-powered coding assistant for the terminal. With the Transactional MCP integration, you can manage your email infrastructure using natural language directly in your development workflow.

What is Claude Code?

Claude Code is an agentic coding tool that runs in your terminal. It can:

  • Read and write files
  • Execute commands
  • Browse the web
  • Use MCP tools to interact with external services

With Transactional MCP, Claude Code can send emails, manage templates, configure domains, and more.

Setup

Quick Setup

# Install Transactional CLI
npm install -g @usetransactional/cli
 
# Install MCP config for Claude Code
transactional mcp install --target claude-code

Manual Setup

Edit ~/.claude.json:

{
  "mcpServers": {
    "transactional": {
      "url": "https://mcp.usetransactional.com/mcp"
    }
  }
}

Verify Installation

Start a new Claude Code session and ask:

What Transactional tools do you have access to?

Authentication

When you first use a Transactional tool, Claude Code will prompt you to authorize access:

  1. Claude Code opens your browser
  2. Log in to your Transactional account
  3. Approve the authorization request
  4. Return to Claude Code

Your authorization is stored securely and refreshed automatically.

Example Usage

Send an Email

Send an email to user@example.com from hello@mycompany.com
with subject "Welcome!" and body "Thanks for signing up."

Check Email Stats

Show me my email statistics for the past week

Manage Templates

List my email templates

Create a new template called "password-reset" with subject
"Reset your password" and a simple HTML body

Domain Management

List my verified domains

Add mail.example.com as a new domain and show me the
DNS records I need to configure

Suppression Management

Show all suppressed emails for server ID 1

Add bounced@example.com to the suppression list with
reason HARD_BOUNCE

Available Tools

Email Operations

ToolDescription
transactional_email_sendSend a single email
transactional_email_batchSend multiple emails at once
transactional_email_statsGet delivery statistics

Templates

ToolDescription
transactional_templates_listList all templates
transactional_templates_getGet template details
transactional_templates_createCreate a new template

Domains & Senders

ToolDescription
transactional_domains_listList verified domains
transactional_domains_addAdd a new domain
transactional_senders_listList email senders
transactional_suppressions_listList suppressed emails

Organization

ToolDescription
transactional_whoamiCurrent user info
transactional_orgs_listList organizations
transactional_orgs_switchSwitch organization

Tips for Effective Use

Be Specific

Instead of:

Send an email

Try:

Send a welcome email to john@example.com from
support@mycompany.com using the welcome-email template
with variables name="John" and company="Acme Inc"

Use Context

Claude Code remembers context within a session:

> List my templates
(Claude shows templates)

> Use the first one to send an email to test@example.com

Batch Operations

Send the following emails using the newsletter template:
- alice@example.com (name: Alice)
- bob@example.com (name: Bob)
- carol@example.com (name: Carol)

Troubleshooting

"MCP server not connected"

  1. Verify your config: cat ~/.claude.json
  2. Check the MCP server: transactional mcp status
  3. Restart Claude Code

"Authorization failed"

  1. Run: transactional mcp install --target claude-code --force
  2. Try the operation again
  3. Complete the browser authorization when prompted

"Tool not found"

Ensure you're using the correct tool names. Ask Claude:

What Transactional tools are available?

Integration with Development Workflow

Testing Email in Development

I'm testing the signup flow. Send a test welcome email
to my-test@mailinator.com from the staging server

Debugging Bounces

Show me recent hard bounces. Are any of them from our
latest newsletter campaign?

Quick Stats Check

What's our email delivery rate this week? Compare it
to last week.

Security Notes

  • OAuth tokens are stored securely by Claude Code
  • Tokens expire after 90 days
  • You can revoke access anytime from your Transactional dashboard
  • All operations are logged in your audit trail

Next Steps