writing/blog/2026/06
BlogJun 30, 2026·6 min read

X Launches Official Hosted MCP: Connect AI Agents to Real-Time Social Data

X Developer Platform launched a hosted MCP server exposing 140+ API endpoints, letting Claude, Cursor, and Grok Build tap real-time tweets, trends, and user data with minimal setup.

Real-time social data just became a first-class citizen for AI agents. On June 30, 2026, the X Developer Platform announced an official hosted Model Context Protocol (MCP) server — giving AI tools like Claude, Cursor, and Grok Build direct, standardized access to the X API without any infrastructure overhead.

This is not a community wrapper or an unofficial connector. The X MCP is built and hosted by X itself at api.x.com/mcp, covering more than 140 API operations across posts, users, analytics, direct messages, bookmarks, and trending topics.

What Is the X MCP Server?

The Model Context Protocol is a standard interface that lets AI agents call external tools through a consistent JSON-RPC layer. Instead of each AI tool building custom X integrations, the X MCP server exposes the entire X API as a set of callable tools that any MCP-compatible client can consume.

X ships two separate hosted endpoints:

  • X MCP (https://api.x.com/mcp) — Full X API access including posts, users, search, DMs, analytics, bookmarks, and trends
  • Docs MCP (https://docs.x.com/mcp) — Instant search and retrieval across all X developer documentation

The Docs MCP requires no authentication at all. The X API server supports two authentication modes: a simple Bearer token for read-only operations, and an OAuth 2.0 PKCE flow for full read-write access.

Supported AI Tools

X has published official configuration guides for four major AI development environments:

  • Grok Build — xAI's coding and reasoning agent
  • Cursor — The AI-native code editor
  • Claude Desktop — Anthropic's desktop application
  • VS Code with GitHub Copilot — Microsoft's popular extension

Any MCP-compatible client can connect by pointing at the hosted server URL. This includes open-source agent frameworks like LangGraph, Mastra, and n8n.

Quick Setup: Read-Only Access

The fastest path to getting started uses the Docs MCP, which requires zero authentication. For X API access, the simple route uses a static Bearer token covering search, trending topics, user lookups, and timeline reading.

For Cursor or Claude Desktop, add the following to your MCP configuration file:

{
  "mcpServers": {
    "x-docs": {
      "url": "https://docs.x.com/mcp"
    },
    "xapi": {
      "command": "npx",
      "args": ["-y", "@xdevplatform/xurl", "mcp", "https://api.x.com/mcp"],
      "env": {
        "CLIENT_ID": "YOUR_X_APP_CLIENT_ID",
        "CLIENT_SECRET": "YOUR_X_APP_CLIENT_SECRET"
      }
    }
  }
}

The xurl mcp bridge is a lightweight local proxy that handles OAuth 2.0 PKCE authentication on the first run, then caches credentials automatically in ~/.xurl. Subsequent sessions resume without re-authentication.

Full OAuth Setup for Write Access

For operations that require user context — publishing posts, managing bookmarks, sending direct messages, or viewing private analytics — you need the OAuth 2.0 path.

Prerequisites:

  1. An X Developer App with OAuth 2.0 enabled
  2. Client ID and Client Secret from the developer portal
  3. Registered redirect URI: http://localhost:8080/callback
  4. Node.js installed for the npx launcher

On first run, xurl mcp opens a browser window for the OAuth consent flow. After authorization, tokens are cached and refreshed automatically. The bridge routes clean JSON-RPC on stdout and sends all diagnostics to stderr, keeping the MCP protocol stream uncontaminated.

Set a generous startup timeout — at least 300 seconds — in your MCP client to accommodate the first-run browser login flow.

What AI Agents Can Now Do

Once connected, your AI coding assistant gains access to more than 140 X API operations. Practically, this unlocks use cases that previously required custom integration work:

Content intelligence: An agent can search recent posts on any topic, pull trending data by location, and summarize public sentiment — all in a single conversation turn.

Social monitoring: Agents can monitor mentions, check engagement metrics on specific posts, and surface relevant news without any polling infrastructure.

Automated publishing: With OAuth write access, agents can draft and publish posts, manage replies, and create bookmarks as part of larger automated workflows.

Documentation lookup: The Docs MCP lets agents query X developer documentation inline, reducing context-switching when building X API integrations.

Competitive research: Agents can pull user timelines, follower counts, and post analytics from public accounts — useful for market research, content strategy, and social listening.

Real-World Agent Patterns

The most immediate use case is research agents. Rather than manually searching X and pasting findings into a prompt, an agent loop can now query trending topics, fetch the top posts on a keyword, and synthesize them into a briefing — triggered on a schedule.

For developer agents, the Docs MCP eliminates the need to maintain an offline copy of X API documentation. An agent troubleshooting an API integration can look up the current rate limits, endpoint parameters, and authentication requirements in real time.

For marketing workflows, agents can pull engagement analytics on published content, identify high-performing post patterns, and generate content recommendations — all without leaving the coding environment.

The X MCP pairs naturally with MCP-based agent workflows and can serve as the social data layer inside more complex multi-agent pipelines.

MENA Relevance

X remains one of the most active platforms for Arabic-language tech discourse, with Tunisia, Saudi Arabia, and the UAE accounting for significant regional traffic. The X MCP gives MENA-focused AI products direct access to real-time Arabic content without the complexity of managing OAuth flows manually.

For social listening products targeting the Gulf market, the location-based trends endpoint is particularly valuable — agents can pull trending topics for Riyadh, Tunis, or Dubai and generate region-specific content recommendations in a single tool call.

Limitations to Know

The hosted server covers the vast majority of X API v2 endpoints but excludes streaming and webhook operations. Teams that need real-time filtered streams for high-volume monitoring will still need the X API streaming endpoints directly.

Standard X API rate limits and tier restrictions apply to all MCP-based requests. Enterprise accounts with elevated access can use the full endpoint catalog without additional configuration.

What This Signals

The launch positions X alongside Salesforce, Microsoft Fabric, and Google Cloud — all of which shipped hosted MCP servers in 2026 — as major platforms converging on MCP as the standard interface layer for AI agent integrations.

The broader pattern is clear: every major data platform is now exposing its API surface as an MCP server, transforming agent integrations from custom code projects into configuration files. Social data, previously the hardest source to integrate cleanly into agent workflows, now follows the same pattern.

Getting Started

The complete documentation is available at docs.x.com/tools/mcp and the open-source reference implementation is at github.com/xdevplatform/xmcp. Both the hosted endpoint and the local Python self-hosted server are production-ready.

For most developers, the hosted api.x.com/mcp endpoint is the recommended path — no server to provision, no Python environment to manage, and automatic updates as X evolves the API surface.