docs

Connect xpost to Claude Code

One command adds the connector; /mcp signs you in. After that Claude Code can draft and publish posts from inside the project you're working in — a release note written from the diff you just committed, say — and every post still passes your brand guardrails and, in copilot mode, waits for your approval.

Set it up

  1. 1

    Add the connector

    Run this where you use Claude Code. It registers xpost for that project; add --scope user to have it everywhere.

    claude mcp add --transport http xpost https://xpost.to/api/mcp
  2. 2

    Sign in with /mcp

    Type /mcp inside Claude Code, choose xpost, and it opens your browser on our sign-in page. Pick which project it may post to and press Allow. The terminal picks the connection up as soon as you come back.

    No key goes in the command. If you would rather not sign in through a browser at all — CI, a container, a remote box — use a key instead:

    claude mcp add --transport http xpost https://xpost.to/api/mcp \
      --header "Authorization: Bearer xp_live_YOUR_KEY"

    Make that key under Project → AI agent → Keys. Treat it like a password: it reaches this project and nothing else, but it needs no browser and no person.

How to know it worked

/mcp lists xpost as connected, and its tools appear when you ask for something it covers. On our side, look under Project → AI agent → Keys: a row saying “connected by signing in”, or the key you made.

Whatever the assistant drafts goes through the same path as a post you write yourself: brand guardrails run on every one, and in copilot mode it lands in Approvals and waits for you. An assistant can never approve its own post. The connection shows up under Project → AI agent → Keys as “connected by signing in”, with a Disconnect button that ends it immediately.

What to ask it

  • Using xpost, list the accounts I can post to.
  • Write a short release note from the commits since the last tag and post it to LinkedIn and X.
  • Schedule that for tomorrow at 9am instead.
  • Show me the delivery receipt for the last post.

When nothing happens

/mcp shows xpost as failed

Almost always the address. It must be https://xpost.to/api/mcp — with /api/mcp on the end, and --transport http in the command. Remove it with claude mcp remove xpost and add it again.

It asks to sign in on a machine with no browser

Use the keyed form in step 2. A headless box cannot complete the sign-in, and there is nothing to be done about that from our side.

401 Unauthorized on every call

The key was revoked or replaced. Keys are listed under Project → AI agent → Keys; replacing one there breaks everything using the old one, by design.

Also worth reading

The agent skill teaches Claude Code how to use these tools well — what to do with a post held for approval, and what a guardrail refusal means. Also every tool the connector offers, and the REST API at https://xpost.to/api/v1.