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-codeManual 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:
- Claude Code opens your browser
- Log in to your Transactional account
- Approve the authorization request
- 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
| Tool | Description |
|---|---|
transactional_email_send | Send a single email |
transactional_email_batch | Send multiple emails at once |
transactional_email_stats | Get delivery statistics |
Templates
| Tool | Description |
|---|---|
transactional_templates_list | List all templates |
transactional_templates_get | Get template details |
transactional_templates_create | Create a new template |
Domains & Senders
| Tool | Description |
|---|---|
transactional_domains_list | List verified domains |
transactional_domains_add | Add a new domain |
transactional_senders_list | List email senders |
transactional_suppressions_list | List suppressed emails |
Organization
| Tool | Description |
|---|---|
transactional_whoami | Current user info |
transactional_orgs_list | List organizations |
transactional_orgs_switch | Switch 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"
- Verify your config:
cat ~/.claude.json - Check the MCP server:
transactional mcp status - Restart Claude Code
"Authorization failed"
- Run:
transactional mcp install --target claude-code --force - Try the operation again
- 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
- MCP Setup Guide - Full setup documentation
- MCP Tools Reference - Complete tool reference
- CLI Overview - Use CLI directly
On This Page
- Claude Code Integration
- What is Claude Code?
- Setup
- Quick Setup
- Manual Setup
- Verify Installation
- Authentication
- Example Usage
- Send an Email
- Check Email Stats
- Manage Templates
- Domain Management
- Suppression Management
- Available Tools
- Email Operations
- Templates
- Domains & Senders
- Organization
- Tips for Effective Use
- Be Specific
- Use Context
- Batch Operations
- Troubleshooting
- "MCP server not connected"
- "Authorization failed"
- "Tool not found"
- Integration with Development Workflow
- Testing Email in Development
- Debugging Bounces
- Quick Stats Check
- Security Notes
- Next Steps