Skip to main content
The Ayrshare plugin for Claude Code bundles the MCP Server configuration, a setup command, agents, skills, and a safety hook. With it installed, you can publish posts, fetch history and analytics, manage profiles, and more — directly from Claude Code. Before anything goes live, the agent validates each post against the target network’s rules and asks you to confirm, catching avoidable rejections up front. Post history is available for matching a brand’s voice, and analytics can be read back to inform the next post. The plugin is open source. See the repository for internals: ayrshare/ayrshare-social-media-api-claude-plugin.

Install

1

Add the marketplace (one time)

2

Install the plugin

Install scopes

Claude Code’s CLI calls the global scope --scope user.

Credentials

Enter your Ayrshare API key in the plugin’s settings. In Claude Code, run:
Claude Code masks each value as you type it and keeps it in your system’s secure credential store. claude plugin install run from a terminal doesn’t show this dialog, so open it from a Claude Code session. /ayrshare:setup walks you through each field. If you added Ayrshare from Claude’s plugin directory on claude.ai, Claude Code knows the plugin as ayrshare@synced, so run /plugin configure ayrshare@synced instead. claude plugin list shows which one you have. The same dialog is also under /plugin: open the Installed tab, select ayrshare, then Configure options. Plugins from claude.ai appear in Claude Code 2.1.273 or later. To target a sub-profile for a single call instead, pass a profileKey tool argument. It overrides the Profile-Key setting for that call.
Plugin version 0.2.3 needs Claude Code 2.1.119 or later, and no longer reads the AYRSHARE_API_KEY, AYRSHARE_PROFILE_KEY, X_TWITTER_OAUTH1_API_KEY or X_TWITTER_OAUTH1_API_SECRET environment variables. If you set up an earlier version, run /plugin configure ayrshare@ayrshare (or /plugin configure ayrshare@synced) after updating and enter the same values. Until you do, the Ayrshare tools don’t load.

X/Twitter BYO credentials

Any X/Twitter call (posting, analytics, messages) requires your own X Developer App credentials (the X BYO-key mandate, effective March 31, 2026; see the API Overview). Enter your X API Key (Consumer Key) and API Secret (Consumer Secret) in the plugin’s settings with /plugin configure ayrshare@ayrshare. The plugin sends them as the X-Twitter-OAuth1-Api-Key and X-Twitter-OAuth1-Api-Secret headers. Set both or neither: with neither set an X/Twitter call returns error 419 (x_credentials_required); with only one set it returns error 400. This is one key pair per Ayrshare account, sent on every X-targeting request (the same pair for all sub-profiles).
Prefer a raw connection over the plugin? The same BYO headers can be passed via claude mcp add --header — see Connect & Setup → X/Twitter BYO credentials.

What it ships

Command

  • /ayrshare:setup: walks you through entering or changing your API key and optional settings.

Agents

  • social-manager: publishes, schedules, and analyzes content across platforms.
  • profile-manager: creates and lists profiles and mints JWT social-linking URLs for client profiles under a Business account.
  • insights-analyst: read-only reporting. Pulls metrics and post history and summarizes performance; never publishes, comments, messages, or modifies anything.

Skills

Confirmation hook

A PreToolUse hook asks for confirmation before any action with a live side effect. If you decline, the tool does not run and nothing is sent to Ayrshare. It covers exactly these 12 tools:
  • create_post
  • update_post
  • retry_post
  • add_comment
  • reply_comment
  • send_message
  • set_auto_response
  • create_profile: creates a client profile, which uses profile quota.
  • update_ad: pauses, resumes, deletes, or archives a boosted ad, which changes real ad spend. The same status is also set on the ad’s ad set and campaign, so other ads there change too.
  • boost_post: boosts a published post as a paid ad, which spends real money from the ad account.
  • register_webhook and unregister_webhook: change where Ayrshare sends your account’s events, including message and comment content.
The prompt needs plugin version 0.2.2 or later. Earlier versions of the plugin did not show it. To update, run claude plugin marketplace update ayrshare, then claude plugin update ayrshare@ayrshare, and restart Claude Code.

FAQ

Yes. The plugin runs validate_post to dry-run your content against each network’s rules — length, format, and media requirements — before it publishes, so you catch avoidable rejections up front.
Yes. A PreToolUse confirmation hook prompts you to approve before any action with a live side effect: create_post, update_post, retry_post, add_comment, reply_comment, send_message, set_auto_response, create_profile, update_ad, boost_post, register_webhook, and unregister_webhook. It needs plugin version 0.2.2 or later.
Yes. The draft-in-brand-voice skill reads your post history to draft new copy in a consistent brand voice. It produces drafts only — nothing publishes without your confirmation.
Yes. The analytics tools return per-post and account-level metrics, so you can read results back and let them guide your next post.
An Ayrshare API key (a Business plan key for profiles and sub-profiles) and Claude Code. Enter the key with /plugin configure ayrshare@ayrshare in Claude Code.
Yes. X/Twitter requires your own OAuth 1.0a credentials, added as two connection headers (X-Twitter-OAuth1-Api-Key and X-Twitter-OAuth1-Api-Secret). See X/Twitter BYO credentials above.

Next steps

Connect & Setup

Authentication, profile targeting, and BYO credentials.

Tool Catalog

The 33 tools grouped by domain, with scope and purpose.