How to schedule social media posts from Claude Code or Cursor

By PublishBuddy TeamUpdated on 4 min read

Short answer

Connect PublishBuddy's MCP server to Claude Code or Cursor with an API token, and your assistant can draft, schedule and check your social posts. Setup is one command in Claude Code, or a few lines of JSON in Cursor. It needs a Pro or Business plan, and the 14-day trial works.

Key points

  • Create an API token with the MCP (AI clients) ability in PublishBuddy. You see it once, so store it safely.
  • Claude Code needs one claude mcp add command. Cursor needs a short .cursor/mcp.json file.
  • Your assistant gets more than 40 tools for profiles, posts, scheduling, analytics and media.
  • New posts start as drafts. Scheduling is a separate step, and your client asks before each tool unless you allow it.
  • Most tools cost no AI credits. The server takes 60 requests a minute per user.

What MCP gives your assistant

MCP (Model Context Protocol) is the standard way AI assistants call tools in other apps. PublishBuddy runs an MCP server at https://api.publishbuddy.com/mcp. Connect Claude Code or Cursor to it, and your assistant can work in your PublishBuddy workspace the way you would.

It can list your connected accounts, write and save posts, and schedule them or add them to a queue. It can also read your analytics and make images. You ask in plain English. It picks the tools.

It's handy when you already live in your editor. Ship a feature, then ask for a launch post on LinkedIn and X without opening another tab. Or pull last month's numbers into the report you're already writing.

What you need

  • A PublishBuddy account on Pro or Business. The 14-day trial works, and it needs no credit card.
  • At least one connected social account.
  • Claude Code or Cursor. The same setup also works in VS Code, Windsurf and Claude Desktop. See Connect an MCP client.

Step 1: Create an API token

  1. Sign in at app.publishbuddy.com.
  2. Click your avatar, choose User Settings, then open Login & Security.
  3. Under API Keys, click Generate API Key. Name it, for example claude-code.
  4. Tick the MCP (AI clients) ability. Only tick the REST abilities if the same token will also call the public API.
  5. Copy the token. You only see it once.

Keep it in a password manager or an environment variable. The examples below read it from PUBLISHBUDDY_TOKEN:

export PUBLISHBUDDY_TOKEN="your-token-here"

Step 2: Add the server to Claude Code

Run one command:

claude mcp add --transport http publishbuddy https://api.publishbuddy.com/mcp \
  --header "Authorization: Bearer $PUBLISHBUDDY_TOKEN"

That saves the server in your user config, so it's there in every project.

Want it in one repo only? Add a .mcp.json file to the repo root instead:

{
  "mcpServers": {
    "publishbuddy": {
      "type": "http",
      "url": "https://api.publishbuddy.com/mcp",
      "headers": {
        "Authorization": "Bearer ${PUBLISHBUDDY_TOKEN}"
      }
    }
  }
}

Anyone who clones the repo gets this file, so keep the token in the environment variable, never in the file itself.

Step 2 (Cursor): add the server to Cursor

Create .cursor/mcp.json in your project, or ~/.cursor/mcp.json to use it in every project:

{
  "mcpServers": {
    "publishbuddy": {
      "url": "https://api.publishbuddy.com/mcp",
      "headers": {
        "Authorization": "Bearer your-token-here"
      }
    }
  }
}

If the project folder is in git, use the global file or add .cursor/mcp.json to .gitignore, so the token never gets committed.

Step 3: Check that it works

Ask your assistant:

List my PublishBuddy profiles.

It should call list_profiles and reply with your connected accounts. Most clients ask permission before they run a tool for the first time. Say yes. You can allow the read-only tools for good, so you're only asked when something changes.

What to ask it

Here are requests that work well:

  • "Draft a LinkedIn post about the release notes in CHANGELOG.md and schedule it for Tuesday at 9 am. Ask me before scheduling."
  • "Show me my top 5 Instagram posts from the last 30 days, then draft a post in the same style for Thursday at 7 pm."
  • "Add these four tips to my X queue, one post each."
  • "Upload launch.png from this folder and attach it to the draft."
  • "How did my Facebook Page do this month compared with last month?"

For the upload, the assistant asks PublishBuddy for a short-lived upload link and sends the file there with curl. The file lands in your media library, ready to attach.

Under the hood, a scheduling request usually runs three tools in a row: get_top_posts or a similar read, then create_post, which saves a draft, then schedule_post or add_post_to_queue. The full list of more than 40 tools is in the tool reference.

What stops a post going out by mistake

  • New posts are drafts. create_post never publishes anything. Scheduling, queueing and publishing are separate tools.
  • Your client asks first. Claude Code and Cursor ask before running a tool, unless you've allowed it for good.
  • The token has your permissions, no more. A team member who can only save drafts in the dashboard can only save drafts over MCP. They also see only the accounts they see in the app.
  • One workspace at a time. Requests go to the workspace you last used in the dashboard. Pin a client to a workspace with an X-Workspace-Id header.

What it costs

MCP access comes with Pro and Business. Most tools cost no AI credits. The ones that run an AI model do:

ToolAI credits
Reading posts, analytics, scheduling, publishing0
get_top_posts1
generate_image or edit_image17
AI Studio images and videosThe model's price, which quote_media shows first

Credits come from the same pool as the in-app AI Agent: 500 a month on Pro and 2,500 on Business. The server takes up to 60 requests a minute per user.

If something goes wrong

What you seeWhat it means
401, or the server shows as disconnectedThe token is wrong, revoked or missing from the header. Copy it again.
402 when you connectThe workspace's plan doesn't include MCP. It needs Pro or Business.
403 "missing a required ability: mcp"The token was made without the MCP ability. Make a new one with it ticked.
403 "No workspace context"Open the dashboard once to set an active workspace, or send X-Workspace-Id.
429More than 60 requests in a minute. Wait and try again.

MCP or the REST API?

Use MCP when a person is doing the work through an assistant, like planning a week of posts in one conversation. Use the REST API when code does the work on its own, like a pipeline that posts from your CMS every night. Both use the same tokens and follow the same plan limits. More on the MCP page.

Frequently asked questions

Which plans include MCP access?

Pro ($29 a month) and Business ($49 a month), plus the 14-day free trial. The Free plan has no MCP access, and the server answers a Free workspace with a 402 error.

Can my AI assistant publish a post without asking me?

Creating a post through MCP only makes a draft. Scheduling, queueing and publishing are separate tools, and Claude Code and Cursor ask before running each tool unless you've told them not to. The token also can't do more than your user can do in the PublishBuddy dashboard.

Does it work with ChatGPT?

Yes. ChatGPT and Claude sign in with OAuth: you add PublishBuddy's server URL as a custom connector, and it sends you to PublishBuddy to approve the connection. There's no token to copy. Claude Code, Cursor, VS Code, Windsurf and Claude Desktop use an API token, as this guide shows.

Can I post to a different workspace?

Requests go to the workspace you last used in the dashboard. To pin a client to another one, add an X-Workspace-Id header with that workspace's ID. Set the server up twice under different names to switch between two workspaces.

Is this the same as the AI Agent inside PublishBuddy?

It uses the same tools. The AI Agent in the dashboard is itself a client of this MCP server. Connecting Claude Code or Cursor gives your own assistant those tools, with your user's permissions.

Written by

PublishBuddy Team

The team that builds PublishBuddy, a social media management tool with a built-in AI agent.

Schedule from your editor

MCP access comes with Pro and Business. Start the 14-day trial, create a token and connect Claude Code or Cursor in a few minutes.

Try PublishBuddy free

14-day free trial. No credit card required.

Planning and workflow

How to build a social media content calendar

Build a social media content calendar in five steps: themes, a posting rate per network, one weekly batch, scheduling and a short review.

6 min read