# Lob — how to use (mcp.ai)

Connect your Lob account and use 13 tools for marketing automation straight from your AI agent. Connect with your own API key. Direct Mail Automation and Address Verification APIs.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_lob?ms=1787291220000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `lob_create_domain`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/lob`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/lob/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/lob/create/domain` — Tool to add a new custom domain for creating custom links. Use when you need to register a domain for short link customization.
  - body: { domain: string, error_redirect_link: string }
- `POST https://api.mcp.ai/api/lob/create/link` — Tool to create a shortened URL from a long URL using Lob's link shortening service. Use when you need to shorten a long URL either by using a custom domain or Lob's own short domain.
  - body: { slug?: string, title?: string, domain?: string, metadata?: object, redirect_link: string }
- `POST https://api.mcp.ai/api/lob/delete/domain` — Tool to delete a registered domain. Use only after confirming all associated links with the domain are deleted.
  - body: { domain_id: string }
- `POST https://api.mcp.ai/api/lob/delete/link` — Tool to delete a shortened link. Use when you need to remove a previously created short link from the system.
  - body: { link_id: string }
- `POST https://api.mcp.ai/api/lob/delete/upload` — Tool to delete an existing upload by its unique identifier. Use when you need to permanently remove an upload and its associated data.
  - body: { upl_id: string }
- `POST https://api.mcp.ai/api/lob/get/domain` — Tool to retrieve details for a single domain from Lob. Use when you need to get configuration status, redirect links, or other metadata for a specific domain.
  - body: { domain_id: string }
- `POST https://api.mcp.ai/api/lob/get/link` — Tool to retrieve a single shortened link. Use when you need to fetch details about a specific link by its ID.
  - body: { link_id: string }
- `POST https://api.mcp.ai/api/lob/list/domains` — Tool to retrieve a list of all created domains. Use when you need to view or manage custom domains configured for URL shortening. Supports pagination and filtering by configuration status.
  - body: { after?: string, limit?: integer, before?: string, status?: string }
- `POST https://api.mcp.ai/api/lob/list/links` — Tool to retrieve a list of shortened links. The list is sorted by creation date, with the most recently created appearing first. Use when you need to view all links or filter by campaign or domain.
  - body: { after?: string, limit?: integer, before?: string, domain_id?: string, campaign_id?: string }
- `POST https://api.mcp.ai/api/lob/list/qr/code/analytics` — Tool to retrieve a list of your QR codes and their analytics data. The QR codes are returned sorted by scan date, with the most recently scanned QR codes appearing first.
  - body: { limit?: integer, offset?: integer, include?: string[], scanned?: boolean, date_created?: object, resource_ids?: string[] }
- `POST https://api.mcp.ai/api/lob/list/uploads` — Tool to list uploads from Lob. Use when you need to retrieve all uploads or filter uploads by campaign ID.
  - body: { campaignId?: string }
- `POST https://api.mcp.ai/api/lob/update/link` — Tool to update any properties of a shortened link. Use when you need to modify the redirect URL, title, or metadata of an existing Lob shortened link. Requires the link_id and at least the redirect_li
  - body: { title?: string, link_id: string, metadata?: object, redirect_link: string }
- `POST https://api.mcp.ai/api/lob/validate/identity` — Tool to validate whether a given name is associated with an address. Use when you need to verify identity information by checking if a recipient name matches address records.
  - body: { city?: string, state?: string, zip_code?: string, recipient: string, primary_line: string, secondary_line?: string }

## Example prompts
- "What can I do in Lob?"
- "Show me a summary of my Lob account"

## More
- Page: https://mcp.ai/lob
- Agent spec (llms.txt): https://mcp.ai/lob/llms.txt
- Postman collection: https://mcp.ai/lob/postman.json
