Integration Guide

Goose + mailbox.bot

Give Goose a postal operations desk for Square SMBs and local operators. Goose can use Square MCP for business location context, then use mailbox.bot MCP to draft, price, approve, sandbox-test, send, and track physical mail for inspections, permits, applications, license renewals, insurance requests, landlord packets, vendor negotiations, and other paper-heavy SMB operations.

Best first demo

"A restaurant gets a county health inspection correction notice. Goose pulls the Square location, drafts the agency follow-up, previews certified mail cost with mailbox.bot, asks for approval, then stores proof." The same pattern also works for mailed permit applications, landlord notices, insurance packets, signed document bundles, and negotiation follow-ups.

Install As A Goose Extension

Goose can add MCP servers as extensions. Use the hosted Streamable HTTP endpoint when possible, or the command bridge when a local command is easier.

Remote Extension

text
Name: mailbox.bot
Type: Remote Extension (Streamable HTTP)
Endpoint URI: https://mailbox.bot/api/mcp
Timeout: 300
Custom header:
  Authorization: Bearer YOUR_MAILBOX_BOT_API_KEY

Command Bridge

bash
npx -y mcp-remote https://mailbox.bot/api/mcp \
  --header "Authorization: Bearer YOUR_MAILBOX_BOT_API_KEY"

Before You Run

Each Goose user needs their own mailbox.bot account and agent credential. The public recipe never includes a shared key.

text
1. Create a mailbox.bot account.
2. Create an agent in the dashboard.
3. Create an agent credential with mail.send and webhook.manage.
4. Start with the sk_agent_test_ sandbox key.
5. Export it as MAILBOX_BOT_API_KEY before running Goose.
6. Switch to a live sk_agent_ key only when ready to approve real mail.

Get an agent key from API keys, then ask Goose to list available mailbox.bot tools. Use sandbox/test keys or dry_run=true while developing.

Reusable Goose Recipe

The fastest path for a Goose user is the recipe file. It packages the SMB compliance-mail instructions, mailbox.bot MCP bridge, sandbox lifecycle tools, and approval-first operating policy.

bash
curl -O https://mailbox.bot/goose-square-compliance-mail.recipe.yaml
export MAILBOX_BOT_API_KEY=sk_agent_test_...
goose run --recipe goose-square-compliance-mail.recipe.yaml

# Optional: open in Goose Desktop or create a shareable deeplink
goose recipe open goose-square-compliance-mail.recipe.yaml
goose recipe deeplink goose-square-compliance-mail.recipe.yaml

The public recipe is available at goose-square-compliance-mail.recipe.yaml. Use an sk_agent_test_ key first, then switch to a live agent key when the operator is ready to approve real mail.

Why Square + Goose + Postal Workflows

Square gives Goose location, seller, staff, catalog, and operating context. The painful mail is usually outside Square: health department letters, city clerk follow-ups, permit applications, fire inspection notices, business license renewals, insurance requests, landlord correspondence, vendor packets, and negotiation letters. mailbox.bot gives Goose the real-world action: physical mail with approval, cost controls, certified options, sandbox testing, webhooks, and proof.

Prompt: Health Inspection Follow-Up

text
You have the Square MCP extension, mailbox.bot MCP extension, and any available PDF/browser/email tools enabled.

A restaurant received a county health inspection correction notice.
Use Square to confirm the business location name, address, and operator context.
Use the notice text or attached PDF to extract the agency, inspection date, correction items,
deadline, and mailing address. Draft a concise follow-up letter and use mailbox.bot
dry_run=true to price certified mail before anything is sent.

Rules:
- Do not send live mail without approval.
- Include Square location id, agency, notice id, inspection date, and deadline in mailbox.bot metadata.
- Use certified mail for inspection corrections, permit deadlines, and agency disputes.
- Ask for missing notice fields instead of guessing.

Prompt: Permit Renewal Packet

text
Use mailbox.bot to prepare an approval-ready city permit follow-up for this Square SMB workflow:

Context:
- The business is a restaurant using Square POS.
- The city requested mailed follow-up for a food service permit renewal.
- The operator has a deadline and wants proof that the packet was sent.

Create the document text, run a mailbox.bot dry run, and return:
1. agency recipient and attention line
2. mail class
3. estimated cost
4. approval checklist
5. documents or facts still needed
6. metadata that should be stored on the mail job

Prompt: Application Or Negotiation Packet

text
Use mailbox.bot to prepare an approval-ready mailed application packet:

Context:
- The business is a Square-using SMB with location context available.
- The operator needs to mail an application, renewal, appeal, insurance packet,
  landlord packet, vendor compliance packet, or signed document bundle.
- The recipient may require a physical signature, check, notarized document,
  certified delivery, or proof that the packet was sent before a deadline.

Create the packet cover letter, choose first_class or certified based on risk,
run dry_run=true, and return:
1. recipient and attention line
2. required enclosures
3. signature/notary/check requirements
4. mail class and estimated cost
5. missing facts
6. metadata for the mail job

Recipe Shape

The public recipe uses this shape: a command bridge to mailbox.bot MCP, an environment variable for the user's key, sandbox tools, and approval-first instructions.

yaml
version: "1.0.0"
title: "Square SMB postal operations desk"
description: "Use Goose, Square MCP, and mailbox.bot MCP to draft, price, approve, sandbox-test, send, and track physical inspection, permit, application, insurance, landlord, negotiation, and compliance correspondence."
instructions: |
  You are an SMB postal operations agent.
  Use mailbox.bot for physical mail drafting, cost preview, approval,
  sandbox lifecycle testing, sending, status tracking, and proof.
  Never send live postal mail without explicit approval.
  Prefer dry_run=true first.
parameters:
  - key: agency_name
    input_type: string
    requirement: optional
    default: "County Health Department"
    description: "Agency or department receiving the correspondence."
  - key: notice_or_permit_number
    input_type: string
    requirement: optional
    default: "unknown"
    description: "Inspection notice, permit, license, or case reference number."
  - key: deadline
    input_type: string
    requirement: optional
    default: "unknown"
    description: "Response deadline from the notice, if known."
extensions:
  - type: stdio
    name: mailbox-bot
    cmd: sh
    args:
      - "-lc"
      - "npx -y mcp-remote https://mailbox.bot/api/mcp --header \"Authorization: Bearer $MAILBOX_BOT_API_KEY\""
    timeout: 300
    env_keys:
      - MAILBOX_BOT_API_KEY
    available_tools:
      - send_outbound_mail
      - create_test_outbound_mail
      - advance_test_outbound_mail
      - list_outbound_mail
      - get_outbound_mail
      - update_webhook
prompt: |
  Prepare a physical-mail workflow for {{ agency_name }}.
  Notice or permit number: {{ notice_or_permit_number }}.
  Deadline: {{ deadline }}.
  Draft a concise response letter, choose first_class or certified based on risk,
  sandbox-test the lifecycle, and use mailbox.bot dry_run=true to validate and price the mailpiece.
  Return the draft, cost preview, metadata, missing facts, sandbox result, and approval checklist.

Recommended Tool Policy

Keep the mailbox.bot Goose tool surface small and safe. The agent should call get_mailbox_md first, use send_outbound_mail with dry_run=true for previews, and require approval before live sends.

Preview
Use dry_run=true for generated mailpieces and show cost before committing.
Approval
Use requires_approval=true for certified mail, agency deadlines, health inspection responses, permit packets, mailed applications, and negotiation letters.
Metadata
Attach Square location ids, agency names, permit numbers, inspection dates, deadlines, document types, enclosure lists, and correlation ids to each outbound mail job.
Proof
After sending, use list_outbound_mail and get_outbound_mail to retrieve status and proof context.
Sandbox
Use create_test_outbound_mail and advance_test_outbound_mail to simulate submitted, ready, mailed, and delivered updates.

Delivery Updates Back To Goose

For a hosted Goose build, SMB copilot, or workflow app, configure a mailbox.bot webhook URL so outbound mail status updates can update the Goose task, compliance checklist, internal thread, or operator notification. The metadata Goose sends on the mail job is echoed back in each webhook.

http
PUT /api/v1/webhooks/settings
Authorization: Bearer sk_agent_...
Content-Type: application/json

{
  "webhook_url": "https://your-goose-workflow.example.com/mailboxbot/webhook",
  "enabled": true,
  "event_types": [
    "mail.pending_approval",
    "mail.submitted",
    "mail.mailed",
    "mail.delivered",
    "mail.failed"
  ]
}

Use sandbox lifecycle testing before live mail. The MCP sandbox tools use the same webhook payload shape and signing path as production, but skip billing and facility fulfillment.

http
# MCP tool call: create_test_outbound_mail
{
  "mail_class": "certified",
  "page_count": 2,
  "recipient_zip": "94103",
  "metadata": {
    "source": "goose",
    "integration": "square",
    "workflow": "health_inspection_follow_up",
    "square_location_id": "L123",
    "agency": "County Health Department",
    "notice_id": "HD-2026-1042",
    "deadline": "2026-06-12",
    "correlation_id": "goose-task-abc123"
  }
}

# MCP tool call: advance_test_outbound_mail
{ "mail_id": "OUTBOUND_MAIL_ID_FROM_CREATE_STEP" }