MCP · API 1.39.0
Pliing MCP
Let your AI assistant notify you during work in one thread, ask for a choice and receive your reply in Pliing.
Connect your AI assistant
- Create a project and connect your PliingID. Approve notification permission under Senders in the app.
- Open the project in the console. Under “AI notifications with MCP”, choose the approved recipient and create a named MCP key. Copy it once.
- Add a remote MCP server to your AI client using the settings below. Store the key in the client’s secure credentials or environment configuration.
- Ask the assistant to send progress, notify completion/failure and use Pliing when it needs your input. Keep the request_id when waiting for an answer.
| Transport | Streamable HTTP |
|---|---|
| URL | https://api.pliing.app/mcp |
| Authorization | Bearer <your MCP key> |
This version uses manually configured Bearer authentication. Clients that only support browser OAuth sign-in need a later OAuth integration. Never paste the key into a conversation. To configure a personal app project through the API, pass mcp_recipient with your PliingID to the existing project token endpoint; ordinary sender keys cannot access MCP.
Codex and Claude Code
Create a separate MCP key for each client. Make PLIING_CODEX_MCP_TOKEN available to the Codex process and PLIING_CLAUDE_MCP_TOKEN available to Claude Code before starting them. The commands below store variable names, not the secrets. Restart or reconnect the client after setup. The Codex app must also have access to its variable; setting it in an unrelated terminal does not update an already running app.
Codex
codex mcp add pliing --url https://api.pliing.app/mcp \ --bearer-token-env-var PLIING_CODEX_MCP_TOKEN
Equivalent config.toml entry:
[mcp_servers.pliing] url = "https://api.pliing.app/mcp" bearer_token_env_var = "PLIING_CODEX_MCP_TOKEN"
Claude Code
claude mcp add --transport http --scope user pliing \
https://api.pliing.app/mcp \
--header 'Authorization: Bearer ${PLIING_CLAUDE_MCP_TOKEN}'Equivalent .mcp.json entry:
{
"mcpServers": {
"pliing": {
"type": "http",
"url": "https://api.pliing.app/mcp",
"headers": {
"Authorization": "Bearer ${PLIING_CLAUDE_MCP_TOKEN}"
}
}
}
}Official Codex documentation · Official Claude Code documentation
Suggested instruction
Use Pliing to notify me at meaningful milestones, on completion and on failure. When you need my choice, call pliing_ask, keep the request_id, and poll pliing_get_response at the returned interval. Continue only after an explicit answer that permits the requested action. Never treat pending, expired, errors or a timeout as approval. Follow your host’s approval rules.
Six tools
| Tool | Behavior |
|---|---|
pliing_notify | Sends progress, a result or a failure. Required: title, body, idempotency_key. Optional: level (info, important, critical; see what the level means for delivery), url and url_label for an HTTPS link to the result, the thread fields below, and reply_to to answer a command. |
pliing_ask | Asks a question with 2–3 choices, or with 0–3 choices and allow_text: true for a written answer. Each choice has a stable value and a label in the user's language. Returns a durable request_id. Accepts the same thread fields. |
pliing_ask_cards | Asks several questions at once as a card deck of 1–10 cards. Each card has title and optionally body, background, 2–4 choices, allow_text and optional. Returns a request_id; the answers are read with pliing_get_response. |
pliing_get_response | Fetches the status and the chosen or written answer. Required: request_id. Only an explicit answer can express approval. |
pliing_close_question | Closes a pending question from pliing_ask in the key’s project and recipient scope. Takes request_id and optional reason. |
pliing_list_questions | Lists the recipient’s MCP questions and recovers their state changes after a cursor. The filters and pagination match the REST listing. The key supplies the recipient. |
pliing_get_delivery | Reads one notification’s aggregate push status within the key’s project and recipient scope. Takes notification_id. |
pliing_get_replies | Fetches the user's free-text replies, oldest first. Optional: thread_id for one thread, after (next_after from the previous call) and wait. Returns data, next_after and poll_after_seconds. |
pliing_activity | Shows or removes a temporary status in a thread, for example “thinking …”. Required: thread_id, state. Sends no notification. |
The recipient is fixed by the key, so the tools have no to argument. accepted means stored by Pliing, not confirmed delivery or reading.
Give every message its own idempotency_key, for example the thread_id plus a counter, and reuse a key only to retry the same message. The key stays taken in the project as long as the message is kept: with other content it is refused (idempotency_conflict), and with the same content you get the earlier message back without a new push.
One task, one thread
Give every message and question of a task the same thread_id (1–128 letters, numbers or _.:-), and the user sees them as one thread in the app. thread_title names the thread. allow_replies: true gives the user a reply field; read replies with pliing_get_replies and pass next_after as after next time. A reply is the user’s input for the thread, not an approval that bypasses the AI client’s own rules.
The optional thread_icon_url sets the recipient’s conversation icon; use a new versioned HTTPS URL to update it. Image requirements and caching.
{
"title": "Refactoring started",
"body": "I am going through 14 modules. Reply if anything should be left out.",
"idempotency_key": "refactor-7-start",
"thread_id": "refactor-7",
"thread_title": "Payments refactoring",
"thread_icon_url": "https://example.com/avatar-v1.png",
"allow_replies": true
}The result of pliing_get_replies:
{
"data": [
{
"id": 311,
"thread_id": "refactor-7",
"from": "pliing-7m3k9-xr2n8-q4v6",
"body": "Leave the invoicing module alone.",
"created_at": "2026-10-21T10:42:07+00:00"
}
],
"next_after": 311,
"poll_after_seconds": 5
}Status example: pliing_notify arguments
{
"title": "Build complete",
"body": "All tests passed.",
"idempotency_key": "build-42-complete",
"url": "https://ci.example.org/build/42",
"url_label": "Open result"
}Answering a command
A project can register commands, for example /info, that the app suggests when the user types / (see commands in the API reference). A command arrives as an ordinary reply from pliing_get_replies. Answer with pliing_notify in the same thread and set reply_to to the reply’s id, and the app shows your answer in place of the command, labelled with it. Without reply_to everything looks as before. If the user wrote /info in the reply with id 312:
{
"title": "Version 1.39.0",
"body": "Everything is up to date.",
"idempotency_key": "refactor-7-info-1",
"thread_id": "refactor-7",
"reply_to": 312
}reply_to requires thread_id, and the reply must be the user’s own in that same thread. Otherwise the call fails with the tool error reply_to_invalid and nothing is sent. Several messages may answer the same command. All rules in the API reference.
Ask, wait and continue
Compatible clients negotiate MCP automatically. These curl examples use the supported 2025-11-25 protocol for a manual smoke test.
curl https://api.pliing.app/mcp \
-H "Authorization: Bearer $PLIING_MCP_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "pliing_ask",
"arguments": {
"title": "Should I continue?",
"body": "The tests passed. Should I deploy build 42?",
"choices": [
{
"value": "continue",
"label": "Continue"
},
{
"value": "cancel",
"label": "Cancel"
}
],
"idempotency_key": "build-42-question",
"context": "build-42",
"expires_in_seconds": 900
}
}
}'The tool result contains this object in structuredContent:
{
"request_id": "94876911-92e1-4fa2-bb9c-a57018dc0af0",
"status": "pending",
"answer": null,
"context": "build-42",
"expires_at": "2026-10-21T12:15:00+00:00",
"answered_at": null,
"poll_after_seconds": 5
}The recipient opens the notification in Pliing and taps a choice, or writes an answer when the question allows it. Fetch the answer in a later MCP call:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pliing_get_response",
"arguments": {
"request_id": "94876911-92e1-4fa2-bb9c-a57018dc0af0"
}
}
}When status is answered, answer contains the selected value and label, for example {"value":"continue","label":"Continue"}. A written answer has the form {"type":"text","text":"My suggestion"}. Continue only according to the explicit answer and the host’s own approval rules. Poll pending requests no more often than every five seconds. Stop polling when answered, closed or expired.
Close a question
Call pliing_close_question with the question’s request_id when the decision was made elsewhere. The optional reason (one line, at most 160 characters) appears in the app. The receipt gives status (closed, answered or expired), closed_at and close_reason. Retrying returns the same receipt. Stop polling when poll_after_seconds is null.
Replace an earlier question
Pass replaces_request_id to pliing_ask. It names a pending question from pliing_ask in the same thread and recipient scope. Pliing creates the new question and closes the old one together. If the earlier answer, closure or expiry won, the tool returns an error. See replacement rules.
Resume after a restart
Use pliing_list_questions to find questions, optionally by thread_id and status. Keep next_after from the first page and pass it in after to recover any missed answers, closures and expiries. The next call uses the same thread filter and omits status and cursor. The list includes masked request metadata, while retrieving masked text still uses pliing_get_response. Older questions with ambiguous REST or MCP origin can be recovered with the project’s REST key.
Images and choices in one question
Include one or more <img> tags in the body of pliing_ask. The pictures and the choice buttons appear in the same message; no separate notification is needed.
- External pictures must use HTTPS, be reachable by the recipient's device without signing in, and be at most 200 KB each.
- Pictures hosted by Pliing can be up to 2000 KB. They are uploaded as WebP with a regular project key (Pictures in messages); the MCP key cannot upload by itself.
- Written answer: set
allow_text: true. Both a button answer and a written answer are read withpliing_get_response. - Include choices unless you know the recipient has a current app. An older app shows only the choices, so a question without choices cannot be answered there and ends as
expired. - Ordinary conversation replies also need
thread_idandallow_replies: true, and are read separately withpliing_get_replies.
{
"title": "Which design?",
"body": "See the preview: <img src=\"https://example.com/design.webp\" alt=\"Design\">",
"choices": [{"value": "yes", "label": "Use this"}, {"value": "no", "label": "Try again"}],
"allow_text": true,
"idempotency_key": "design-42-choice",
"thread_id": "design-42",
"allow_replies": true
}Several questions at once: pliing_ask_cards
Include a self-contained page in cards[].embed.html and a summary in body. A report without questions returns informational and needs no polling. HTML report example.
When the assistant needs answers to several things, pliing_ask_cards sends them as one card deck. The user goes through the cards, picks on each and submits everything together, instead of getting five notifications in a row. The cards have the same fields as in the REST API, see The fields of a card.
{
"title": "Three choices before I continue",
"body": "I need answers to three things.",
"idempotency_key": "refactor-7-cards",
"thread_id": "refactor-7",
"cards": [
{"id": "scope", "title": "How much should I take now?",
"choices": [{"value": "all", "label": "All 14 modules"}, {"value": "payment", "label": "Payment only"}]},
{"id": "tests", "title": "Should I write new tests?",
"choices": [{"value": "yes", "label": "Yes"}, {"value": "no", "label": "No"}]},
{"id": "notes", "title": "Anything I should know?", "allow_text": true, "optional": true}
]
}
The result has request_id, status (pending, submitted or expired), answers, expires_at, submitted_at and poll_after_seconds. Read the answers with pliing_get_response and the same request_id:
{
"request_id": "9f1c6a52-7f0e-4a5b-b0a4-1e2d3c4b5a69",
"status": "submitted",
"answers": [
{"card": "scope", "value": "payment", "label": "Payment only"},
{"card": "tests", "value": "yes", "label": "Yes"},
{"card": "notes", "text": "Do not touch the invoice module."}
],
"context": null,
"expires_at": "2026-11-11T09:36:00+00:00",
"submitted_at": "2026-11-10T09:41:07+00:00",
"poll_after_seconds": null
}
The deadline is 24 hours by default; choose 60 seconds to 30 days with expires_in_seconds. Pending or expired is never approval, and a choice on a card is input to that question only.
Link cards
pliing_notify and pliing_ask accept link_preview with url, title and optional description and image_url. The sender supplies the metadata; Pliing does not visit the page. See link cards in the API reference.
From API 1.50.0 pliing_notify and pliing_ask also take embed.html, and pliing_ask_cards takes link_preview, so one message can have text, pictures, an HTML page, a link card and a question at once. On cards with allow_text the user may attach pictures and their location; fetch each images[].url with the MCP key.
Secret answers
Set both allow_text: true and secret_input: true on pliing_ask. The current app masks the answer. The first pliing_get_response or successful webhook receives and deletes the value; later reads cannot return it. The receiving client must protect the value and its logs. See storage, expiry and failures.
Response status and free text
pliing_get_response returns one of three outcomes in structuredContent. pliing_ask also returns notification_id and duplicate. Keep the same request_id throughout the question.
| Status | Content | Next step |
|---|---|---|
pending | answer: null, answered_at: null, poll_after_seconds: 5 | Wait at least poll_after_seconds before polling again. |
answered | answer: {value, label} or answer: {type: "text", text}, answered_at, poll_after_seconds: null | Process the explicit answer and stop polling. |
expired | answer: null, answered_at: null, poll_after_seconds: null | Stop polling. If needed, ask a new question with a new idempotency key. |
{
"request_id": "94876911-92e1-4fa2-bb9c-a57018dc0af0",
"status": "answered",
"answer": {
"value": "continue",
"label": "Continue"
},
"context": "build-42",
"expires_at": "2026-10-21T12:15:00+00:00",
"answered_at": "2026-10-21T12:02:30+00:00",
"poll_after_seconds": null
}Free text in the same thread is retrieved with pliing_get_replies and a separate after cursor. An ordinary thread reply does not set the question to answered; the user must tap a button or send text in the question’s own answer field. Empty data means no new free-text replies are available, not that the question was approved. The project can also receive the answers through a webhook (question.answered and reply.created); the AI client is not restarted automatically.
Message bodies and free-text replies support bold, italic, code and tables. Send the content as ordinary text with simple Markdown.
Wait for free-text replies
Add wait to pliing_get_replies to let the call wait for a reply instead of asking repeatedly: an integer from 0 to 30 seconds, default 0. If replies after after already exist, they are returned at once. Otherwise the call waits until a reply arrives, or until the time is up. Then data is empty and next_after is unchanged.
{"name":"pliing_get_replies","arguments":{"thread_id":"refactor-7","after":311,"wait":25}}
- Call again immediately after every response, also an empty one, with
next_afterasafter. Withwaitabove 0,poll_after_secondsis 0; withoutwaitit is 5. - Use a client timeout of at least 35 seconds. On HTTP 429: follow
Retry-After. - A key may have five waiting calls at once, and each counts as one call in the rate limit.
- If consent is withdrawn while the call waits, it ends with
consent_required. An invalidwaitreturns an ordinary tool error (isError: true).
Location, audio and pictures in replies
A reply from pliing_get_replies has the same fields as in the REST API, see The fields of a reply: location, audio and transcript, and images with up to five pictures.
- Location: the recipient can attach a position to a thread reply or a button answer when the project has been given the location permission. The answer then has
locationwith latitude, longitude, accuracy and time; otherwise the field isnull. Written answers to the question itself are sent without location. Read more under Location in replies. - Audio and pictures: the addresses in
audio.urlandimagesare under/v1/mcp/replies/{id}/…and are fetched with the MCP key inAuthorization. The address alone gives no access, and consent is checked on every download. Read more under Voice replies and Pictures in replies.
Activity status in a thread
pliing_activity shows a temporary status at the bottom of an existing thread while the assistant is working. It causes no push, sound or unread mark, and does not replace messages.
{"name":"pliing_activity","arguments":{"thread_id":"refactor-7","state":"thinking","label":"Running the tests …","ttl_seconds":120}}
state:thinkingshows the status,idleremoves it.label(optional): up to 100 characters without line breaks. Without text the app shows “thinking …”.ttl_seconds(optional): 10–300, default 120. A newthinkingcall renews the time and can change the text.
The status disappears on idle, when the time is up, or when a new message arrives in the thread. A successful call returns {"ok":true}.
Limits and important behavior
- Access: one key grants access to one project and one approved recipient. It cannot read the inbox, retrieve codes, manage accounts, send to another recipient or answer its own questions. Revocation and subscription rules still apply.
- One answer per question: a button or written text of up to 2000 characters. The same answer may be repeated; a different answer returns 409. An unanswered expired question returns 410.
- Expiry: questions expire after 15 minutes by default; choose 60–86400 seconds with
expires_in_seconds. Questions and card decks are sent as Time Sensitive notifications on Apple devices and are not pushed after their deadline. Answered questions keep their answer until the notification is removed by normal retention or account deletion. - Retries: reuse the same
idempotency_keyand arguments. Changed content or expiry is a conflict. - Lengths:
idempotency_key8–128 letters, digits or_.:-; choice values 1–64 of the same characters; labels 1–30 characters; title 160; body 4000; free-text replies 2000. - Rate limit: 60 MCP requests per minute per key, including polling and tool discovery. Honor HTTP 429 and
Retry-After. Validation and business failures useisError: true; access failures use HTTP 401/403. - Nothing happens by itself: the choices appear in the app and when the recipient expands the push notification. A tap records an answer; Pliing does not run commands, deploy changes or bypass the AI client's approval rules. Pending or expired questions never resume work automatically, and whether work resumes after an answer depends on the AI client.
- Content: use Norwegian or English for the recipient's text and labels. Avoid secrets and full conversation transcripts.
- Browser clients: must use an allowed
Origin. Native clients normally do not sendOrigin.