# Lob MCP

> Lob MCP Server lets you manage direct mail programs through natural conversation. Send physical letters (PDF/HTML), postcards, and checks by integrating the Lob API into your AI agent's workflow. It also verifies US and international addresses and tracks all mailed pieces.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** direct-mail, address-verification, print-automation, postal-services, campaign-management

## Description

You're gonna manage your direct mail programs through natural conversation, sending everything from simple postcards to complex physical checks using your AI agent’s workflow.

To get started, you first need reliable address data. You can use `autocomplete_address` to suggest full completions for an address when you only have partial information. If you're dealing with domestic mail, run `verify_us_address`. This tool validates a US address, confirming if it actually gets delivered and giving you standardized formatting that the postal service requires.

If your mailing list isn’t in the United States, don't sweat it; use `verify_intl_address`. It checks international addresses and standardizes them for reliable mailing anywhere in the world. You always want to verify addresses first before you send a thing out.

When it comes time to mail something physical, you've got options. You can generate full-sized letters with `create_letter`. This tool supports both PDF and HTML content formats and handles specialized services like certified mail requirements for extra proof of delivery. For postcard campaigns, use `create_postcard`; this lets you design custom content for both the front side and the back side using either HTML or PDF files. If you need to issue a payment that needs to be mailed out, run `create_check`. This generates a personalized physical check, allowing you to specify payee details and memo notes right in the tool call.

After you hit send, you'll want to track it down. You can use `get_mail_tracking` to instantly check the current delivery status and exact location for any specific sent mail piece ID. For keeping tabs on what’s been executed, you can run `list_letters` to retrieve a full list of every letter successfully created or mailed through the server. Similarly, if you need a history of your postcard sends, call `list_postcards` to get that record.

Every piece of mail—the letters, the postcards, and the checks—is logged here, making it simple to audit your direct marketing efforts right from your agent's chat window.

## Tools

### autocomplete_address
Suggests full address completions based on partial input data.

### create_check
Mails a physical check to the recipient with specified payment details.

### create_letter
Sends a full-sized physical letter, supporting custom inserts and certified mail options.

### create_postcard
Mails a physical postcard, allowing content for both the front and back sides using HTML or PDF.

### get_mail_tracking
Checks the current delivery status and location of a specific sent mail piece ID.

### list_letters
Retrieves a list of all letters that have been successfully created or mailed through the server.

### list_postcards
Gets a record listing of all postcards sent out via the system.

### verify_intl_address
Checks and standardizes addresses that are not in the United States for reliable mailing.

### verify_us_address
Validates a US address, confirming deliverability and providing standardized formatting.

## Prompt Examples

**Prompt:** 
```
Send a welcome letter to a new customer and verify their address first.
```

**Response:** 
```
Address verified! ✅ '123 Main St, Apt 4B, New York, NY 10001'. Deliverable: Yes. Type: Residential. Coordinates: 40.7484, -73.9967. Letter sent! ID: ltr_4521. To: John Smith. Pages: 2. Mail class: First Class. Expected delivery: Apr 30 — May 2. Cost: $0.92.
```

**Prompt:** 
```
Show all mail pieces sent this month with delivery status.
```

**Response:** 
```
This month: 45 mail pieces. Letters: 28, Postcards: 12, Checks: 5. Delivered: 38 (84%). In Transit: 5. Processing: 2. Returned: 0. Avg delivery: 3.2 days. Total cost: $52.40. Campaign 'Spring Promo' postcards: 12 sent, 10 delivered.
```

**Prompt:** 
```
Create a check for $5,000 and browse mail templates.
```

**Response:** 
```
Check created! ID: chk_8901. Amount: $5,000.00. To: Acme Corp, 456 Business Ave, Chicago, IL 60601. Memo: 'Q2 services payment'. Mail class: First Class. Expected delivery: May 1-3. Templates: 5 available. 'Welcome Letter' (HTML), 'Invoice Notice' (HTML), 'Thank You Card' (postcard), 'Payment Notice' (letter), 'Renewal Reminder' (postcard).
```

## Capabilities

### Validate Addresses
Confirms if a US or international address is valid for mailing, providing standardized data.

### Send Physical Letters
Creates and sends letters, supporting both PDF and HTML content formats. It also handles certified mail requirements.

### Run Postcard Campaigns
Sends physical postcards using custom designs for both the front and the back of the card.

### Issue Physical Checks
Generates and mails a personalized check, including payee details and memo notes.

### Track Mail Pieces
Retrieves the current delivery status and tracking information for any sent mail item.

## Use Cases

### Onboarding a new client
A Customer Success Manager needs to send a welcome package. The agent first calls `verify_us_address` on the client's address data. If successful, it runs `create_letter` with a custom PDF insert and then records the transaction using `list_letters` for later auditing.

### Monthly billing cycle closeout
The Finance Analyst needs to send statements and payments. The agent uses `create_check` for payment notices, and then calls `list_postcards` to confirm that the accompanying thank-you postcards were also successfully mailed.

### International partnership outreach
A Marketing team is reaching out globally. They use `verify_intl_address` first to validate foreign recipient data, then they pass the clean address into `create_postcard` to ensure the physical marketing materials don't fail at customs.

### Inventory audit and tracking
Operations needs confirmation on old mail batches. Instead of checking paper logs, the agent uses a batch ID to call `get_mail_tracking`, getting an immediate status report for all items in that run.

## Benefits

- Automate multi-step campaigns: Instead of manually checking addresses, you run `verify_us_address` first. Then, your agent automatically proceeds to `create_postcard`, guaranteeing the recipient data is clean before mailing begins.
- Full visibility on mail status: Don't just assume it was sent. Use `get_mail_tracking` anytime to check the real-time location of a specific piece, whether it’s in transit or delivered.
- Handle complex finance mailings: Forget sending checks via simple email attachments. The `create_check` tool physically mails professional checks with designated amounts and memos, complete with tracking IDs.
- Streamline content creation: You can't just send a basic text file. Use `create_letter` to manage full PDF/HTML documents and even include certified mail details in one request.
- Manage your mailing history: Need an audit trail? Call `list_letters` or `list_postcards`. These tools give you immediate, structured access to every piece sent this month.

## How It Works

The bottom line is that your agent handles the entire flow—from validating input data to confirming physical delivery status—without you leaving your chat window.

1. You connect your Lob API Key to the server. This key authorizes the agent to send physical mail.
2. Your AI client calls a specific tool (e.g., `create_postcard`) and passes all required data, like recipient addresses or content files.
3. The server executes the action via Lob's API and returns structured results: confirmation IDs, tracking numbers, status reports, or newly created mail pieces.

## Frequently Asked Questions

**How do I check if an address is valid using verify_us_address?**
The `verify_us_address` tool checks and standardizes US addresses. It returns structured data confirming deliverability, which you can then pass to any sending tool like `create_letter`.

**Can I send a letter with custom inserts using create_letter?**
Yes. The `create_letter` tool supports complex mailings and allows you to specify multiple content parts, including dedicated fields for certified mail and custom inserts.

**What is the difference between list_letters and get_mail_tracking?**
`list_letters` gives you a historical summary of all letters sent (an inventory view). `get_mail_tracking` requires a specific ID to check the real-time location of one piece.

**Do I need to use verify_intl_address if my recipient is in Canada?**
You should. The `verify_intl_address` tool handles non-US postal standards and formats, ensuring the mail piece gets routed correctly globally.

**Can I send a postcard using HTML or PDF content? (create_postcard)**
Yes. The `create_postcard` tool supports detailed front and back designs for postcards, accepting either full HTML markup or dedicated PDF files for the content.

**What do I need to set up before calling `list_letters`?**
You must provide an active Lob API Key. Make sure this key is loaded into your client environment or passed directly to the server connection. This authenticates your account and lets your AI agent pull your historical mailing records.

**How does `autocomplete_address` help with data quality?**
It suggests validated address completions as you input them. You get instant suggestions for street names, ZIP codes, and unit numbers. This prevents typos and ensures the format is correct before you ever try to send or verify a mailing piece.

**What happens if I use `create_check` with invalid payment details?**
The service validates all required fields (like amount, recipient, and memo) before processing. If data is incorrect or missing, the API returns a specific error code and message telling you exactly what needs fixing.

**Can I send letters and postcards through the AI agent?**
Yes. Create and send letters with PDF/HTML content and postcards with custom designs. Track delivery through the postal system.

**Does Lob use Basic Auth?**
Yes. Lob uses **HTTP Basic Auth** with the API Key as username (no password) against `api.lob.com/v1`.

**Can I verify US addresses?**
Yes. Verify and standardize US addresses with CASS certification. Returns deliverability status, corrected addresses, and coordinates.