Skip to main content

Announcing StackOne Defender: leading open-source prompt injection guard for your agent Read More

X (Twitter) MCP Server
for AI Agents

Production-ready X (Twitter) MCP server with 55 extensible actions — plus built-in authentication, security, and optimized execution.

X (Twitter) logo
X (Twitter) MCP Server
Built by StackOne StackOne

Coverage

55 Agent Actions

Create, read, update, and delete across X (Twitter) — and extend your agent's capabilities with custom actions.

Authentication

Agent Tool Authentication

Per-user OAuth in one call. Your X (Twitter) MCP server gets session-scoped tokens with zero credentials stored on your infra.

Agent Auth →

Security

Agent Protection

Every X (Twitter) tool response scanned for prompt injection in milliseconds — 88.7% accuracy, all running on CPU.

Prompt Injection Defense →

Performance

Max Agent Context. Min Cost.

Free up to 96% of your agent's context window to enhance reasoning and reduce cost, on every X (Twitter) call.

Tools Discovery →

What is the X (Twitter) MCP Server?

A X (Twitter) MCP server lets AI agents read and write X (Twitter) data through the Model Context Protocol — Anthropic's open standard for connecting LLMs to external tools. StackOne's X (Twitter) MCP server ships with 55 pre-built actions, fully extensible via the Connector Builder — plus managed authentication, prompt injection defense, and optimized agent context. Connect it from MCP clients like Claude Desktop, Cursor, and VS Code, or from agent frameworks like OpenAI Agents SDK, LangChain, and Vercel AI SDK.

All X (Twitter) MCP Tools and Actions

Every action from X (Twitter)'s API, ready for your agent. Create, read, update, and delete — scoped to exactly what you need.

Tweets

  • Create Tweet

    Create a new tweet on behalf of the authenticated user.

  • Get Tweet

    Retrieve a single tweet by its ID.

  • Get List Tweets

    Retrieve tweets from members of a specific list.

  • Delete Tweet

    Delete a tweet posted by the authenticated user.

Members

  • Add List Member

    Add a user to a list owned by the authenticated user.

  • Get List Members

    Retrieve users who are members of a specific list.

  • Remove List Member

    Remove a user from a list owned by the authenticated user.

Spaces

  • Get Space

    Retrieve a single X Space by its ID.

  • Search Spaces

    Search for X Spaces by keyword.

Bookmarks

  • Add Bookmark

    Bookmark a tweet for the authenticated user.

  • Get Bookmarks

    Retrieve bookmarked tweets for the authenticated user.

  • Remove Bookmark

    Remove a tweet from the authenticated user's bookmarks.

Other (43)

  • Send Message To DM Conversation

    Send a direct message to an existing conversation.

  • Create DM Conversation And Send Message

    Create a new group DM conversation and send an initial message.

  • Send Direct Message To User

    Send a direct message to a specific user, creating a new 1-on-1 conversation if one does not exist.

  • Create List

    Create a new X list on behalf of the authenticated user.

  • Search Recent Tweets

    Search for tweets from the past 7 days matching a query.

  • Get User Tweets

    Retrieve tweets posted by a specific user.

  • Get User Mentions

    Retrieve tweets mentioning a specific user.

  • Get Home Timeline

    Retrieve the authenticated user's reverse chronological home timeline.

  • Get Retweeters

    Retrieve users who retweeted a specific tweet.

  • Get Quote Tweets

    Retrieve tweets that quote a specific tweet.

  • Get Tweet Counts

    Get the count of tweets matching a search query over the past 7 days.

  • Get Authenticated User

    Returns the authenticated user's profile information.

  • Get User By ID

    Retrieve a user's profile by their unique ID.

  • Get User By Username

    Retrieve a user's profile by their @username.

  • Get User Followers

    Retrieve a list of users who follow a specific user.

  • Get User Following

    Retrieve a list of users that a specific user follows.

  • Get Muted Users

    Retrieve users muted by the authenticated user.

  • Get Blocked Users

    Retrieve users blocked by the authenticated user.

  • Get DM Events

    Retrieve direct message events for the authenticated user.

  • Get DM Conversation Events

    Retrieve events from a specific direct message conversation.

  • Get List

    Retrieve a single X list by its ID.

  • Get User Owned Lists

    Retrieve lists owned by a specific user.

  • Get User List Memberships

    Retrieve lists that a user is a member of.

  • Get Pinned Lists

    Retrieve lists pinned by the authenticated user.

  • Get Spaces By Creator

    Retrieve live or scheduled Spaces created by specific users.

  • Get Liked Tweets

    Retrieve tweets liked by a specific user.

  • Get Liking Users

    Retrieve users who liked a specific tweet.

  • Get Trends By Location

    Retrieve trending topics for a specific location by WOEID.

  • Update List

    Update a list's name, description, or privacy setting.

  • Delete List

    Delete a list owned by the authenticated user.

  • Retweet

    Retweet a tweet on behalf of the authenticated user.

  • Undo Retweet

    Remove a retweet made by the authenticated user.

  • Hide Reply

    Hide a reply to one of the authenticated user's tweets.

  • Follow User

    Follow another user on behalf of the authenticated user.

  • Unfollow User

    Unfollow a user on behalf of the authenticated user.

  • Mute User

    Mute a user on behalf of the authenticated user.

  • Unmute User

    Remove a mute on behalf of the authenticated user.

  • Block User

    Block a user on behalf of the authenticated user.

  • Unblock User

    Remove a block on behalf of the authenticated user.

  • Pin List

    Pin a list to the authenticated user's account.

  • Unpin List

    Unpin a list from the authenticated user's account.

  • Like Tweet

    Like a tweet on behalf of the authenticated user.

  • Unlike Tweet

    Remove a like from a tweet on behalf of the authenticated user.

Set Up Your X (Twitter) MCP Server in Minutes

One endpoint. Any framework. Your agent is talking to X (Twitter) in under 10 lines of code.

MCP Clients

Agent Frameworks

Claude Desktop
{
  "mcpServers": {
    "stackone": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://api.stackone.com/mcp?x-account-id=<account_id>",
        "--header",
        "Authorization: Basic <YOUR_BASE64_TOKEN>"
      ]
    }
  }
}

More Social Media MCP Servers

X (Twitter) MCP Server FAQ

X (Twitter) MCP server vs direct API integration — what's the difference?
A X (Twitter) MCP server and direct API integration serve different use cases. Direct API integration is for software-to-software — backend code calling X (Twitter). A X (Twitter) MCP server is for AI agents — MCP clients like Claude and Cursor, plus framework agents built with OpenAI, LangChain, or Vercel AI — discovering and calling X (Twitter) at runtime. StackOne provides both.
How does X (Twitter) authentication work for AI agents?
X (Twitter) authentication for AI agents works through a StackOne Connect Session. Create one via the dashboard or the SDK — you get an auth link and ready-to-paste config for Claude Desktop, Cursor, and other MCP clients. Your user authenticates their own X (Twitter) account; StackOne handles token exchange, storage, and refresh. Credentials never reach the LLM, and each user is isolated via origin_owner_id.
Are X (Twitter) MCP tools vulnerable to prompt injection?
Yes — X (Twitter) MCP tools can be vulnerable to indirect prompt injection. Any tool that reads user-written content — documents, messages, tickets, records, or free-text fields — is a potential vector. StackOne Defender scans every tool response before it enters the agent's context — regex patterns in ~1ms, then a MiniLM classifier in ~4ms. 88.7% accuracy, CPU-only.
What is the context bloat of a X (Twitter) agent and how do I avoid it?
Context bloat happens when X (Twitter) tool schemas and API responses eat your X (Twitter) agent's memory, preventing it from reasoning effectively. A single X (Twitter) query can return a massive JSON response, and connecting multiple tools compounds the problem. Tools Discovery and Code Mode reduce context bloat — loading only relevant tools per query and keeping raw responses out of the agent's context.
Can I limit which actions my X (Twitter) agent can access?
Yes — you can limit which actions your X (Twitter) agent can access directly from the StackOne dashboard. Toggle actions on or off, or restrict them to specific accounts, with no code changes to your agent. Session tokens can be scoped to exact actions so if one leaks, exposure stays contained.
Can I create custom agent actions for my X (Twitter) MCP server?
Yes — you can create custom agent actions for your X (Twitter) MCP server using Connector Builder. It's an integration agent your coding assistant (Claude Code, Cursor, or Copilot) can invoke to research X (Twitter)'s API, generate production-ready connector YAML, test against the live API, and validate before you ship.
When should I NOT use a X (Twitter) MCP server?
Skip a X (Twitter) MCP server if your integration is purely software-to-software — direct X (Twitter) API integration is simpler when no AI agent is involved. For deterministic, compliance-critical operations (financial transactions, regulatory reporting), direct API gives you predictable behavior without agent-driven decision-making. MCP shines when AI agents need to dynamically discover and call X (Twitter) actions at runtime.
What AI frameworks and AI clients does the StackOne X (Twitter) MCP server support?
The StackOne X (Twitter) MCP server supports both. MCP clients (paste-and-go apps): Claude Desktop, Claude Code, Cursor, VS Code, Goose. Agent frameworks (code SDKs you build with): OpenAI Agents SDK, Anthropic, Vercel AI, Google ADK, CrewAI, Pydantic AI, LangChain, LangGraph, Azure AI Foundry.

Put your AI agents to work

All the tools you need to build and scale AI agent integrations, with best-in-class connectivity, execution, and security.