# X MCP

```json
{
  "name": "X MCP",
  "slug": "x_mcp",
  "url": "https://composio.dev/toolkits/x_mcp",
  "markdown_url": "https://composio.dev/toolkits/x_mcp.md",
  "logo_url": "https://logos.composio.dev/api/x_mcp",
  "categories": [
    "social media"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-10-30T05:33:32.507Z"
}
```

![X MCP logo](https://logos.composio.dev/api/x_mcp)

## Description

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with X MCP or direct API to search posts, find users and trends, manage bookmarks and lists, and create Article drafts through natural language.

## Summary

X MCP is X's hosted MCP server for searching posts, users, news, trends, Spaces, and communities.
It provides a ready-to-use bridge for working with X data and account features.

## Categories

- social media

## Toolkit Details

- Tools: 96

## Images

- Logo: https://logos.composio.dev/api/x_mcp

## Authentication

- **Oauth2**
  - Type: `oauth2`
  - Description: Oauth2 authentication for X MCP.
  - Setup:
    - Configure Oauth2 credentials for X MCP.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- Search X posts about AI agents today
- Find trending technology topics on X
- Summarize recent posts from selected X users

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `X_MCP_ACCEPT_CHAT_MESSAGE_REQUEST` | Accept chat message request | Accept a Chat message request |
| `X_MCP_ADD_CHAT_MODERATOR` | Add chat moderator | Add a chat moderator |
| `X_MCP_ADD_CONVERSATION_KEYS` | Add conversation keys | Add Conversation Keys |
| `X_MCP_ADD_LISTS_MEMBER` | Add lists member | Add Lists Member |
| `X_MCP_ARCHIVE_CHAT_CONVERSATION` | Archive chat conversation | Archive a Chat conversation |
| `X_MCP_ARTICLE_CREATE_DRAFT` | Article create draft | Create draft Article |
| `X_MCP_CANCEL_SCHEDULED_CALL` | Cancel scheduled call | Cancel a scheduled call |
| `X_MCP_CHAT_MEDIA_DOWNLOAD` | Chat media download | Download Chat Media. Returns JSON with the response bytes base64-encoded in `data`, plus `content_type` and `size_bytes`. Needs the OAuth2 scope `media.write`. |
| `X_MCP_CHAT_MEDIA_UPLOAD_APPEND` | Chat media upload append | Append Chat Media Upload. Needs the OAuth2 scope `media.write`. |
| `X_MCP_CHAT_MEDIA_UPLOAD_FINALIZE` | Chat media upload finalize | Finalize Chat Media Upload. Needs the OAuth2 scope `media.write`. |
| `X_MCP_CHAT_MEDIA_UPLOAD_INITIALIZE` | Chat media upload initialize | Initialize Chat Media Upload. Needs the OAuth2 scope `media.write`. |
| `X_MCP_CREATE_LISTS` | Create lists | Create Lists |
| `X_MCP_CREATE_SCHEDULED_BROADCAST` | Create scheduled broadcast | Create a scheduled broadcast |
| `X_MCP_CREATE_SOURCE` | Create source | Create a stream source |
| `X_MCP_CREATE_USERS_BOOKMARK` | Create users bookmark | Create Bookmark |
| `X_MCP_CREATE_USERS_BOOKMARK_FOLDER` | Create users bookmark folder | Create Bookmark Folder |
| `X_MCP_DELETE_SCHEDULED_BROADCAST` | Delete scheduled broadcast | Delete a scheduled broadcast |
| `X_MCP_DELETE_SOURCE` | Delete source | Delete a stream source |
| `X_MCP_DELETE_USERS_BOOKMARK` | Delete users bookmark | Delete Bookmark |
| `X_MCP_FOLLOW_LIST` | Follow list | Follow List |
| `X_MCP_GET_BROADCAST` | Get broadcast | Get a broadcast |
| `X_MCP_GET_BROADCAST_CHAT` | Get broadcast chat | Get broadcast chat history |
| `X_MCP_GET_CHAT_CONVERSATION` | Get chat conversation | Get Chat Conversation; unread state via chat_conversation.fields=unread,last_read_event_id,newest_event_id |
| `X_MCP_GET_CHAT_CONVERSATION_EVENTS` | Get chat conversation events | Get Chat Conversation Events, newest first; unread ones have an id above last_read_event_id |
| `X_MCP_GET_CHAT_CONVERSATIONS` | Get chat conversations | Get Chat Conversations; unread state via chat_conversation.fields=unread,last_read_event_id,newest_event_id |
| `X_MCP_GET_CHAT_MESSAGE_REQUEST` | Get chat message request | Get Chat Message Request |
| `X_MCP_GET_CHAT_MESSAGE_REQUESTS` | Get chat message requests | Get Chat Message Requests |
| `X_MCP_GET_CHAT_MODERATORS` | Get chat moderators | Get chat moderators |
| `X_MCP_GET_COMMUNITIES_BY_ID` | Get communities by | Get Communities by ID |
| `X_MCP_GET_LISTS_BY_ID` | Get lists by | Get Lists by ID |
| `X_MCP_GET_LISTS_FOLLOWERS` | Get lists followers | Get Lists Followers |
| `X_MCP_GET_LISTS_MEMBERS` | Get lists members | Get Lists Members |
| `X_MCP_GET_LISTS_POSTS` | Get lists posts | Get Lists Posts |
| `X_MCP_GET_NEWS` | Get news | Get news stories by ID Each returned story includes a `url` deeplinking to its x.com page. |
| `X_MCP_GET_POSTS_BY_ID` | Get posts by | Get Posts by ID Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_POSTS_BY_IDS` | Get posts by ids | Get Posts by IDs Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_POSTS_COUNTS_RECENT` | Get posts counts recent | Get Posts Counts Recent |
| `X_MCP_GET_POSTS_LIKING_USERS` | Get posts liking users | Get Posts Liking Users |
| `X_MCP_GET_POSTS_QUOTED_POSTS` | Get posts quoted posts | Get Posts Quoted Posts Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_POSTS_REPOSTED_BY` | Get posts reposted by | Get Posts Reposted by |
| `X_MCP_GET_SCHEDULED_BROADCAST` | Get scheduled broadcast | Get a scheduled broadcast |
| `X_MCP_GET_SCHEDULED_CALL` | Get scheduled call | Get a scheduled call |
| `X_MCP_GET_SOURCE` | Get source | Get a stream source |
| `X_MCP_GET_SPACES_BY_CREATOR_IDS` | Get spaces by creator ids | Get Spaces by Creator IDs |
| `X_MCP_GET_SPACES_BY_ID` | Get spaces by | Get Spaces by ID |
| `X_MCP_GET_SPACES_BY_IDS` | Get spaces by ids | Get Spaces by IDs |
| `X_MCP_GET_SPACES_POSTS` | Get spaces posts | Get Space Posts |
| `X_MCP_GET_TRENDS_BY_WOEID` | Get trends by woeid | Get Trends by Woeid Each returned trend includes a `url` deeplinking to its x.com search. |
| `X_MCP_GET_USAGE_CREDITS` | Get usage credits | Get usage credits |
| `X_MCP_GET_USERS_BOOKMARK_FOLDERS` | Get users bookmark folders | Get Users Bookmark Folders |
| `X_MCP_GET_USERS_BOOKMARKS` | Get users bookmarks | Get Users Bookmarks Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_USERS_BOOKMARKS_BY_FOLDER_ID` | Get users bookmarks by folder | Get Users Bookmarks by Folder ID Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_USERS_BY_ID` | Get users by | Get Users by ID |
| `X_MCP_GET_USERS_BY_USERNAME` | Get users by username | Get Users by Username |
| `X_MCP_GET_USERS_BY_USERNAMES` | Get users by usernames | Get Users by Usernames |
| `X_MCP_GET_USERS_FOLLOWED_LISTS` | Get users followed lists | Get Users Followed Lists |
| `X_MCP_GET_USERS_LIKED_POSTS` | Get users liked posts | Get Users Liked Posts Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_USERS_LIST_MEMBERSHIPS` | Get users list memberships | Get Users List Memberships |
| `X_MCP_GET_USERS_ME` | Get users me | Get Users Me |
| `X_MCP_GET_USERS_ME_FOLLOWERS` | Get users me followers | Get the authenticated user's followers |
| `X_MCP_GET_USERS_ME_FOLLOWING` | Get users me following | Get the users the authenticated user follows |
| `X_MCP_GET_USERS_MENTIONS` | Get users mentions | Get Users Mentions Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_USERS_OWNED_LISTS` | Get users owned lists | Get Users Owned Lists |
| `X_MCP_GET_USERS_PINNED_LISTS` | Get users pinned lists | Get Users Pinned Lists |
| `X_MCP_GET_USERS_POSTS` | Get users posts | Get Users Posts Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GET_USERS_PUBLIC_KEY` | Get users public key | Get public keys |
| `X_MCP_GET_USERS_PUBLIC_KEYS` | Get users public keys | Get public keys |
| `X_MCP_GET_USERS_TIMELINE` | Get users timeline | Get Users Timeline Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_GO_LIVE_SCHEDULED_BROADCAST` | Go live scheduled broadcast | Go live on a scheduled broadcast |
| `X_MCP_LIST_BROADCASTS` | List broadcasts | List broadcasts |
| `X_MCP_LIST_SCHEDULED_BROADCASTS` | List scheduled broadcasts | List scheduled broadcasts |
| `X_MCP_LIST_SCHEDULED_CALLS` | List scheduled calls | List scheduled calls |
| `X_MCP_LIST_SOURCES` | List sources | List stream sources |
| `X_MCP_MARK_CHAT_CONVERSATION_READ` | Mark chat conversation read | Mark Conversation as Read |
| `X_MCP_MARK_CHAT_CONVERSATION_UNREAD` | Mark chat conversation unread | Mark Conversation as Unread |
| `X_MCP_MUTE_BROADCAST_CHAT_USER` | Mute broadcast chat user | Mute or time out a user in a broadcast chat |
| `X_MCP_PIN_LIST` | Pin list | Pin List |
| `X_MCP_REMOVE_CHAT_MODERATOR` | Remove chat moderator | Remove a chat moderator |
| `X_MCP_REMOVE_LISTS_MEMBER_BY_USER_ID` | Remove lists member by user | Remove a List member |
| `X_MCP_RESPOND_TO_SCHEDULED_CALL` | Respond to scheduled call | Respond to a scheduled call |
| `X_MCP_SCHEDULE_CALL` | Schedule call | Schedule a call |
| `X_MCP_SEARCH_COMMUNITIES` | Search communities | Search Communities |
| `X_MCP_SEARCH_NEWS` | Search news | Search News Each returned story includes a `url` deeplinking to its x.com page. |
| `X_MCP_SEARCH_POSTS_ALL` | Search posts all | Search Posts All Each returned post includes a `url` deeplinking to it on x.com. |
| `X_MCP_SEARCH_SPACES` | Search spaces | Search Spaces |
| `X_MCP_SEARCH_USERS` | Search users | Search Users |
| `X_MCP_SEND_CHAT_MESSAGE` | Send chat message | Send Chat Message |
| `X_MCP_SEND_CHAT_TYPING_INDICATOR` | Send chat typing indicator | Send Typing Indicator |
| `X_MCP_UNARCHIVE_CHAT_CONVERSATION` | Unarchive chat conversation | Unarchive a Chat conversation |
| `X_MCP_UNFOLLOW_LIST` | Unfollow list | Unfollow a List |
| `X_MCP_UNMUTE_BROADCAST_CHAT_USER` | Unmute broadcast chat user | Unmute a user in a broadcast chat |
| `X_MCP_UNPIN_LIST` | Unpin list | Unpin a List |
| `X_MCP_UPDATE_LISTS` | Update lists | Update List |
| `X_MCP_UPDATE_SCHEDULED_BROADCAST` | Update scheduled broadcast | Update a scheduled broadcast |
| `X_MCP_UPDATE_SCHEDULED_CALL` | Update scheduled call | Update a scheduled call |
| `X_MCP_UPDATE_SOURCE` | Update source | Rename a stream source |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
```python
pip install composio composio_openai openai
```

```typescript
npm install @composio/core @composio/openai openai
```

#### Path 1, Step 2: Create a Composio session

Initialize Composio with the OpenAI Responses provider and create a session scoped to X MCP
```python
import json
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
client = OpenAI()

session = composio.create(user_id="your-user-id", toolkits=["x_mcp"])
tools = session.tools()
```

```typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["x_mcp"] });
const tools = await session.tools();
```

#### Path 1, Step 3: Run X MCP tools with your agent

Send a request, execute the X MCP tool calls through the session, and print the final answer
```python
response = client.responses.create(
    model="gpt-5.6-sol",
    tools=tools,
    input=[{"role": "user", "content": "Search X for recent posts about AI agents from the past week."}],
)

while True:
    tool_calls = [o for o in response.output if o.type == "function_call"]
    if not tool_calls:
        break
    results = composio.provider.handle_tool_calls(response=response, session=session)
    response = client.responses.create(
        model="gpt-5.6-sol",
        tools=tools,
        previous_response_id=response.id,
        input=[
            {"type": "function_call_output", "call_id": call.call_id, "output": json.dumps(results[i])}
            for i, call in enumerate(tool_calls)
        ],
    )

print(response.output_text)
```

```typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Search X for recent posts about AI agents from the past week." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK and your agent framework
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
```

#### Path 2, Step 2: Create a session with MCP enabled

Create a session scoped to X MCP and read its MCP URL and headers
```python
from composio import Composio

composio = Composio()
session = composio.create(user_id="your-user-id", toolkits=["x_mcp"], mcp=True)
```

```typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["x_mcp"],
  mcp: true,
});
```

#### Path 2, Step 3: Connect your agent to the MCP server

Pass the session's MCP URL and headers to your agent and run a X MCP request
```python
import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage, TextBlock

options = ClaudeAgentOptions(
    mcp_servers={
        "composio": {
            "type": "http",
            "url": session.mcp.url,
            "headers": session.mcp.headers,
        }
    },
    system_prompt="You are a helpful assistant with access to X MCP tools.",
    tools=[],
    allowed_tools=["mcp__composio__*"],
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query("Search X for recent posts about AI agents from the past week.")
        async for message in client.receive_response():
            if isinstance(message, AssistantMessage):
                for block in message.content:
                    if isinstance(block, TextBlock):
                        print(block.text)

asyncio.run(main())
```

```typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Search X for recent posts about AI agents from the past week.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
```

## Why Use Composio?

### 1. AI Native X MCP Integration

- Supports X MCP and direct API-based integrations
- Structured, LLM-friendly schemas for reliable X tool execution
- Rich coverage for searching posts, users, news, trends, Spaces, and communities

### 2. Managed Auth

- Built-in OAuth handling with automatic token refresh and rotation
- Central place to manage, scope, and revoke X MCP access
- Per-user and per-environment credentials instead of hard-coded keys

### 3. Agent Optimized Design

- Tools are tuned using real error and success rates to improve reliability over time
- Comprehensive execution logs so you always know what ran, when, and on whose behalf

### 4. Enterprise Grade Security

- Fine-grained RBAC so you control which agents and users can access X MCP
- Scoped, least-privilege access to X posts, accounts, lists, bookmarks, chats, and drafts
- Full audit trail of agent actions to support review and compliance

## Use X MCP with any AI Agent Framework

Choose a framework you want to connect X MCP with:

- [ChatGPT](https://composio.dev/toolkits/x_mcp/framework/chatgpt)
- [Claude Cowork](https://composio.dev/toolkits/x_mcp/framework/claude-cowork)
- [Hermes](https://composio.dev/toolkits/x_mcp/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/x_mcp/framework/atomic-agent)

## Related Toolkits

- [Twitter](https://composio.dev/toolkits/twitter) - Twitter is a social media platform for sharing real-time updates, conversations, and news. Stay connected, informed, and engaged with communities worldwide.
- [Instagram](https://composio.dev/toolkits/instagram) - Instagram is a social platform for sharing photos, videos, and stories with your audience. It helps brands and creators engage, grow, and analyze their online presence.
- [Ayrshare](https://composio.dev/toolkits/ayrshare) - Ayrshare is a Social Media API for managing, automating, and analyzing posts across multiple platforms. It helps you streamline social media workflows and centralize analytics.
- [DEV Community](https://composio.dev/toolkits/devto) - DEV Community (dev.to) is a social publishing platform for software developers. Use it to share technical articles, grow a developer audience, and join community discussions.
- [Dotsimple](https://composio.dev/toolkits/dotsimple) - Dotsimple is a social media management platform for planning, creating, and publishing content. It helps teams boost their reach with AI-powered content generation and actionable analytics.
- [Just One API](https://composio.dev/toolkits/just_one_api) - Just One API is a unified platform providing public social, creator, entertainment, and ecommerce data. Use it to query standardized, metered datasets across hundreds of endpoints for research and product insights.
- [Pinterest](https://composio.dev/toolkits/pinterest) - Pinterest is a visual discovery platform for recipes, home ideas, style inspiration, travel plans, and more. It helps people save, organize, and revisit ideas through Pins and Boards.
- [Strava](https://composio.dev/toolkits/strava) - Strava is a social fitness network and app for cyclists and runners. It's perfect for tracking workouts, sharing progress, and joining active communities.
- [Threads](https://composio.dev/toolkits/threads) - Threads is Meta's social network for publishing posts, managing replies, discovering content, and tracking performance. It helps creators and brands engage audiences and measure what resonates.
- [TikHub](https://composio.dev/toolkits/tik_hub) - TikHub is a social metadata API that exposes supported TikTok and social metadata routes. It provides consistent, API-key-based access to public metadata without cookies or device signatures.
- [Tiktok](https://composio.dev/toolkits/tiktok) - Tiktok is a short-form video platform for creating, sharing, and discovering viral content. It helps creators and brands reach massive audiences with creative tools and global social features.
- [Twitch](https://composio.dev/toolkits/twitch) - Twitch is a live streaming platform for gamers, creators, and communities. It enables real-time interaction, monetization, and community building.
- [TwitterShots](https://composio.dev/toolkits/twittershots) - TwitterShots is an API service that renders public X posts as clean screenshots and retrieves tweet content. Use it to capture social posts, extract tweet text, and track API usage without building screenshot infrastructure.
- [Upload-Post](https://composio.dev/toolkits/upload_post) - Upload-Post is a social publishing API for posting, scheduling, and managing content across social networks. Use it to run multi-channel content workflows through one clean API instead of separate platform integrations.
- [Gmail](https://composio.dev/toolkits/gmail) - Gmail is Google's email service with powerful spam protection, search, and G Suite integration. It keeps your inbox organized and makes communication fast and reliable.
- [Google Calendar](https://composio.dev/toolkits/googlecalendar) - Google Calendar is a time management service for scheduling meetings, events, and reminders. It streamlines personal and team organization with integrated notifications and sharing options.
- [Google Drive](https://composio.dev/toolkits/googledrive) - Google Drive is a cloud storage platform for uploading, sharing, and collaborating on files. It's perfect for keeping your documents accessible and organized across devices.
- [Outlook](https://composio.dev/toolkits/outlook) - Outlook is Microsoft's email and calendaring platform for unified communications and scheduling. It helps users stay organized with powerful email, contacts, and calendar management.
- [Google Sheets](https://composio.dev/toolkits/googlesheets) - Google Sheets is a cloud-based spreadsheet tool for real-time collaboration and data analysis. It lets teams work together from anywhere, updating information instantly.
- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.

## Frequently Asked Questions

### Do I need my own developer credentials to use X MCP with Composio?

Yes, X MCP requires you to configure your own OAuth credentials. Once set up, Composio handles token storage, refresh, and lifecycle management for you.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
