Run opencode mcp auth pubnio, or run /mcps inside OpenCode and select pubnio.
Your browser opens PubNio sign-in; approve the workspace.
Connect your X account
Open PubNio, choose your workspace, and go to Accounts. Use the same workspace when you sign in from OpenCode.
Connect the X account you want to post from in PubNio and confirm it is ready.
Open the repository containing your changelog in OpenCode.
Review the current X pass-through estimate in PubNio before approving.
Make sure your workspace has enough prepaid credit for the estimated X fees.
Check the destination
Read-only destination check
List the X accounts in my PubNio workspace and show which are ready to publish. Do not create, schedule, or publish posts.
Turn your changelog into an X thread
Paste the prompt into OpenCode. It runs the job through PubNio's search and execute tools, as in the Code Mode flow below. Contract example: sample IDs and URLs. The request and both responses decode against PubNio's API schemas; no provider confirmed this post.
Read CHANGELOG.md and draft a short X thread with an opener and two replies. Keep each post within 280 characters. Show the destination account and every post. Validate the thread with PubNio to get the publishing fee estimate, including X pass-through fees, and wait for my approval. If validation is blocked or the cost is unavailable, stop. After approval, publish once, then read the delivery and return the thread’s opening-post link.
search-> find the validate-post, create-post, and read-post operations
execute-> validate post { text: "…", publishNow: true, targets: [ { accountId: "…", provider: "x", placement: "feed", settings: { thread: [ "Set a recurring schedule once for each account.", "Add a post to the queue and check delivery when it goes live." ] } } ] }
=> { canPublish: true, billing: { xPublishes: 3, estimatedCost: "…", blocked: null } }
show the estimate and wait for approval
execute-> create post { text: "…", publishNow: true, targets: [ { accountId: "…", provider: "x", placement: "feed", settings: { thread: [ "Set a recurring schedule once for each account.", "Add a post to the queue and check delivery when it goes live." ] } } ] }
Idempotency-Key: opencode-x-weekly-queues-thread
=>202 { postId, targets: [x/feed: queued] }
execute-> read post, sleep 1s between checks, within the 30s budget
=> { status: "published", url: "https://x.com/i/web/status/1234567890" }
{
"postId": "00000000-0000-4000-8000-000000000002",
"isDraft": false,
"revision": 1,
"scheduledAt": null,
"text": "Weekly queues are here. Here’s what changed.",
"media": [],
"targets": [
{
"accountId": "00000000-0000-4000-8000-000000000001",
"provider": "x",
"placement": "feed",
"settings": {
"thread": [
"Set a recurring schedule once for each account.",
"Add a post to the queue and check delivery when it goes live." ]
}
}
],
"deliveries": [
{
"targetId": "00000000-0000-4000-8000-000000000003",
"attemptId": "00000000-0000-4000-8000-000000000004",
"accountId": "00000000-0000-4000-8000-000000000001",
"provider": "x",
"placement": "feed",
"canRetry": false,
"canReconcile": false,
"revision": 1,
"status": "published",
"providerRef": {
"id": "1234567890",
"kind": "post" },
"url": "https://x.com/i/web/status/1234567890" }
],
"status": "published",
"createdAt": "2026-12-04T07:20:00.000Z",
"updatedAt": "2026-12-04T07:20:18.000Z"}
Turn your changelog into an X thread
Check delivery and get the link
If delivery is still pending, keep the PubNio post ID and check the same post. A published delivery with a provider reference confirms the result.
Review the validation estimate before any publish request.
Save the PubNio post ID after admission.
Check the existing delivery until it confirms and returns the opening-post URL.
Open the thread to check the replies. If submission is unresolved, reconcile the existing target before trying again.
From approval to delivery
Illustrative conversation and result with sample data.
OpenCode
I’ve drafted an opener and two replies for @example. Here are all three posts and the PubNio estimate, including the X API fee for each write.
You
I’ve reviewed the thread, destination, and estimated fees. Publish it once.
OpenCode
PubNio accepted the thread. I checked the original delivery and got the confirmed link to the opening post.
Example delivery result
Status
published
Destination
@example · three-post X thread
Sample URL
https://x.com/i/web/status/1234567890
X rules OpenCode runs into
Account kinds: social account. Connection scopes: tweet.write.
X placements from the capability catalog
Placement
Media types
Max per target
Caption limit
feed (default)
image, video
4
280
This walkthrough uses a text-only feed target.
A feed post takes up to 4 images or videos.
Put the opening text in the post body and the replies in the target’s thread settings.
Keep each post to 280 characters.
If you add URLs, review the new estimate. X charges can vary with the content of each write.
Failures and recovery
Match the error before asking OpenCode to retry.
X (Twitter) publishing failures and safe retry behavior
Code
Cause
Fix
Retry
account_not_ready
The connected account's OAuth token is expired, revoked, or disconnected.
Reconnect the account in the PubNio workspace, then re-validate.
After reconnect
empty_content
Neither text nor media was provided for a target that requires content.
Add caption text or attach a ready media ID.
No
caption_too_long
Text exceeds the destination placement's character limit (caption.limit).
Shorten the caption or add a shorter target-specific text override.
No
insufficient_credit (billing, 402)
Prepaid credit cannot cover the publish, including X pass-through fees.
Top up credit or upgrade the plan.
After a top-up
spend_cap_reached (billing, 402)
The publish would pass the workspace's monthly spend cap.
Raise the monthly spend cap in billing settings.
After raising the cap
OpenCode setup problems
Calls start failing with 401.
Run opencode mcp auth pubnio again to renew the PubNio sign-in.
OpenCode does not list pubnio in /mcps.
Check that the entry is under mcp.servers with type remote in opencode.json.
Writes fail with 403 read_only_mode.
PubNio returns 403 read_only_mode when the server URL ends in ?readOnly=1. Point the entry at https://pubnio.com/mcp to allow writes.
OpenCode quirks
You can sign in from the CLI (opencode mcp auth pubnio) or from /mcps inside a session.
A remote server needs type remote under mcp.servers; a bare url entry is not enough.
What it won't do
Waive X API fees ($0.015 a post, or $0.20 with a link). They pass through on every plan.
Publish when prepaid credit cannot cover the estimated X fees.
Post identical copy again. X rejects duplicates, so check the existing delivery first.
Connect accounts, create API keys, or manage webhooks from an MCP session that uses an API key. Those operations need a person signed in, so connect the MCP server with browser OAuth or use the PubNio web app.
Stream binary uploads through execute. Import media from an HTTPS URL, or send a file of up to 8 MiB inline as base64.
Run one execute call past 30 seconds or past its request limit. The script returns the post ID so the next call can check it.
Frequently asked questions
Can OpenCode turn release notes into an X thread?
Yes. Use the X feed placement with opening text and ordered replies, then approve the prepared thread.
What does it cost to publish an X thread?
Validate the thread for PubNio’s current estimate. X API create fees are separate, and a thread contains multiple writes.
Which link does PubNio return?
The confirmed X delivery links to the opening post. Open that link to review the thread.
Should I resubmit if OpenCode stops waiting?
Save the PubNio post ID and recheck the same delivery. If the outcome is unresolved, reconcile before retrying.
Where does OpenCode keep the PubNio server?
In opencode.json under mcp.servers.pubnio with type remote and url https://pubnio.com/mcp. opencode mcp add writes it for you.
Can I sign OpenCode in without leaving the session?
Yes. Run /mcps, select pubnio, and approve the workspace in your browser.
Connect unlimited accounts at $0 per account. Pay as you go includes 50 free confirmed publishes a month on your first workspace, then $20 per 1,000. X API fees are separate.
Contract example: sample IDs and URLs. The request and both responses decode against PubNio's API schemas; no provider confirmed this post. A 202 response includes the post ID and initial delivery status. Use the settled status to confirm publishing.
POST /api/v1/posts?workspaceId=00000000-0000-4000-8000-000000000006Authorization: Bearer pn_live_***
Idempotency-Key: opencode-x-weekly-queues-thread
Content-Type: application/json
{
"text": "Weekly queues are here. Here’s what changed.",
"publishNow": true,
"targets": [
{
"accountId": "00000000-0000-4000-8000-000000000001",
"provider": "x",
"placement": "feed",
"settings": {
"thread": [
"Set a recurring schedule once for each account.",
"Add a post to the queue and check delivery when it goes live." ]
}
}
]
}