Postgale MCP server
Postgale runs a hosted Model Context Protocol server so AI agents (Claude, Cursor, VS Code and other MCP clients) can draft, schedule and publish posts to your connected Reddit, Instagram, Facebook Pages, Threads and TikTok accounts, moderate comments, answer direct messages, send WhatsApp messages and read analytics. It exposes the same operations as the REST API(OpenAPI spec), with the same permissions, rate limits and approval rules.
Endpoint and authentication
- Endpoint:
https://postgale.com/mcp(aliashttps://postgale.com/api/mcp), Streamable HTTP transport, stateless. - Authentication:
Authorization: Bearer sk_…with a Postgale API key from Dashboard → API keys. The key acts for its organization only. - Rate limit: shared with the REST API (default 60 requests per minute per key).
Connect a client
Cursor and most clients that accept an mcpServers file:
{
"mcpServers": {
"postgale": {
"url": "https://postgale.com/mcp",
"headers": {
"Authorization": "Bearer sk_…"
}
}
}
}Claude Code:
claude mcp add --transport http postgale https://postgale.com/mcp --header "Authorization: Bearer sk_…"Claude Desktop, through the mcp-remote bridge (keep the key in the environment so it is not split on the space):
{
"mcpServers": {
"postgale": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://postgale.com/mcp",
"--header",
"Authorization:${POSTGALE_AUTH}"
],
"env": {
"POSTGALE_AUTH": "Bearer sk_…"
}
}
}
}VS Code:
{
"servers": {
"postgale": {
"type": "http",
"url": "https://postgale.com/mcp",
"headers": {
"Authorization": "Bearer sk_…"
}
}
}
}Raw HTTP, to check a key:
curl https://postgale.com/mcp \
-H 'Authorization: Bearer sk_…' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
curl https://postgale.com/mcp \
-H 'Authorization: Bearer sk_…' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'Mcp-Protocol-Version: 2025-06-18' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'Tools
68 tools. Each declares MCP annotations (read-only, destructive, open-world) so clients can ask for confirmation before writes; the kind below follows them.
| Tool | What it does | Kind |
|---|---|---|
| Accounts & connect | ||
get_api_key_info | The key in use, its organization and the effective approval policy | Read-only |
list_accounts | Connected social accounts (ids for create_post), optionally by externalId | Read-only |
connect_account | OAuth link a human opens to connect Reddit, Instagram, Facebook Pages, Threads, TikTok or WhatsApp (Embedded Signup) | Write |
select_connection | List pending connections (no pendingId), the options of one (e.g. Facebook Pages), and connect the chosen ones | Write |
get_account_health | Token validity, granted scopes, missingPermissions, publishing limit and recommendations | Read-only |
update_account | Set or clear the customer reference (externalId) of an account | Write |
| Media | ||
list_media | Recent uploaded media | Read-only |
get_media | One media file | Read-only |
upload_media | Import an image or video from a URL or base64; returns its publicUrl | Write |
| Posts | ||
list_posts | Recent posts, optionally by status | Read-only |
get_post | One post with per-platform status, URLs and errors | Read-only |
create_post | Draft, schedule or publish a post (publishNow publishes live) | Destructive |
update_post | Replace the text of an unpublished post | Destructive |
delete_post | Delete a post from Postgale (not from the platforms) | Destructive |
publish_post | Publish a draft, scheduled or failed post live now | Destructive |
manage_published_post | Edit (Facebook) or delete (Facebook, Threads) a live post; turn Instagram comments on or off | Destructive |
| Comments & mentions | ||
list_post_comments | Comments on the published targets of a post | Read-only |
reply_to_comment | Publish a reply to a comment (Reddit, Instagram, Facebook, Threads) | Write |
list_comments | Comments and replies on Instagram, Facebook and Threads posts, by post or by account | Read-only |
moderate_comment | Comment, reply, hide/unhide, delete; like/unlike on Facebook | Destructive |
list_mentions | Media the Instagram account was tagged in | Read-only |
list_inbound_events | Events received from Meta webhooks: comments, replies, mentions, Page feed changes, direct messages | Read-only |
| Direct messages | ||
list_conversations | Instagram, Messenger, WhatsApp and X conversations, latest first, with unread counts and the messaging window | Read-only |
get_conversation_messages | One conversation (incl. messagingWindow) and its messages, oldest to newest | Read-only |
send_message | Send a live DM (text or one attachment; WhatsApp: also templates, interactive, location, reactions) to the participant, within the messaging window; tag HUMAN_AGENT | Write |
mark_conversation_read | Mark read in Postgale and as seen on Instagram/Messenger | Write |
sync_conversations | Backfill conversations of an account (or one conversation) from Meta or X | Write |
start_conversation | X only: send the first live DM to someone (@username or user id) | Write |
| X | ||
x_engagement | Repost, like, bookmark or follow (and undo) as the X account; live | Write |
x_search_posts | Recent search (last 7 days) with X search syntax | Read-only |
x_lookup | One X post (id or URL) or one user (@username) | Read-only |
whatsapp_connect_number | Connect a number with an existing token (stored encrypted) instead of Embedded Signup | Write |
whatsapp_get_phone_number | Display number, verified name, quality rating, messaging limit and onboarding state; refresh from Meta | Read-only |
whatsapp_register_number | Register or re-register the number for the Cloud API (6-digit PIN) | Write |
whatsapp_send_message | Send a live text, media, template, interactive, location or reaction message; outside 24 hours only templates | Write |
whatsapp_mark_read | Mark an inbound message read, optionally with a typing indicator | Write |
whatsapp_list_templates | Message templates of the WhatsApp Business Account, with status | Read-only |
whatsapp_get_template | One template with its components | Read-only |
whatsapp_create_template | Submit a template for Meta’s review | Write |
whatsapp_delete_template | Delete a template (one language or all) | Destructive |
whatsapp_upload_media | Upload a Postgale media or public URL to WhatsApp; returns the id to send | Write |
whatsapp_get_media | MIME type, size and sha256 of a WhatsApp media id (download through the REST API) | Read-only |
whatsapp_search_numbers | Numbers Postgale can buy for WhatsApp, with the monthly price (when the instance sells numbers) | Read-only |
whatsapp_buy_number | Buy a number and connect it to the WABA of a connected WhatsApp account (code captured by Postgale) | Write |
whatsapp_list_numbers | Numbers bought for the organization, with status and the limit | Read-only |
whatsapp_get_number | One bought number; the code captured in the last 10 minutes | Read-only |
whatsapp_release_number | Release a bought number (returned to the carrier; its account stops working) | Destructive |
| TikTok (see /docs/tiktok) | ||
tiktok_get_creator_info | Creator nickname, allowed privacy levels, disabled interactions and max video length; required before every TikTok post | Read-only |
tiktok_get_profile | Profile and lifetime stats: followers, following, likes, public videos | Read-only |
tiktok_list_videos | Public videos with views, likes, comments and shares (paged), or specific video ids | Read-only |
| Meta Ads (see /docs/ads) | ||
ads_list_ad_accounts | Ad accounts the connected Facebook user can manage | Read-only |
ads_list | Campaigns, ad sets, ads, creatives or custom audiences of an ad account | Read-only |
ads_get | One campaign, ad set, ad, creative or audience | Read-only |
ads_boost_post | Boost a published Facebook/Instagram post (PAUSED by default, needs confirm) | Write |
ads_create_campaign | Create a campaign (PAUSED by default, needs confirm) | Write |
ads_create_ad_set | Create an ad set: targeting, budget, schedule (PAUSED, needs confirm) | Write |
ads_create_creative | Create a creative from a post or a new link ad | Write |
ads_create_ad | Create an ad from an ad set and a creative (PAUSED, needs confirm) | Write |
ads_update | Rename, pause, activate or change budget/bid/schedule/targeting (spend changes need confirm) | Destructive |
ads_create_audience | Create a customer-list custom audience | Write |
ads_add_audience_users | Add hashed emails or phones to a custom audience | Write |
ads_get_insights | Impressions, reach, clicks, spend, CPC, CPM, CTR | Read-only |
ads_search_targeting | Search interests, locations and other targeting options | Read-only |
| Analytics | ||
get_analytics | Post and account insights, demographics, online followers, best posting times, publishing limit | Read-only |
| Webhooks | ||
list_webhooks | Webhook endpoints | Read-only |
create_webhook | Register an HTTPS endpoint; returns the signing secret once | Write |
webhook_deliveries | List deliveries, redeliver one, or send a webhook.test event | Write |
delete_webhook | Remove a webhook endpoint | Destructive |
Publishing
create_postwithoutpublishNoworscheduledForsaves a draft.scheduledFor(ISO 8601 with a time zone) schedules it.publishNowandpublish_postpublish live to the real platforms.- Editing an approved post sends it back for approval. The same text cannot be posted twice within 24 hours; pass
requestIdto retry safely. - Instagram, Facebook, Threads and TikTok media must be hosted: call
upload_mediaand pass itspublicUrlasmediaUrl(or inmediaUrls). Instagram images must be JPEG. TikTok requiresprivacyLevel. Per-platform options are listed in the REST API reference. - Facebook Pages: one account per Page. The owner picks the Pages after opening the
connect_accountlink. When the OAuth result is a pending selection, callselect_connectionwithout arguments to find itspendingId(it is also sent in theconnection.pendingwebhook), then with thependingIdand nooptionIdsto list the Pages, then again with the chosenoptionIdsto connect them (within 30 minutes). - Every write made through MCP is recorded in the organization's audit log.
Direct messages
- Instagram (permission
instagram_business_manage_messages) and Facebook Page Messenger (pages_messaging). Inbound messages arrive through Meta webhooks and appear inlist_conversations(and asmessage.receivedwebhooks);sync_conversationsbackfills older threads (Meta returns details for the 20 most recent messages per conversation). send_messagesends a live message to a real person. Meta only allows replies to people who wrote first: free-form messages within 24 hours of the participant's last message, or within 7 days with tagHUMAN_AGENTwhen a human writes the reply (the Meta app needs the Human Agent permission). Outside the window the tool fails withoutside_messaging_windowand nothing is sent;messagingWindowon each conversation shows when it closes.- Sent messages cannot be edited or deleted.
get_conversation_messagesdoes not mark anything read;mark_conversation_readdoes, and sends a read receipt unlessplatformis false.
- One account per business phone number.
connect_accountwithwhatsappreturns a link to Meta's Embedded Signup for the number's owner;whatsapp_connect_numberconnects a number with a token you already have. whatsapp_send_message(orsend_messagein a WhatsApp conversation) sends live messages. Free-form messages only within 24 hours of the person's last message; otherwise only an approved template, elseoutside_messaging_window.- Templates:
whatsapp_list_templates,whatsapp_create_template(reviewed by Meta;template.statuswebhook),whatsapp_delete_template. Media:whatsapp_upload_media, then send withwhatsappMediaId. - Full guide with payloads and curl examples: /docs/whatsapp.
Approval gate
- When approval is required for the organization, an account or the API key, new posts are held as
pending_approvaluntil a person approves them in the dashboard.get_api_key_infoshows which rules apply. - While approval applies,
moderate_comment,reply_to_comment,manage_published_post,send_messageandwhatsapp_send_messageare refused withapproval_required. Reads are never blocked.
Errors
Tool errors carry the same message as the REST API, with the error code appended in parentheses, e.g. … Reconnect the account. (reconnect_required). A missing_permission error means the account must be reconnected after the Meta app has been granted that permission; get_account_health lists the account's missingPermissions and the features they block.
| Code | Meaning |
|---|---|
approval_required | Approval applies to this key, organization or account; comment moderation, changes to published posts and send_message are refused |
missing_permission | The account did not grant the permission this needs: add it to the Meta app, then reconnect the account |
reconnect_required | The token is no longer valid; the account is flagged needs_reconnect and must be reconnected |
rate_limited | The platform rate-limited the request; retry later |
not_supported | The platform does not offer this feature (e.g. deleting Instagram posts) |
invalid_request | The platform rejected the input |
platform_error | Any other platform failure |
outside_messaging_window | send_message outside Meta’s window: 24 hours after the person’s last message, 7 days with tag HUMAN_AGENT. Nothing was sent |
recipient_unavailable | The person cannot receive messages from this account right now |
sync_required | sync_conversations with a conversationId needs a previous sync of the account |
pending_expired | The pending connection expired (30 minutes) or was already completed |
template_error | WhatsApp: Meta rejected the template name, language, parameters or status |
recipient_not_allowed | WhatsApp test number: the recipient is not in the allowed list |
phone_number_not_registered | WhatsApp: call whatsapp_register_number first |
account_restricted | WhatsApp: the business account is restricted or has a payment issue |
Post state conflicts are reported the same way, e.g. (APPROVAL_REQUIRED), (ALREADY_PUBLISHED), (NOT_EDITABLE).
Limitations
- MCP clients authenticate with API keys only; OAuth sign-in for MCP clients is not available yet.
- Approving and rejecting posts is dashboard-only.
- Posts cannot be rescheduled or unscheduled: delete the post and create it again.
- API keys, organization settings and disconnecting accounts are managed in the dashboard.
For plain HTTP integrations, webhook payloads and signature verification, see the REST API reference.