Cover for Threads MCP Setup and Fixes for Claude Code, Muse and More

Threads MCP Setup and Fixes for Claude Code, Muse and More

Set up a Threads MCP server for Claude Code, Cursor or Codex in two minutes, then fix the six Threads rules behind most refused posts.

Nov 4, 20264 min readAlexandroAlexandro
Table of Contents

A Threads MCP server lets Claude Code, Cursor, Codex or another agent like Muse or OpenClaw publish to your Threads account: text, photos, videos and carousels. With PublishQ it takes two steps. Connect Threads in PublishQ, then add the server to your agent:

claude mcp add --transport http publishq https://publishq.com/mcp

Approve it in the browser, and "post this photo to Threads with the topic photography" works on the first try. When a post does get refused, it's almost always one of the six Threads rules further down, and each one has a one-line fix.

set up the threads mcp server in claude code

Two minutes of setup

  1. Connect your Threads account in PublishQ.
  2. Add the server to your client. Claude Code is the command above. Cursor takes {"mcpServers": {"publishq": {"url": "https://publishq.com/mcp"}}} in ~/.cursor/mcp.json. Codex takes codex mcp add publishq -- npx -y @publishq/mcp@latest after npx @publishq/cli@latest login.
  3. Ask your agent: "List my Threads accounts." If it answers with your handle, you're done.

Each client has its own page with prompts that suit it: Claude Code, Cursor and Codex.

What a post looks like

{
  "content": "Shot this on the way home. Same lens, different light.",
  "mediaIds": [
    "dddd4444-eeee-5555-ffff-666677778888",
    "eeee5555-ffff-6666-aaaa-777788889999"
  ],
  "accounts": [
    {
      "accountId": "ffff6666-aaaa-7777-bbbb-888899990000",
      "platformSpecificSettings": { "topicTag": "photography" }
    }
  ],
  "publishNow": true
}

Two photos make it a carousel. A Threads carousel takes 2 to 20 items, and it can mix photos and videos. The only Threads-specific setting is topicTag.

threads carousel post from an ai agent

The six Threads rules behind most refused posts

What happenedWhyThe fix
Text is too longThreads allows 500 charactersKeep the long text for LinkedIn and give Threads a short version with postOverrides
Short text still too longEmojis count as several characters (🚀 counts as 4)Trim a few emojis, or count before you send
Topic tag refusedA topic is 1 to 50 characters with no . or &Send nodejs, not node.js, and leave out the #
Carousel refusedA carousel needs at least 2 itemsSend one item as a single photo or video post instead
Video refusedThreads takes videos up to 5 minutes and 1 GBTrim it, or post the full cut to YouTube and a clip to Threads
Wrong link previewThreads previews the first URL in the textPut the link you want previewed first

When Threads refuses a post, the error your agent gets back names the rule, so it can usually fix the post and try again by itself.

Posting the same thing to Threads and other platforms

Threads posts are often a short version of something you wrote elsewhere. Put your LinkedIn, X and Threads accounts in one publishq_create_post call and let postOverrides give each one its own text. One call, one entry in your calendar, three posts. The Threads scheduler shows them next to everything else you've queued, and the Threads post previewer shows how a post will look before it goes out.

post to threads linkedin and x in one call

For visual posts, the Threads carousel generator designs the slides, and the Instagram MCP guide shows how to post the same carousel to Instagram.

Reference

Setup in Muse, OpenClaw and other agents

The six rules above apply in every agent. The setup for each one is on its own page:

For an agent that isn't listed, open publishq.com/agents and copy the line at the top of that page into your agent. It reads the page, sets itself up, and gives you a link to approve the login in your browser.

Create a PublishQ account, connect Threads, and ask your agent to list your accounts.

Frequently Asked Questions

Direct answers extracted from this article.

Yes. Connect Threads in PublishQ, add https://publishq.com/mcp to Claude Code, approve it in your browser, and Claude Code can publish text, photos, videos and carousels to Threads.
The usual causes are text over 500 characters (emojis count as several characters), a topic tag with a dot or an ampersand, a carousel with only one item, or a video over 5 minutes. The error names the rule.
Set topicTag on the Threads account entry, without the # sign. A topic is 1 to 50 characters and can't contain a dot or an ampersand.
Yes. A Threads carousel takes 2 to 20 items, and photos and videos can be mixed in the same carousel.
Start for Free

No credit card required • Set up in under 3 minutes