Skip to main content

CONNECT

Send mail from LangGraph, the Vercel AI SDK, or OpenClaw

Justin WinterBy · Updated September 17, 2026

paperplane's MCP server (https://sendpaperplane.com/api/mcp) is a plain streamable-HTTP endpoint with no API key, so any MCP-aware agent framework can attach it in a few lines: langchain-mcp-adapters for LangGraph, experimental_createMCPClient for the Vercel AI SDK, or openclaw mcp add for OpenClaw's CLI. Every path exposes the same three tools — quote_letter, send_letter, get_letter_status — with a free sandbox mode.

These are code-first recipes for developers wiring paperplane into an agent they are already building — not a platform-specific connector UI like our Grok, Copilot Studio, Lindy, Gumloop, or Dust guides. All three snippets below point at the same MCP server (https://sendpaperplane.com/api/mcp) over streamable HTTP and expose the same three tools: quote_letter, send_letter, get_letter_status.

LangGraph (Python)

langchain-mcp-adapters is LangChain’s official MCP client — MultiServerMCPClient connects to one or more MCP servers and returns their tools as a LangChain-compatible tool list, which a prebuilt create_react_agent (or any LangGraph graph) can call directly. transport: "http" is the canonical name for MCP’s Streamable HTTP transport in current releases of the adapter (older code may say "streamable_http" — both work, prefer "http" in new code).

# pip install langchain-mcp-adapters langgraph langchain-anthropic
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

client = MultiServerMCPClient({
    "paperplane": {
        "transport": "http",  # streamable HTTP; no auth required
        "url": "https://sendpaperplane.com/api/mcp",
    }
})

tools = await client.get_tools()
agent = create_react_agent(ChatAnthropic(model="claude-sonnet-4-5"), tools)

result = await agent.ainvoke({
    "messages": [{"role": "user", "content":
        "Quote a certified letter to 1 Main St, Richmond VA 23220, then send it in sandbox mode."}]
})

Vercel AI SDK (TypeScript)

The AI SDK’s experimental_createMCPClient takes any MCP client transport — here the official @modelcontextprotocol/sdk package’s StreamableHTTPClientTransport — and its .tools() method returns a tool map ready to hand straight to generateText or streamText. maxSteps lets the model call quote_letter and then send_letter in the same turn once it has a confirmation_token.

// npm install ai @modelcontextprotocol/sdk
import { experimental_createMCPClient as createMCPClient, generateText } from 'ai'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'
import { anthropic } from '@ai-sdk/anthropic'

const transport = new StreamableHTTPClientTransport(new URL('https://sendpaperplane.com/api/mcp'))
const mcpClient = await createMCPClient({ transport })
const tools = await mcpClient.tools()

const { text } = await generateText({
  model: anthropic('claude-sonnet-4-5'),
  tools,
  maxSteps: 4,
  prompt: 'Quote a certified letter to 1 Main St, Richmond VA 23220, then send it in sandbox mode.',
})

await mcpClient.close()

OpenClaw (CLI)

OpenClaw manages MCP servers through its own registry rather than a config file you edit by hand: openclaw mcp add registers a remote server by URL and transport, openclaw mcp doctor --probe confirms it connects and lists its tools, and from then on any agent run through the CLI has access to them.

# One-time setup — register the remote MCP server
openclaw mcp add paperplane \
  --url https://sendpaperplane.com/api/mcp \
  --transport streamable-http

# Confirm it connects and lists quote_letter / send_letter / get_letter_status
openclaw mcp doctor paperplane --probe

# Then just talk to your agent — it has the tools
openclaw agent run --agent default \
  "Quote a certified letter to 1 Main St, Richmond VA 23220, then send it in sandbox mode."

No MCP client? Call the REST API directly

Every one of these snippets is ultimately a thin wrapper over the same HTTP API. If your framework has no MCP support, skip the wrapper:

curl -s https://sendpaperplane.com/v1/quotes \
  -H 'Content-Type: application/json' \
  -d '{
    "recipient": {"line1":"1 Main St","city":"Richmond","state":"VA","zip":"23220"},
    "class": "certified",
    "pageCount": 1
  }'

POST /v1/orders sends it (with the same confirmation-token contract behind the scenes for MCP callers), and GET /v1/orders/:id tracks it. Full reference on the developer docs.

The safety contract, regardless of framework

Every path above ends up calling the same two tools in the same order: quote_letter is free, read-only, and mints a single-use confirmation_token bound to the exact recipient, content, class, format, and price; send_letter refuses to run without a token from a matching quote, so no framework or model can mail something as its first move. See how AI agents mail physical letters via MCP for the full mechanics, or try it hands-on in the no-signup demo before wiring it into your own agent.

Related guides

Common questions

Do I need an API key for any of these?

No. The MCP server accepts anonymous access for quote_letter and get_letter_status, and send_letter's only gate is a confirmation_token minted by a prior quote_letter call. If you'd rather call the plain REST API instead of MCP, that does not require a key either for a single order.

Which frameworks does this cover?

LangGraph (via the langchain-mcp-adapters package, which works with any LangChain-compatible model) and the Vercel AI SDK (via its built-in experimental_createMCPClient) both speak MCP directly. OpenClaw is a CLI-first open-source agent that registers remote MCP servers with openclaw mcp add. If your framework isn't one of these three, check whether it offers MCP client support of any kind — the URL and transport (streamable HTTP) are the same regardless of framework.

What if my framework has no MCP support at all?

Call the REST API directly: POST /v1/quotes to price a letter, POST /v1/orders to send it, GET /v1/orders/:id to track it. Any HTTP client works — see the curl example below and the full reference on the developer docs.

Is it safe to let an agent run this unattended?

send_letter cannot mail anything without a confirmation_token tied to an exact quote (recipient, content, class, format, price), so an agent cannot invent a send from scratch. Live sends still return a Stripe payment link for a human to approve; pass sandbox: true while testing to run the full pipeline for free without mailing anything.

Send mail from LangGraph, the Vercel AI SDK, or OpenClaw

First-Class $1.99 · Certified $12.99 · Certified + Return Receipt $14.99

Read the developer docs