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

To connect LinkedIn and X to Claude Code, add Flaghand's MCP server and sign in:

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

Then run `/mcp` in Claude Code, pick **flaghand** and sign in. Claude Code can then draft LinkedIn and X posts from your
work, such as what you shipped this week, and send them to you for approval. You approve each exact post with your
passkey, and Flaghand posts it.

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](#sources).

## Connect it in four steps

1. **Get a Flaghand account and connect your accounts.** [Start here](/schedule), then connect your
   LinkedIn profile and X account under **Settings › Account**. Each network shows its own sign-in; Flaghand never asks
   for your LinkedIn password or browser cookies. Or let Claude Code do the setup: ask it to read
   `https://app.flaghand.com/docs/setup.md` and set Flaghand up for you. It signs you up over Flaghand's API and hands you only the
   links that need you: sign-up, billing, and LinkedIn's and X's own consent screens.
2. **Add the server.** Run the command above in your terminal. `--scope user` makes Flaghand available in every
   project; leave it out to add it to the current project only.
3. **Sign in.** In Claude Code, run `/mcp`, select **flaghand** and choose to authenticate. Flaghand's page opens in
   your browser: sign in with your passkey, Google or email and click **Allow** (pick the workspace first if you have
   more than one). `claude mcp login flaghand` does the same from the terminal.
4. **Ask for a post.** In a project, try:

   > 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.

## Or install the plugin

The Flaghand plugin installs the server and Flaghand's skill (its instructions for Claude) together. In Claude Code:

```text
/plugin marketplace add https://app.flaghand.com/agent-plugin/marketplace.json
/plugin install flaghand@flaghand
```

Then sign in through `/mcp` as above. Use the plugin or the `claude mcp add` command, not both. The plugin adds
`/flaghand:shipped`, which drafts posts from what your repository merged in the last 7 days, or since a date you give
it.

## With a token instead of a sign-in

For a script or a machine without a browser, create a token in Flaghand under **Settings › Agents › Create token**
(it's shown once), keep it in your secret store, and pass it as a header:

```sh
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.

## 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](/docs/guides/connect-linkedin-and-x-to-claude),
[ChatGPT](/docs/guides/connect-linkedin-and-x-to-chatgpt), [Codex](/docs/guides/connect-linkedin-and-x-to-codex),
[Cursor](/docs/guides/connect-linkedin-and-x-to-cursor) and [Gemini](/docs/guides/connect-linkedin-and-x-to-gemini).
[The LinkedIn MCP server](/linkedin-mcp-server) explains what Flaghand does on LinkedIn;
[the X MCP server](/x-mcp-server) and [the X API and MCP servers, compared](/docs/guides/x-api-and-mcp-servers-for-ai-agents) covers X, and
[Flaghand compared](/compare) sets it beside other schedulers and posting APIs.

## Sources

All read on October 28, 2026.

- Claude Code: [MCP](https://code.claude.com/docs/en/mcp), [plugin marketplaces](https://code.claude.com/docs/en/plugins/host-marketplace.md)
- Flaghand: [set up and connect](https://app.flaghand.com/docs/setup), [agents: the Claude Code plugin and prompts](https://app.flaghand.com/docs/agents),
  [sign-in and tokens](https://app.flaghand.com/docs/sign-in-and-tokens)

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

[All guides](/docs/guides.md)
