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>:
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.
- Give Claude Code a key of its own. Then you can cut it off without stopping your other apps. Get keys in the web app, under Developers → API keys.
- Keep the key out of your project. Claude Code keeps the header in its own file in your home folder,
~/.claude.json. Never add Postsure with--scope projectand a header: that writes the key into.mcp.json, a file meant to be committed.
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-25and2026-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:
claude mcp add --transport http postsure https://mcp.postsure.dev/mcpThen run /mcp in Claude Code, select postsure, and sign in. In every AI tool, the sign-in goes like this:
- The AI tool opens Postsure's page, "Connect an AI tool to Postsure", in your browser.
- Check "After you approve, you go back to:". It must show the AI tool you are using, for example
localhostwith a port for Claude Code on your computer. If it shows anything else, click Deny. - 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.
- A sign-in that gets no new tokens for 30 days ends. The tool must sign in again.
- When you revoke the API key, every sign-in it approved ends at once.
- You can see every AI tool that signed in, and cut one off: see AI connections.
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.
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_accountsTools
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.
| Tool | What it does |
|---|---|
list_accounts | Lists 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_url | Saves 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_link | Makes 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_media | One 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_post | Makes 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_post | Changes 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_post | Publishes 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_post | One 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_results | A 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_posts | A 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_post | Cancels 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_analytics | Your 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
urlgets. It is a secret: Postsure never saves or shows it, so the file'ssource_urlisnull. 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_nameat the top of the input wins over it.
A url and a file take the same types and sizes as POST /v1/media:
- JPEG, PNG and WEBP images, up to 20 MB,
- GIFs, up to 15 MB,
- MP4 and MOV videos, up to 100 MB,
- PDFs, up to 50 MB.
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.
- A list that is too long comes back cut to its first items, with a
notethat says how many it shows, of how many. Inlist_posts,next_cursorthen points at the last post shown, so the next call goes on right after it. - A post that is too long comes back with its long texts cut short. Ids, links and statuses stay whole. Its text ends with a note that says where the whole post is:
GET /v1/posts/<id>. Never send a cut text back:create_postandupdate_postrefuse it withinvalid_request. - When its result is too big,
get_analyticskeeps only the 50 accounts with the most posts. Itssummarysays thatGET /v1/analyticslists them all. - Any other result that is too big gets
result_too_large: ask for less in one call.
Drafts first
An AI tool never posts in one step. It makes a draft first, and posts it only after you say yes:
- You ask, for example: "Post 'Hello from Postsure!' to my X account."
- The AI tool calls
create_post. Postsure makes a draft and sends nothing. - The tool shows you the draft: what it will post, and where.
- You say yes, or ask for a change. A change goes through
update_post. - The tool calls
publish_post. Postsure sends the post once. The answer saysqueued, not published. - The tool calls
get_postto 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.
- Every JSON-RPC message counts. A batch of 10 messages counts 10.
- A batch is taken whole or not at all. A refused request is not counted.
- A minute is any 60 seconds: a call counts until 60 seconds after it was taken.
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 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 -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.