How to build a social media automation agent using Composio MCP and n8n

How to build a social media automation agent using Composio MCP and n8n

Jul 18, 2025

Jul 18, 2025

MCP have been the talk of the town recently, and No Code space isn’t left behind. Following these few days, MCP released two MCP nodes: MCP Client Node & MCP Server Node (a little old). As a developer and automation lover, I had to try them out.

Lately, I have had hardly any time to post on my social media (X, LinkedIn, Reddit), so I built a social media automation agent using Composio MCP in N8N, utilising the new nodes. (X, L)

In this blog post, I will guide you through the process of building it from scratch and share my own insights into the process.

So, let’s begin!

TL; DR

  • 🚀 Built a social media automation agent using Composio MCP and N8N.

  • 🛠️ Automatically generates and posts content to LinkedIn, X, and Reddit.

  • ⚡ Uses MCP Client + Composio MCP Server—no need to define separate tools.

  • 🧠 Leverages LLM prompts for platform-specific post generation.

  • 💼 Ideal for businesses, saves time, cuts setup effort, and boosts productivity.

What’s the build?

We will build an automation agent that can:

  • Take a topic.

  • Generate platform-specific personalised posts for LinkedIn, X, and Reddit.

  • Post it on social media on auto.

  • Can be modified to any style - For example, Naval Ravikant on X.

  • Fully customizable for your own needs.

The best part is that with MCP servers, there is no need to define separate tools/functions for each call.

Sample flow to keep in mind

With this, let’s start defining the workspace

Workspace Setup

Our workspace setup will consist of 3 key steps:

  • Install / Host N8N

  • Activate Community MCP Client Node (now defaults)

  • Define Custom MCP Server

So, let’s get started

1. Install / Host N8N

There are two ways to use N8N: Cloud (Paid) / Self-Host (free with a license). We will go for the 2nd and that too with the easiest: *npm hosting!*

  • Ensure you have Node installed (npm req).

  • Head to the N8N Self Host Docs.

  • Copy the NPM command and paste it into the terminal: npm install n8n -g - Installs N8N globally.

  • Wait for 5 min, let it install - this isn’t a bug!

  • Run the command n8n in the terminal & when prompted, press. o .

Once done, the interface will open.

Head to setting and in Usage Tab enter email and paste in the received license code. Though its optional!

Next, we will activate the MCP Client Node!

2. Activate the MCP Client Node

MCP client node is part of the official N8N nodes, but in case you don’t find it due to version mismatch or other, follow the step to enable it.

  • Go to Settings → Community Node → Install

  • Add npm i n8n-nodes-mcp In text box (npm Package Name) → select tick box → Install

  • Check if the node shows up in the Community Node Section!

Now you can use it like any normal node.

Now, to put the MCP client to good use, we need MCP’s servers. Let’s add them next!

3. Define Custom MCP Server Using Composio

There are two ways to define MCP servers: Local (Self-Hosted) & Hosted (Online).

There are many ways to obtain hosted MCP servers, but I prefer using Composio as it provides one-click setup with OAuth and Token-based authentication built in. Not to mention 200+ tool integrations as well!

Anyway, we will utilise Composo’s custom MCP building feature, which is perfect for our use case.

In case you want to have 3 separate servers for management feel free to do so, process remain same

  • Head to Composio MCP

  • Sign in to your account (make one if you haven't - it's free!)

  • Head to the dashboard and follow along

Follow the tutorial to set your own!

Note: You need to authenticate all your MCP Server tools (as demonstrated in video), cause right now N8N doesn’t support calling OAuth Modal!

With this, we are set to build!

Automation Workflow

For simplicity, we will build the workflow in three steps, corresponding to three social media channels: LinkedIn, Reddit, and X.

Let’s start by connecting N8N with the Custom MCP made earlier!

Note: For beginners, please review this n8n playlist before proceeding to the subsection; it's essential.

Connect Composio MCP & N8N

With the MCP Client tool having HTTP support, connecting Composio mcp’s is simple, follow me:

  • Create an MCP Client Node - Search after clicking the + button in the editor

  • From the drop-down select: Create new Credentials

  • In the credential window, add the following:

    • Connect using - HTTP Streamable

    • HTTP Stream URL -the composio server URL you copied → till \\mcp only. Ensure a green bar appears at the top!

    • Change the name to something meaningful, such as 'SMA-Automation' or anything you prefer.

    • Save & Done

    • Here is mine one 😁

For verification, head back and select 'List Tools' and then 'Execute Step'. If you get a JSON output, you are good to go 👇

With MCP set and running, let’s start with LinkedIn Automation

LinkedIn Automation Graph

Here is the overview of the flow

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate the content for LinkedIn. Handled via prompt provided in Agent Node - powered by Gemini Model.

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle three operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Get User Details: Fetches the connected account urn using LINKEDIN_GET_MY_INFO . Very important - required in the next step.

  • Post to LinkedIn: Post the generated content to the LinkedIn account authenticated in composio dashboard and verified via urn using the following schema:

Tool Name: LINKEDIN_CREATE_LINKED_IN_POST

Note: You need to select Execute tool in MCP Client Node and feed in the Tool Name as input

{
  "author": "{{ JSON.parse($json.result.content[0].text).data.response_dict.author_id }}",
  "commentary": "{{ JSON.stringify($('Content Generator LinkedIn').item.json.output).slice(1, -1) }}",
  "lifecycleState": "PUBLISHED",
  "visibility": "PUBLIC"
}

important params are author → fetch author_id (urn), commentary → generated content with special character escaped, keep the rest default

With this, our LinkedIn automation workflow is done - you can test it out yourself!

Reddit Automation Graph

Here is the overview of the flow:

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate personalised content for Reddit. Handled via prompt provided in Agent Node & powered by Gemini Model. Returns a json text output.

Information Extractor Node: Extract the title and content from the generated JSON text and stores it in a JSON file. - Powered by Gemini Model.

→ Set Node: Fetches the title content and maps the two JSON Schemas. - Optional node to ensure data integrity.

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle two operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Post to Reddit: Post the generated title & content to the Reddit account authenticated in composio dashboard using the following schema:

Tool Name: REDDIT_CREATE_REDDIT_POST

{
  "flair_id": "",
  "kind": "self",
  "subreddit": "n8n_test_demo",
  "title": "{{ $('Information Extractor').item.json.output.title }}",
 "text": "{{ JSON.stringify($('Information Extractor').item.json.output.content).slice(1, -1) }}"
}

Important params are title → extract title from the information extractor / set node; text → generated content with special character escaped, subreddit: subreddit name; keep rest default.

Note: Its highly recommended you use your own subreddit, cause low quality post to any public sub reddit affect your karma points.

With this our Reddit automation workflow is done - you can test it out yourself!

X Automation Graph

Here is the overview of the flow:

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate personalised content for Reddit. Handled via prompt provided in Agent Node - powered by Gemini Model. I have tuned it to generate a Naval Ravikant-style post - personally, I like it a lot!

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle two operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Post to X: Post the generated content to the X account authenticated in the composio dashboard using the following schema:

Tool Name: TWITTER_CREATION_OF_A_POST

{
  "text": "{{ JSON.stringify($('Content Generator X').item.json.output).slice(1, -1) }}"
}

Important params are text → generated content with special character escaped, for now, media only supported as base64 format, but native support will be available soon as per composio docs.

Testing The Flow!

The final flow looks like this:

The only thing changed is connecting all the automation graphs with the chat node!

Now let’s execute the flow-testing on Topic: AI Agent!

Perfect. The agent generated content specific to all platforms and used MCP to post it to the relevant platforms.

Not the best flow for production, but definitely a step forward in building automations!

Final Thoughts

With Composio MCP & N8N, you didn’t have to worry about defining tools, linking them to LLMs, or wiring multiple nodes in n8n.

Just spinning up a single, self-hosted MCP server was enough—it handled all the heavy lifting.

For businesses, that translates to faster automation delivery, lower setup cost, and better developer productivity.

That wraps up this article!


MCP have been the talk of the town recently, and No Code space isn’t left behind. Following these few days, MCP released two MCP nodes: MCP Client Node & MCP Server Node (a little old). As a developer and automation lover, I had to try them out.

Lately, I have had hardly any time to post on my social media (X, LinkedIn, Reddit), so I built a social media automation agent using Composio MCP in N8N, utilising the new nodes. (X, L)

In this blog post, I will guide you through the process of building it from scratch and share my own insights into the process.

So, let’s begin!

TL; DR

  • 🚀 Built a social media automation agent using Composio MCP and N8N.

  • 🛠️ Automatically generates and posts content to LinkedIn, X, and Reddit.

  • ⚡ Uses MCP Client + Composio MCP Server—no need to define separate tools.

  • 🧠 Leverages LLM prompts for platform-specific post generation.

  • 💼 Ideal for businesses, saves time, cuts setup effort, and boosts productivity.

What’s the build?

We will build an automation agent that can:

  • Take a topic.

  • Generate platform-specific personalised posts for LinkedIn, X, and Reddit.

  • Post it on social media on auto.

  • Can be modified to any style - For example, Naval Ravikant on X.

  • Fully customizable for your own needs.

The best part is that with MCP servers, there is no need to define separate tools/functions for each call.

Sample flow to keep in mind

With this, let’s start defining the workspace

Workspace Setup

Our workspace setup will consist of 3 key steps:

  • Install / Host N8N

  • Activate Community MCP Client Node (now defaults)

  • Define Custom MCP Server

So, let’s get started

1. Install / Host N8N

There are two ways to use N8N: Cloud (Paid) / Self-Host (free with a license). We will go for the 2nd and that too with the easiest: *npm hosting!*

  • Ensure you have Node installed (npm req).

  • Head to the N8N Self Host Docs.

  • Copy the NPM command and paste it into the terminal: npm install n8n -g - Installs N8N globally.

  • Wait for 5 min, let it install - this isn’t a bug!

  • Run the command n8n in the terminal & when prompted, press. o .

Once done, the interface will open.

Head to setting and in Usage Tab enter email and paste in the received license code. Though its optional!

Next, we will activate the MCP Client Node!

2. Activate the MCP Client Node

MCP client node is part of the official N8N nodes, but in case you don’t find it due to version mismatch or other, follow the step to enable it.

  • Go to Settings → Community Node → Install

  • Add npm i n8n-nodes-mcp In text box (npm Package Name) → select tick box → Install

  • Check if the node shows up in the Community Node Section!

Now you can use it like any normal node.

Now, to put the MCP client to good use, we need MCP’s servers. Let’s add them next!

3. Define Custom MCP Server Using Composio

There are two ways to define MCP servers: Local (Self-Hosted) & Hosted (Online).

There are many ways to obtain hosted MCP servers, but I prefer using Composio as it provides one-click setup with OAuth and Token-based authentication built in. Not to mention 200+ tool integrations as well!

Anyway, we will utilise Composo’s custom MCP building feature, which is perfect for our use case.

In case you want to have 3 separate servers for management feel free to do so, process remain same

  • Head to Composio MCP

  • Sign in to your account (make one if you haven't - it's free!)

  • Head to the dashboard and follow along

Follow the tutorial to set your own!

Note: You need to authenticate all your MCP Server tools (as demonstrated in video), cause right now N8N doesn’t support calling OAuth Modal!

With this, we are set to build!

Automation Workflow

For simplicity, we will build the workflow in three steps, corresponding to three social media channels: LinkedIn, Reddit, and X.

Let’s start by connecting N8N with the Custom MCP made earlier!

Note: For beginners, please review this n8n playlist before proceeding to the subsection; it's essential.

Connect Composio MCP & N8N

With the MCP Client tool having HTTP support, connecting Composio mcp’s is simple, follow me:

  • Create an MCP Client Node - Search after clicking the + button in the editor

  • From the drop-down select: Create new Credentials

  • In the credential window, add the following:

    • Connect using - HTTP Streamable

    • HTTP Stream URL -the composio server URL you copied → till \\mcp only. Ensure a green bar appears at the top!

    • Change the name to something meaningful, such as 'SMA-Automation' or anything you prefer.

    • Save & Done

    • Here is mine one 😁

For verification, head back and select 'List Tools' and then 'Execute Step'. If you get a JSON output, you are good to go 👇

With MCP set and running, let’s start with LinkedIn Automation

LinkedIn Automation Graph

Here is the overview of the flow

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate the content for LinkedIn. Handled via prompt provided in Agent Node - powered by Gemini Model.

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle three operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Get User Details: Fetches the connected account urn using LINKEDIN_GET_MY_INFO . Very important - required in the next step.

  • Post to LinkedIn: Post the generated content to the LinkedIn account authenticated in composio dashboard and verified via urn using the following schema:

Tool Name: LINKEDIN_CREATE_LINKED_IN_POST

Note: You need to select Execute tool in MCP Client Node and feed in the Tool Name as input

{
  "author": "{{ JSON.parse($json.result.content[0].text).data.response_dict.author_id }}",
  "commentary": "{{ JSON.stringify($('Content Generator LinkedIn').item.json.output).slice(1, -1) }}",
  "lifecycleState": "PUBLISHED",
  "visibility": "PUBLIC"
}

important params are author → fetch author_id (urn), commentary → generated content with special character escaped, keep the rest default

With this, our LinkedIn automation workflow is done - you can test it out yourself!

Reddit Automation Graph

Here is the overview of the flow:

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate personalised content for Reddit. Handled via prompt provided in Agent Node & powered by Gemini Model. Returns a json text output.

Information Extractor Node: Extract the title and content from the generated JSON text and stores it in a JSON file. - Powered by Gemini Model.

→ Set Node: Fetches the title content and maps the two JSON Schemas. - Optional node to ensure data integrity.

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle two operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Post to Reddit: Post the generated title & content to the Reddit account authenticated in composio dashboard using the following schema:

Tool Name: REDDIT_CREATE_REDDIT_POST

{
  "flair_id": "",
  "kind": "self",
  "subreddit": "n8n_test_demo",
  "title": "{{ $('Information Extractor').item.json.output.title }}",
 "text": "{{ JSON.stringify($('Information Extractor').item.json.output.content).slice(1, -1) }}"
}

Important params are title → extract title from the information extractor / set node; text → generated content with special character escaped, subreddit: subreddit name; keep rest default.

Note: Its highly recommended you use your own subreddit, cause low quality post to any public sub reddit affect your karma points.

With this our Reddit automation workflow is done - you can test it out yourself!

X Automation Graph

Here is the overview of the flow:

Explanation

Chat input Node: Takes in a topic via chat.

Agent LLM Node: Uses the topic to generate personalised content for Reddit. Handled via prompt provided in Agent Node - powered by Gemini Model. I have tuned it to generate a Naval Ravikant-style post - personally, I like it a lot!

MCP Client Node: Uses the MCP HTTP URL (copied during the workspace section) to handle two operations:

  • Fetch all tools: Fetches all tools present in the MCP Server (sma-composio) - Optional

  • Post to X: Post the generated content to the X account authenticated in the composio dashboard using the following schema:

Tool Name: TWITTER_CREATION_OF_A_POST

{
  "text": "{{ JSON.stringify($('Content Generator X').item.json.output).slice(1, -1) }}"
}

Important params are text → generated content with special character escaped, for now, media only supported as base64 format, but native support will be available soon as per composio docs.

Testing The Flow!

The final flow looks like this:

The only thing changed is connecting all the automation graphs with the chat node!

Now let’s execute the flow-testing on Topic: AI Agent!

Perfect. The agent generated content specific to all platforms and used MCP to post it to the relevant platforms.

Not the best flow for production, but definitely a step forward in building automations!

Final Thoughts

With Composio MCP & N8N, you didn’t have to worry about defining tools, linking them to LLMs, or wiring multiple nodes in n8n.

Just spinning up a single, self-hosted MCP server was enough—it handled all the heavy lifting.

For businesses, that translates to faster automation delivery, lower setup cost, and better developer productivity.

That wraps up this article!


social media agent, social media automation, compoiso with n8n