On this page

MCP server

Postsure is also an MCP server. MCP (Model Context Protocol) is the way AI tools call outside services. Add Postsure to an AI tool, and it can see your accounts, posts and post numbers, upload media, make drafts and publish posts.

Add it to Claude Code

Run this once, with your API key in place of <your API key>:

Terminal

claude mcp add --transport http postsure https://mcp.postsure.dev/mcp \  --header "Authorization: Bearer <your API key>"

Then run /mcp in Claude Code: it shows postsure connected. Ask "List my Postsure accounts." Claude asks to use list_accounts. Say yes, and it answers with your connected accounts.

The server

Address
https://mcp.postsure.dev/mcp
Transport
Streamable HTTP, with no session: no session id and no stream that stays open.
MCP versions
2025-06-18, 2025-11-25 and 2026-07-28.
Name
postsure

It works on one workspace: the workspace of the API key you sign in with. An AI tool sees nothing of your other workspaces.

Sign in

There are two ways: send the API key with every call, or sign in once on Postsure's page. Both use the same API key as the REST API.

With an API key

Send the key in the same header as the REST API: Authorization: Bearer <key>. No key gets 401 with missing_api_key. A wrong or revoked key gets 401 with invalid_api_key.

Never put the key in the URL, because URLs end up in logs. Postsure refuses a request to /mcp with a query string, or with anything after /mcp in its path (400, invalid_request), and never reads a key in it.

With Postsure's page

Some AI tools, such as ChatGPT and Claude, sign in with OAuth instead. You give the tool only the address. With Claude Code, leave out the header:

Terminal

claude mcp add --transport http postsure https://mcp.postsure.dev/mcp

Then run /mcp in Claude Code, select postsure, and sign in. In every AI tool, the sign-in goes like this:

  1. The AI tool opens Postsure's page, "Connect an AI tool to Postsure", in your browser.
  2. Check "After you approve, you go back to:". It must show the AI tool you are using, for example localhost with a port for Claude Code on your computer. If it shows anything else, click Deny.
  3. Paste your API key in "Your Postsure API key" and click Approve.

The key picks the workspace. It is used only on that page: it is never sent to the AI tool and never stored. The tool gets tokens of its own and gets new ones by itself.

Try it in a terminal

MCP Inspector calls the server from the command line. The first command lists the tools. The second calls list_accounts.

Terminal

npx @modelcontextprotocol/inspector --cli https://mcp.postsure.dev/mcp --transport http \  --header "Authorization: Bearer <your API key>" --method tools/listnpx @modelcontextprotocol/inspector --cli https://mcp.postsure.dev/mcp --transport http \  --header "Authorization: Bearer <your API key>" --method tools/call --tool-name list_accounts

Tools

There are 12 tools. Each tool does what its REST call does, with the same checks and error codes. It answers with the REST API's fields, under the same names. It works only on the workspace of the sign-in, and refuses an input field it does not know.

ToolWhat it does
list_accountsLists your connected accounts, newest first, as GET /v1/accounts does. Only active accounts can post. For any other, status_reason says why. It changes nothing.
upload_media_from_urlSaves the file at a public url, or a file from the chat, as POST /v1/media does. It gives the id to send in media_ids. The url must answer with the file itself, with no redirect, within 10 seconds, and send all of it within 45 seconds. A slower file gets media_download_failed, and nothing is saved: use get_upload_link instead. Each call saves a new file.
get_upload_linkMakes a one-time link where the user uploads one file from their computer, as POST /v1/media/upload-links does. The link ends 15 minutes after it is made. Then get_media with its media_id shows if the file came. The link holds no API key and no token. A workspace has at most 20 open links.
get_mediaOne media file, by its media_id, with its state: ready, waiting (the file has not come yet) or expired (the link ended first). It changes nothing.
create_postMakes a draft, as POST /v1/posts with draft: true does. Nothing is sent. The same input again within 24 hours gives back the same draft, not a second one.
update_postChanges a draft, as PATCH /v1/posts/{id} does. Send its post_id and only the fields to change; null removes an optional one. Only a draft: any other post gets post_not_draft. Nothing is sent.
publish_postPublishes a draft, as POST /v1/posts/{id}/publish does. It checks the accounts first: if one is not active any more, the post stays a draft. It is sent once: a second call sends nothing. The answer says queued, not published. With publish_at, it schedules the draft instead, with the rules of Scheduled posts.
get_postOne post and its receipt, as GET /v1/posts/{id} does. Its answer starts with the status in plain words. It reads the saved status: no network is asked. It changes nothing.
get_post_resultsA post's numbers on each account, as GET /v1/posts/{id}/results does: views, likes, comments and shares, and more when the network gives them. null means not available, never 0. Postsure reads each account at most once every 15 minutes, and read_at says when. While a read is still running, refreshing is true: call it again in a moment. It changes nothing. See Post numbers.
list_postsA page of your posts, newest first, as GET /v1/posts does. It takes only these filters of List posts: status (a list here), account_id, created_after, created_before, limit and cursor. It changes nothing.
cancel_postCancels a draft, a scheduled post, or a queued post whose send has not started, as POST /v1/posts/{id}/cancel does. A post being sent, or already sent, gets post_already_sending. It never deletes a post on a network.
get_analyticsYour workspace's numbers, as GET /v1/analytics does: how many posts were sent, failed and unconfirmed, per day, network, account and failure cause. A post to two accounts counts twice. Each cause says what to do about it. range is 7d, 30d (the default) or 90d, up to today. time_zone is an IANA name, like Europe/Berlin, and UTC by default. It also lists the 5 posts with the most views and the 5 with the most likes. They come from the numbers last read, so a post whose results were never asked for is left out. It changes nothing. See Post numbers.

A post leaves out two REST fields, to keep results small: sent_at, and each target's confirmed_at. A target you confirmed says so in its status_text.

Files from the chat

Some AI apps can pass on a file that you attach in the chat. The app sends it to upload_media_from_url as file, in place of url. Send one of the two: a call with both, or with neither, gets invalid_request.

download_url
The app's link to the file. Required. It gets every check a url gets. It is a secret: Postsure never saves or shows it, so the file's source_url is null.
file_id
The app's id for the file. Required. Postsure does not keep it.
mime_type
Optional. Postsure does not read it: it reads the type from the file's first bytes.
file_name
Optional. It becomes the file's name if it is a plain name, not a path. A file_name at the top of the input wins over it.

A url and a file take the same types and sizes as POST /v1/media:

Postsure reads the type from the file's first bytes, not from its name. Each network's own limits are checked when the post is made.

What a tool answers

A result is the REST API's view, as structured content and as the same JSON in text. Most tools also say what the result means in plain words, for the AI tool to tell you. For example, get_post starts with the post's status, and get_media with the file's state.

The words come first, as a text of their own. They are also the first field of the structured content, summary. Some AI tools read only the structured content. list_accounts and upload_media_from_url have no words, and a failure has none.

get_media, while the file has not come

{  "summary": "The file has not arrived yet. The upload link ends at 2026-10-18T12:13:40Z (UTC). Ask the user to open the link and pick the file, then call get_media again.",  "id": "cmh0k3v8a0001l908w2n6d4rt",  "state": "waiting",  "kind": null,  "mime_type": null,  "size_bytes": null,  "duration_ms": null,  "source_url": null,  "alt_text": null,  "file_name": null,  "created_at": "2026-10-18T11:58:40.120Z",  "upload_expires_at": "2026-10-18T12:13:40.120Z"}

A failed call is a tool result with isError: true, and the REST API's error body as text: {"error": "<code>", "message": "<what to fix>"}. Input that is not valid gets invalid_request, with issues that name each field.

A result's JSON, its summary included, is at most 25,000 characters and about 20,000 tokens, whichever comes first. Postsure estimates the tokens. An ASCII character, like an English letter, counts half a token. Any other character, like an emoji or a Chinese one, counts more, so a result in such text is cut sooner.

Drafts first

An AI tool never posts in one step. It makes a draft first, and posts it only after you say yes:

  1. You ask, for example: "Post 'Hello from Postsure!' to my X account."
  2. The AI tool calls create_post. Postsure makes a draft and sends nothing.
  3. The tool shows you the draft: what it will post, and where.
  4. You say yes, or ask for a change. A change goes through update_post.
  5. The tool calls publish_post. Postsure sends the post once. The answer says queued, not published.
  6. The tool calls get_post to get the result: the live link, or the reason it failed.

No tool can retry a failed post, confirm that a post is live, or move a scheduled post. For a failed account, make a new post. An unconfirmed post is never sent again by the AI tool: check the account on the network. To move a scheduled post, cancel it and make a new one. The REST API can retry or confirm: see Retry or settle an account.

Postsure tells every AI tool to work this way. It sends this text when the tool connects, in the MCP instructions field:

Postsure posts to the social accounts the user connected. Make a draft with create_post, show it to the user, and call publish_post only after the user says yes. A post is sent once. If a post is unconfirmed, it may already be live: never post it again, and ask the user to check the network. For a file on the user's computer, use get_upload_link. For a file at a public URL, use upload_media_from_url.

publish_post, update_post and cancel_post are marked as tools that change things (destructiveHint), so Claude asks you before each call. The six tools that only read are marked readOnlyHint: list_accounts, get_media, get_post, list_posts, get_post_results and get_analytics. The other three, create_post, get_upload_link and upload_media_from_url, only add a draft, a link or a file.

Call limit

An AI tool can call tools in a fast loop. So /mcp takes at most 60 calls a minute from one workspace. Every sign-in of the workspace shares this limit: its API keys and its OAuth sign-ins.

Over the limit, /mcp answers 429 before any tool runs, so nothing is sent to a network. The Retry-After header says how many seconds to wait. A batch with more messages than the whole limit never fits: send fewer messages at a time. Postsure never retries a call because of the limit: the AI tool waits, then calls again.

Over the limit429

{  "error": "rate_limited",  "message": "Too many calls. Wait 30 seconds and try again. The limit is 60 calls a minute for each workspace."}

AI connections

An AI connection is an AI tool that you approved on Postsure's page. List the ones that still work, newest first:

curl

curl https://api.postsure.dev/v1/ai-connections \  -H "Authorization: Bearer $POSTSURE_KEY"

Example response200

{  "data": [    {      "id": "grant_8sJq2VbX0nRk4TfLm7YcPw",      "client_id": "https://tool.example.com/oauth/client.json",      "client_name": "Example AI Tool",      "redirect_host": "tool.example.com",      "scope": "mcp",      "approved_at": "2026-11-08T09:30:00.000Z",      "last_used_at": "2026-11-08T14:31:12.000Z",      "api_key_id": "cmgw6z1kq0001l808h4n2m6xe"    },    {      "id": "grant_Zp4wN1cHa6EudK3rT9vBqA",      "client_id": "client_3fQk9LmXo2RtV7ycNa1BwE",      "client_name": null,      "redirect_host": "127.0.0.1:33418",      "scope": "mcp",      "approved_at": "2026-11-07T18:02:45.000Z",      "last_used_at": "2026-11-08T13:58:40.000Z",      "api_key_id": "cmgw6z1kq0001l808h4n2m6xe"    }  ],  "next_cursor": null}
client_name
The name the AI tool gave, as the page showed it. Postsure does not check it. It can be null.
redirect_host
Where the browser went back to after Approve: the host, and the port if there is one.
last_used_at
When the tool last got tokens: about once an hour while it is in use, not at each call.
api_key_id
The id of the API key pasted on the page. Revoking that key ends the connection.

The list never shows a token or a key. A page has 20 connections; send limit for up to 100, and next_cursor as cursor for the next page.

Cut a connection off by its id:

curl

curl -X DELETE https://api.postsure.dev/v1/ai-connections/<id> \  -H "Authorization: Bearer $POSTSURE_KEY"

It answers 204 with no body. The connection ends at once, with every token of it: the tool's next call to /mcp gets 401 with invalid_token. To come back, the tool must be approved again. A connection that already ended also gets 204.

Both calls need an API key. An AI tool's own token cannot list or cut off connections, and no MCP tool does it.

Every call, field and error is in the API reference.