App builders
Give an agent you build in Voiceflow a mailbox, or let Lovable and Bolt read mail while you build.
On this page
Before you start
- The MCP URL is
https://api.postyard.dev/mcp, over Streamable HTTP. -
A bot that talks to strangers should never read mail. Anyone in the chat could ask it what
the mailbox says. Give it one tool,
create_draft, and a key limited to one mailbox. - Create keys under Agents & API > API keys with Read and draft. What each tool may change is in the tool table.
Voiceflow
Voiceflow connects to hosted MCP servers with headers, so use an API key (Voiceflow's docs).
- Add an MCP server from a playbook's Tools menu, or in Settings > MCP servers.
- Set Server name to Postyard and Server URL to
https://api.postyard.dev/mcp. - Under Headers, add
Authorizationwith the valueBearer py_live_.... - Voiceflow fetches the tools. Select only the ones you need, such as
create_draft. - Use the tool in a playbook, where the agent decides when to call it, or drag an MCP step onto a workflow and map its inputs.
create_draft needs a mailbox_id. Get it once from
GET /v1/mailboxes and put it in the step as a fixed value. In a workflow, also fix
to to your own team's address, so a visitor can't choose who the draft goes to.
Lovable
In Lovable, a custom MCP server is a chat connector. Lovable reads from it while you build. It is personal to you and never part of your published app.
- Open Connectors, select Add custom, and choose MCP server.
- Enter a Server name and the Server URL
https://api.postyard.dev/mcp. - Keep OAuth, click Add & authorize, and sign in with your Postyard account.
- In Postyard, choose the connection's mailboxes under Agents & API > Connections.
For the app itself, ask Lovable to connect the API directly and give it the request below. When it asks for the key, use the Add secret form, not the chat. Lovable then calls the API from server-side code.
Bolt
From Bolt's docs:
- On the Bolt homepage, click the plus icon in the chatbox, then Connectors and Manage connectors.
- Click Custom MCP server. Enter a name, the URL
https://api.postyard.dev/mcp, and HTTP as the transport type. - For authentication, choose MCP OAuth and sign in, or API key and enter your key. Click Connect.
- Open the connector, click the three dots, then Edit. Under Tools, turn off the send tools, then click Save changes.
- In your project, click the plus icon in the chatbox, then Connectors, and turn on the connector.
- With OAuth, choose its mailboxes in Postyard under Agents & API > Connections.
This lets Bolt read mail while you build. For the app itself, keep the key as a secret. Bolt reads secrets only in server functions, so the key never reaches a visitor's browser.
A contact form that drafts an email
Call this from server-side code. It writes a draft to your own team; a person reads it in
Postyard and decides what to do. MAILBOX_ID comes from GET /v1/mailboxes.
// Server-side only: the key must never reach the browser.
// name, email and message come from your form.
const res = await fetch(`https://api.postyard.dev/v1/mailboxes/${process.env.MAILBOX_ID}/drafts`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.POSTYARD_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: ['team@harborlight.example'],
cc: [],
bcc: [],
subject: 'Contact form: ' + name,
text: `From: ${name} <${email}>\n\n${message}`,
attachments: [],
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
To send instead, use a key with Read, draft and send and post the same body to
/v1/mailboxes/MAILBOX_ID/messages with an Idempotency-Key header, so a
retry never sends twice. The full reference is the
OpenAPI document.
If it doesn't work
See troubleshooting, or write to support.