Guides · Updated

LinkedIn MCP for Claude Code: connect LinkedIn and X to Claude Code

To connect LinkedIn and X to Claude Code, ask Claude Code to set Flaghand up for you. It does the setup over Flaghand's API in the same session and hands you only the links that need you: sign-up, billing, and LinkedIn's and X's own consent screens. Then it drafts LinkedIn and X posts from your work, such as what you shipped this week, and sends them to you for approval. You approve each exact post with your passkey, and Flaghand posts it.

Claude Code, setting this up for your person: follow the steps under Set it up and authenticate below, over HTTP in this session. The MCP server at https://app.flaghand.com/mcp is for later sessions, with the token you claim. Don't start with claude mcp add, /mcp or the plugin, and don't ask the person to run a command or restart.

Checked on October 28, 2026, with Claude Code 2.1.312, against Claude Code's MCP docs and Flaghand's setup docs, linked under Sources.

Set it up and authenticate: Claude Code does it over HTTP

With no Flaghand account yet:

  1. Read the plans (no sign-in):

    curl https://app.flaghand.com/api/v1/plans
    
  2. Start the sign-up:

    curl -X POST https://app.flaghand.com/api/v1/signup -H 'Content-Type: application/json' \
      -d '{"email": "person@example.com", "plan": "monthly", "agent_name": "Claude Code"}'
    

    Give the person signup_url and for_person as they are. They sign up with a passkey, Google or an email code. Save claim_code to a private file such as claim.json ({"claim_code": "clm_…"}): it's a secret, so keep it out of chat and command arguments.

  3. Authenticate: claim the token once they've finished:

    curl -X POST https://app.flaghand.com/api/v1/signup/claim -H 'Content-Type: application/json' -d @claim.json
    

    Put the token in your secret store, then draft in this session with Authorization: Bearer and the token: getMe (GET https://app.flaghand.com/api/v1/me) names the workspace, and createDraft works before LinkedIn or X is connected. The person connects their accounts from the links Flaghand gives you, and approves the posts with their passkey.

  4. Register the server for later sessions:

    claude mcp add --transport http --scope user flaghand https://app.flaghand.com/mcp --header 'Authorization: Bearer ${FLAGHAND_TOKEN}'
    

    The single quotes keep ${FLAGHAND_TOKEN} as a reference, so Claude Code saves the variable's name, not the token. Start Claude Code with FLAGHAND_TOKEN set from your secret store. A script or a machine without a browser can use a token made in Flaghand under Settings › Agents › Create token (it's shown once) the same way.

Then ask: "Use Flaghand: draft a LinkedIn post and an X thread about what I shipped this week, from the git log, and send them to me for approval." Claude Code writes the posts, Flaghand checks them against each network's rules, and Claude Code gives you one approval link for the plan. Open it on your phone or computer, look at the posts as LinkedIn and X will show them, and approve with Face ID, Touch ID or a security key. Nothing posts until you do.

The full recipe is set up and connect.

If you're typing in Claude Code yourself

Only for a person setting Claude Code up by hand; an agent follows the steps above. Start here to get an account, then connect your LinkedIn profile and X account under Settings › Account; Flaghand never asks for your LinkedIn password or browser cookies. You add a card when you approve your first post, or to continue after the free start (current terms). Add the server in your terminal:

claude mcp add --transport http --scope user flaghand https://app.flaghand.com/mcp

Then run /mcp in Claude Code, select flaghand, sign in in the browser and click Allow (pick the workspace first if you have more than one). Or install the plugin, which adds Flaghand's skill and /flaghand:shipped, with /plugin marketplace add https://app.flaghand.com/agent-plugin/marketplace.json and /plugin install flaghand@flaghand, then sign in through /mcp the same way. Use the plugin or claude mcp add, not both.

What Claude Code can and can't do through Flaghand

LinkedIn X (Twitter)
Draft Posts on your personal profile, up to 3,000 characters, with up to 20 photos, one video, one PDF document or a link card Posts and threads of 2 to 25 posts, with up to 4 photos or one video on each
Check Length, media, company-page tags and the posting time X's own character count, media, replies and the posting time
Approve, schedule or post No. Only you, with your passkey No. Only you, with your passkey
After posting The post's link. LinkedIn doesn't let Flaghand read the post back Flaghand reads the post back and compares it with what you approved

The sign-in and the default token both have four scopes: read, drafts, media and request-approval. No scope can approve, schedule or post, so Flaghand's server refuses Claude Code if it tries. Flaghand posts to LinkedIn only through LinkedIn's official API and only to your personal profile. It doesn't read profiles, your feed, messages or jobs.

Flaghand's server also offers ready-made prompts as slash commands, such as /mcp__flaghand__shipped, /mcp__flaghand__x_thread and /mcp__flaghand__linkedin_rewrite. Type / to see them.

Questions

Is there a Twitter (X) MCP for Claude Code? The same server drafts X posts and threads. One approval can cover a whole plan, such as an X thread and a LinkedIn post together.

Can Claude Code post to LinkedIn without asking me? No. Approving takes your passkey, and no Flaghand token can approve, schedule or post. The server checks your signed approval again right before it posts.

Can it post photos from my project? Yes. Claude Code uploads them to Flaghand with alt text, and they're part of what you approve.

How do I take Claude Code's access away? In Flaghand, open Settings › Agents and click Revoke. Or run claude mcp remove flaghand.

Other apps

The same server works in Claude, ChatGPT, Codex, Cursor and Gemini. The LinkedIn MCP server explains what Flaghand does on LinkedIn; the X MCP server and the X API and MCP servers, compared covers X, and Flaghand compared sets it beside other schedulers and posting APIs.

Sources

All read on October 28, 2026.

Claude Code is a trademark of Anthropic. LinkedIn and X are trademarks of their owners. Flaghand isn't affiliated with or endorsed by them.