Claude Code + PostNinja

Schedule Social Media Posts with Claude Code

Add PostNinja to Claude Code with a single command, then ask it to plan your week, write launch posts from your changelog, or schedule a thread straight from your repo. Posts go out on time even after you close the terminal.

  • Connect once with an API key
  • Draft, schedule and publish by asking
  • 7 platforms: X, Instagram, TikTok, Facebook and more

Setup

How do I connect PostNinja to Claude Code?

  1. 1

    Create an API key

    In PostNinja, go to Settings → API and create a key. It starts with pn_ and is shown once, so copy it somewhere safe.

  2. 2

    Add PostNinja to Claude Code

    Run this in your terminal. Add --scope user to make it available in every project.

    Terminal
    claude mcp add --transport http postninja https://postninja.app/api/mcp \
      --header "Authorization: Bearer pn_YOUR_KEY"

    .mcp.json in your project

    Or share it with your team in .mcp.json (reads the key from your environment)
    {
      "mcpServers": {
        "postninja": {
          "type": "http",
          "url": "https://postninja.app/api/mcp",
          "headers": { "Authorization": "Bearer ${POSTNINJA_API_KEY}" }
        }
      }
    }

    Replace pn_YOUR_KEY with a key from Settings → API.

  3. 3

    Just ask

    Claude Code finds the PostNinja tools on its own. Try:

    • “Read CHANGELOG.md and schedule a launch post for tomorrow at 9am on X and Threads, with a shorter X version.”
    • “Turn this blog post into a 5-post X thread and schedule it for Thursday at noon.”
    • “What's scheduled this week? Move anything on Friday to Monday morning.”

Tools

What can Claude Code do with PostNinja?

Write and schedule

Drafts posts, gives each platform its own text, and schedules them for any date and time.

Threads and Stories

Builds multi-post X threads and posts photos or videos as Instagram Stories.

Check what's planned

Lists upcoming posts, drafts and what went out, with links to the live posts.

Fix and reschedule

Moves, edits or deletes drafts and scheduled posts when plans change.

Add images

Uploads images to attach to posts. Larger files and video go through the REST API.

Spot failures

Reads each account's status and error, so it can tell you what didn't go out and why.

One connection, seven platforms

Connect your accounts in PostNinja once. From then on Claude Code can post to any of them, and PostNinja publishes at the time you set.

FAQ

Claude Code and PostNinja questions

How do I check that Claude Code is connected?

Run /mcp inside Claude Code. postninja should be listed as connected, with tools like list_accounts and create_post.

Can I keep the API key out of my repo?

Yes. Use the .mcp.json version, which reads POSTNINJA_API_KEY from your environment, and keep the key in your shell profile or a secrets manager.

Does Claude Code post without asking me?

That depends on Claude Code's own settings; most ask before each tool call. If you'd rather review everything, ask it to save posts as drafts, then schedule them from the PostNinja calendar.

Is my API key safe?

PostNinja only stores a hash of each key and shows its first characters so you can tell keys apart. A key works for one workspace, and you can revoke it any time under Settings → API.

Which platforms can Claude Code post to?

Every account you've connected: X, Instagram, Threads, Facebook Pages, TikTok, YouTube Shorts and Pinterest.

Do posts scheduled by an AI agent cost extra?

No. They're ordinary posts on your plan. As always, X posts use credits (10 each, 80 with a link) because X charges for every post; other platforms are unlimited.

Works with other AI agents too

Let Claude Code run your social media.

Connect Claude Code to PostNinja in a couple of minutes. Plans from $15 a month.