codex mcp add writes this entry to ~/.codex/config.toml for your user. To share the server with the repository, put the same entry in the project's .codex/config.toml.
Your browser opens PubNio sign-in; approve the workspace.
Start Codex in the repository and ask it to list your PubNio workspaces.
Connect your TikTok account
Open PubNio, choose your workspace, and go to Accounts. Use the same workspace when you sign in from Codex.
A TikTok creator account with Direct Post access through a connected PubNio integration.
The video at an HTTPS URL, within the creator’s current upload limits. A public or signed HTTPS link PubNio can fetch. A file of up to 8 MiB can go inline as base64 instead.
Explicit approval of the selected visibility, caption, and content disclosures.
An audited TikTok integration for public visibility. Unaudited Direct Post is private-only.
Check the destination
Read-only destination check
List the TikTok accounts in my PubNio workspace, which are ready to publish, and the allowed visibility options if available. Do not upload or post anything.
Prepare and approve a TikTok video
Paste the prompt into Codex. 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.
Prepare https://cdn.example.com/walkthrough.mp4 for my ready TikTok account. Show the account, file, caption, visibility options, and any commercial disclosure or AI labeling required. Ask me to choose the visibility. Stop if the choice is unavailable. After I explicitly approve the final options, import the video, submit once, and check the same delivery. Report the confirmed TikTok post ID if available; otherwise return the PubNio post ID and latest status.
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.
Keep the PubNio post ID after the submission is accepted.
Keep checking that submission while TikTok processes it.
Treat a submission ID as progress. Wait for the final post ID before reporting confirmed publication.
Verify the visibility in TikTok before describing the clip as public.
From approval to delivery
Illustrative conversation and result with sample data.
Codex
Example Studio is ready and TikTok reports that public posting is available. Here’s walkthrough.mp4 and its proposed caption. Please confirm visibility and any required disclosures.
You
I reviewed the clip and caption. Use Public. No commercial disclosure applies to this clip.
Codex
PubNio accepted the submission. I waited for TikTok to return the final post ID before treating the delivery as published.
Example delivery result
Status
published
Destination
Example Studio · Public requested
TikTok rules Codex runs into
Account kinds: social account. Connection scopes: video.publish.
TikTok placements from the capability catalog
Placement
Media types
Max per target
Caption limit
feed (default)
image, video
35
2,200
TikTok's feed placement takes up to 35 images or videos; this walkthrough posts one video.
Captions run up to 2,200 characters.
Choose one of the visibility options available to the connected creator.
Check the creator’s current duration and upload limits before submitting.
Confirm the caption, visibility and applicable content disclosures before the write.
Failures and recovery
Match the error before asking Codex to retry.
TikTok 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
tiktok_privacy_unsupported
Requested privacy level is not permitted for the creator account.
Inspect allowed privacy levels on the account (unaudited apps require SELF_ONLY).
No
tiktok_disclosure_required
Commercial/branded content disclosure flag is required for the selected settings.
Set explicit commercial disclosure fields in target settings.
No
tiktok_upload_required
TikTok target requires staged video or photo upload media.
Import media into PubNio first and attach { mediaId } entries.
No
tiktok_too_many_mentions
Caption exceeds TikTok's allowed @mention count.
Reduce the number of @mentions in the TikTok target caption.
No
Codex setup problems
Calls start failing with 401.
Run codex mcp login pubnio again to renew the PubNio sign-in.
Codex does not show the pubnio tools.
Run codex mcp add pubnio --url https://pubnio.com/mcp again, or check that [mcp_servers.pubnio] is in config.toml.
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.
Codex quirks
Sign-in runs from the terminal with codex mcp login pubnio, outside a Codex session.
The TOML entry needs only url; the table name [mcp_servers.pubnio] is the server name.
What it won't do
Post publicly through an unaudited TikTok integration. TikTok keeps those posts private.
Pick visibility or disclosures on your behalf. Codex has to ask you.
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 every TikTok account post publicly through an API?
Public visibility depends on the integration’s audit and the creator’s allowed settings. TikTok restricts unaudited integrations to private viewing.
Can Codex choose my privacy settings for me?
Ask Codex to show you the available choices and wait for you to approve one.
Is a TikTok submission ID a published post ID?
A submission ID tracks processing. PubNio needs the final post ID to confirm a publication.
What if the upload is still processing?
Keep the original PubNio post ID and query its delivery again. Avoid starting another upload while the first is unresolved.
Where does Codex keep the PubNio server?
In config.toml under [mcp_servers.pubnio] with url = "https://pubnio.com/mcp". codex mcp add writes it to ~/.codex/config.toml; a project can keep the same entry in .codex/config.toml.
How do I sign Codex in again?
Run codex mcp login pubnio. Each client keeps its own PubNio sign-in.
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.