X (Twitter) AI Tool Server for Agentic Automation - n8n Workflow

Use this specialized n8n workflow to deploy an X (Twitter) tool server. Enable AI agents to perform 8 different actions: tweet creation, DMs, liking, searching, and user lookups via powerful n8n node configurations.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Developers and Engineers building custom agents.
Automation Specialists looking to integrate social media actions into complex AI workflows.
Users needing a robust, centralized API server for X (Twitter) operations controlled by an n8n workflow.
Anyone interested in advanced use cases of the n8n node types for tool orchestration.

Overview

This specialized n8n workflow template is designed not for linear execution but as a server for AI agents, specifically utilizing the Machine-Controlled Processing (MCP) pattern. The goal is to expose a comprehensive suite of X (Twitter) operations that an external AI—often managed by a framework like LangChain—can intelligently utilize. Instead of requiring the AI to perform raw API calls, this n8n workflow provides clearly defined, reliable tools managed by official n8n node integrations. By deploying this n8n trigger endpoint, you create a powerful, scalable social media API that dramatically simplifies the creation of sophisticated AI agents capable of interacting dynamically with X (Twitter). This particular n8n workflow includes operations for posting, deleting, liking, searching, and managing direct messages and lists.

How it Works

The core of this n8n workflow is the X (Formerly Twitter) Tool MCP Server n8n trigger node. This specific n8n trigger listens for incoming requests from an external AI system. Unlike standard webhooks, the MCP trigger communicates the capabilities (the tools) exposed in the n8n workflow. The eight X (Twitter) n8n node actions are connected to this trigger node via the 'AI Tool' input, effectively registering them as available functions.

When an AI agent determines it needs to perform a social media action (e.g., 'I need to search for recent tweets about n8n'), it sends a request to the n8n trigger endpoint, specifying the tool name and the required parameters (like the search query).

The n8n workflow receives the request, executes the corresponding X (Twitter) n8n node (in this example, 'Search Tweets'), handles authentication and execution, and then returns the structured result back to the initiating AI agent. This powerful architecture showcases how n8n templates can serve as the operational backbone for advanced AI systems.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance via the 'Workflows' menu using the 'New' -> 'Import from JSON' option.

  2. Set up Credentials: Each X (Twitter) n8n node in this n8n workflow requires credentials. You must configure the necessary X (Twitter) API credentials (OAuth 2.0 or 1.0a depending on the operations required) within the credentials panel in n8n.

  3. Activate the n8n Trigger: The 'X (Formerly Twitter) Tool MCP Server' n8n trigger node must be activated and configured with the base URL of your n8n instance so that the external AI agent knows the exact endpoint to communicate with.

  4. Tool Registration: Ensure the external AI or LangChain agent is correctly configured to recognize the unique webhook URL generated by the n8n trigger and the names of the exposed n8n node tools.

Node Details

X (Formerly Twitter) Tool MCP Server (n8n trigger): The primary n8n trigger node. This specialized n8n node exposes the entire n8n workflow as a tool server, making the connected social media operations available to AI agents.
Create Direct Message (n8n node): Registers the ability to send a direct message to a specified user ID on X (Twitter).
Add Member to List (n8n node): Registers the ability to manage custom lists by adding members.
Create Tweet (n8n node): Exposes the core functionality to compose and post a new tweet.
Delete Tweet (n8n node): Allows the AI agent to remove a tweet using its specific ID.
Like Tweet (n8n node): Registers the simple action of liking a tweet specified by its ID.
Retweet Tweet (n8n node): Enables the AI to retweet existing content.
Search Tweets (n8n node): Provides the powerful capability to query the X (Twitter) API to find tweets matching specific criteria.


  • Get User (n8n node): Registers the function to retrieve detailed public information about a specific X (Twitter) user ID or username.

Related n8n Workflows

Paid

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

A hacker by nature, programmer by trade ⚒️ I'm looking to collaborate on things that save human labor 📫 How to reach me Github👇 -> Discord

Featured*