Overview
n8n is a workflow automation platform that lets you connect apps and orchestrate processes, including AI agents, on Cloud or self-hosted. The Ayrshare social media API can be integrated into your n8n workflows to manage your users’ social media accounts. One API call publishes to Facebook, Instagram, LinkedIn, YouTube, TikTok, Pinterest, Reddit, Threads, Bluesky, Telegram, Google Business Profile, Snapchat, and X, so you do not write or maintain per-platform API code. There are two ways to connect:- MCP Server (agent-driven). Attach the Ayrshare MCP Server to n8n’s built-in MCP Client Tool node, and your AI Agent can run the whole loop on its own: draft a post, validate it against each network’s rules, publish or schedule it, then read the analytics back. There is nothing to host and no community node to install.
- REST API (fixed workflow). For deterministic, non-agent workflows, call the Ayrshare REST API directly from an HTTP Request node.
How it connects
With the MCP path, the AI Agent node is the brain. The MCP Client Tool sub-node attaches to it, connects to the Ayrshare MCP Server, discovers the available tools, and exposes them to the agent. When the agent acts, the node dispatches the call to Ayrshare, which publishes to the networks.Use the HTTP Streamable transport, not SSE. The n8n guide covers transport, authentication, and setup in detail.
Guide
The full n8n guide covers the MCP-first path end to end: prerequisites, setting up the MCP Client Tool node, the validate-first system prompt, worked examples (draft and publish from a chat message, auto-publish new content, a weekly analytics digest), acting on behalf of clients with sub-profiles, keeping a human in the loop, the REST fallback, and troubleshooting.n8n + Ayrshare MCP Guide
Connect n8n’s AI Agent to the Ayrshare MCP Server to publish, schedule, and analyze across your social networks, with no per-platform API code.
Download the n8n starter workflow
A ready-to-import workflow: Chat Trigger, AI Agent, an Anthropic chat model, and the Ayrshare MCP node pre-wired with the validate-first system prompt.
Posting to X (formerly Twitter)
In n8n, switch the MCP Client Tool node’s Authentication to Multiple Headers and add the twoX-Twitter-OAuth1-* headers alongside Authorization. See Connect & Setup → X/Twitter BYO credentials.
Learn more
- Learn more about n8n and its AI Agent and MCP Client Tool nodes.
- See the MCP Server overview for what the server is and how it maps to the Ayrshare API.
- Browse the Tool Catalog for the tools your agent can call, grouped by domain.
- Read Connect & Setup for endpoint, transport, authentication, and profile targeting details.
