4,500+ servers built on MCP Fusion
Vinkius
X (Twitter) logo
Vinkius
LangChain logo

How to Use the X (Twitter) MCP in LangChain

Run complex social intelligence pipelines using LangChain's multi-step reasoning agents.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

X (Twitter) MCP on Cursor AI Code Editor MCP Client X (Twitter) MCP on Claude Desktop App MCP Integration X (Twitter) MCP on OpenAI Agents SDK MCP Compatible X (Twitter) MCP on Visual Studio Code MCP Extension Client X (Twitter) MCP on GitHub Copilot AI Agent MCP Integration X (Twitter) MCP on Google Gemini AI MCP Integration X (Twitter) MCP on Lovable AI Development MCP Client X (Twitter) MCP on Mistral AI Agents MCP Compatible X (Twitter) MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
LangChain

Connect X (Twitter) MCP to LangChain

Create your Vinkius account to connect X (Twitter) to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Profile analysis via `lookup_user_by_username`

You can fetch a user’s full profile details by calling `lookup_user_by_username`. This tool returns the follower count, bio, and verification status for any given X (Twitter) handle. Your agent uses this output as a key piece of data. For instance, one step might get a list of potential accounts, and the next step in the chain filters that list based on whether the profile was found to be verified.

Targeted search via `search_recent_tweets`

The `search_recent_tweets` tool lets you find recent public tweets using specific keywords, handles, or hashtags over the last seven days. You pass a query string, and it returns relevant results. This is perfect for building pipelines. An initial search finds 50 potential topics; your agent then feeds those topics into another step to pull detailed metrics on the most popular ones.

Deep dive with `get_tweet_details`

To get all the deep data, use `get_tweet_details`, which accepts a specific numeric Tweet ID. This gives you the full text and engagement metrics associated with that single post. After your agent identifies an interesting tweet via search, it uses this tool to pull the exact numbers—likes, retweets, etc.—so the final step of the chain can report on its virality score.

Setup guide

Set up X (Twitter) MCP in LangChain

Prerequisites

  • Python 3.10+ installed
  • langchain-mcp-adapters + langgraph packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChain BaseTool objects.

  2. 2

    Connect via HTTP transport

    Use MultiServerMCPClient with "transport": "http" pointing to your Vinkius endpoint. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Create a ReAct agent

    Pass the discovered tools to create_react_agent() from LangGraph. The agent automatically routes X (Twitter) tool calls through the MCP protocol.

  4. 4

    Run with any LLM

    Swap ChatOpenAI for ChatAnthropic, ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.

agent.py
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

async with MultiServerMCPClient({
    "x-twitter-mcp": {
        "transport": "http",
        "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
    }
}) as client:
    tools = client.get_tools()

    agent = create_react_agent(
        ChatOpenAI(model="gpt-4o"),
        tools,
    )
    result = await agent.ainvoke({
        "messages": "List recent X (Twitter) transactions"
    })
    print(result["messages"][-1].content)

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by X (Twitter). All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about X (Twitter) MCP in LangChain

You structure your queries as multi-step chains. You start by finding a user profile, then search recent tweets based on that profile's bio, and finally pull detailed metrics for the top result.
Yep. The power is in chaining. You can pass the output of one MCP tool—like a list of search results—directly into another tool, ensuring your agent follows logical steps.
Absolutely. The goal is building multi-step reasoning pipelines. You let the agent decide which MCP Server tool to call and in what precise order based on intermediate results.
The server provides user details, recent public tweet searches, and specific engagement metrics for any given Tweet ID. It's pure social intelligence data.
This server touches user profiles and tweet engagement metrics. Remember that you are pulling public data, but you still need to handle the tokens securely for your agent to function.

Start using the X (Twitter) MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 3 tools

We've already built the connector for X (Twitter). Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 3 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.