explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

corporate training

[email protected]

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportprivacytermsdata rightssubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

On this page

  • TL;DR — two servers, one workflow
  • Why hosted MCP matters
  • Architecture — why you still run xurl mcp
  • X MCP capabilities
  • Before you begin
  • Connect Cursor
  • Connect Claude Desktop
  • Connect Grok Build
  • Connect VS Code (GitHub Copilot Agent mode)
  • Docs MCP — documentation search only
  • App-only shortcut (read-only, no bridge)
  • Troubleshooting
  • Security and best practices
  • OpenAPI and custom agents
  • Where this fits in the June 2026 agent stack
  • Explore more MCP servers on explainx.ai
  • Related reading
← Back to blog

explainx / blog

X Launches Hosted MCP Servers: Connect Cursor, Claude, and Grok to the X API

X shipped hosted MCP at api.x.com/mcp and docs.x.com/mcp — search posts, trends, bookmarks, and publish Articles from Cursor, Claude, Grok, or VS Code via xurl OAuth.

Jun 30, 2026·7 min read·Yash Thakker
MCPX APICursorClaudeDeveloper Tools
go deep
X Launches Hosted MCP Servers: Connect Cursor, Claude, and Grok to the X API

June 30, 2026: @XDevelopers announced hosted MCP servers — agents can call the X API without building a custom integration. Elon Musk quoted the thread: "Try it out." The same week Cursor shipped its iOS app, X closed the loop on real-time social data inside agent workflows.

If you already use MCP in Cursor or Claude Code, this is the first first-party hosted MCP from a major platform at production scale — search posts, pull trends, manage bookmarks, even draft and publish Articles, all with your account's OAuth permissions.

Official docs: docs.x.com/tools/mcp. Full doc index for LLMs: docs.x.com/llms.txt.

Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.


TL;DR — two servers, one workflow

ServerURLWhat it doesAuth
X MCPhttps://api.x.com/mcpLive X API — search, users, bookmarks, trends, news, Articlesxurl local bridge + OAuth 2.0 PKCE
Docs MCPhttps://docs.x.com/mcpSearch/read X API documentationNone — connect by URL
ClientConfig location
Cursor~/.cursor/mcp.json or .cursor/mcp.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json
Grok Build~/.grok/config.toml via grok mcp add
VS Code (Copilot Agent).vscode/mcp.json

Browse more MCP servers: explainx.ai/mcp-servers — our searchable directory with categories from devtools to CRM.


Why hosted MCP matters

Until now, giving an agent live X data meant: register a developer app, wire REST endpoints, handle rate limits, refresh tokens, and wrap everything in a custom MCP server you maintain. That is exactly the N×M problem Model Context Protocol was designed to collapse.

X's move is different from a random npm package:

  1. Hosted Streamable HTTP at api.x.com/mcp (protocol 2025-06-18, serverInfo: xmcp)
  2. Official docs MCP so agents look up endpoint schemas without hallucinating parameters
  3. First-class client configs for Cursor, Claude, Grok Build, and VS Code in the official guide

For teams building agentic research loops, social listening, or content pipelines — the agent can query the same real-time graph humans scroll, with structured tools instead of scraped HTML.


Architecture — why you still run xurl mcp

X's OAuth requires your own developer app. There is no dynamic client registration, and api.x.com/mcp does not advertise native MCP OAuth discovery. So X ships a local bridge:

snippet
MCP client (Cursor, Grok, …)
    → stdio JSON-RPC
xurl mcp (local bridge)
    → HTTPS + Bearer token
api.x.com/mcp
    ↔ OAuth2 PKCE login + auto-refresh

The bridge:

  • Runs via npx — no separate install step required
  • Opens your browser once on first run for OAuth login
  • Caches and auto-refreshes tokens in ~/.xurl
  • Sends diagnostics to stderr; stdout stays clean JSON-RPC

Docs MCP skips the bridge — it is read-only documentation search over HTTPS.


X MCP capabilities

CategoryWhat the model can do
PostsFetch posts, likers, reposters, quoters, recent counts
SearchFull-archive post search, user search, news search
UsersCurrent user, lookup by id/handle, posts, timeline, mentions
BookmarksList, add, remove, manage bookmark folders
News & TrendsNews stories, location trends (WOEID)
ArticlesCreate draft Articles and publish

Writes (bookmarks, article_publish) hit stricter rate limits than reads — expect occasional 429s and backoff.


Before you begin

  1. Create an X app in the X Developer Portal with OAuth 2.0 enabled
  2. Register redirect URI http://localhost:8080/callback (or set REDIRECT_URI env and register that)
  3. Copy CLIENT_ID and CLIENT_SECRET
  4. Node.js installed (for npx)
  5. Optional: install xurl natively:
bash
brew install --cask xdevplatform/tap/xurl
# or
npm install -g @xdevplatform/xurl

Headless servers: authenticate out-of-band first:

bash
xurl auth oauth2 --headless

Then start your MCP client — the bridge reuses the cached token.


Connect Cursor

Create ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (single repo):

json
{
  "mcpServers": {
    "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"
      }
    },
    "x-docs": {
      "url": "https://docs.x.com/mcp"
    }
  }
}

Then:

  1. Open Cursor → Settings → MCP
  2. Confirm xapi shows a green dot and tools populate
  3. On first use, your browser opens for OAuth — complete once

Pair with Cursor for iOS and you can monitor agent runs on your phone while the desktop session calls X tools.

Startup timeout: if the client times out waiting for browser login, set startup timeout ≥ 300 seconds in clients that support it (Grok Build documents this explicitly).


Connect Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\
json
{
  "mcpServers": {
    "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"
      }
    },
    "x-docs": {
      "url": "https://docs.x.com/mcp"
    }
  }
}

Restart Claude Desktop. X tools appear in the tools menu. See our full Claude Code MCP servers guide for project-level configs and /mcp troubleshooting.


Connect Grok Build

One command:

bash
grok mcp add xapi npx \
  -e CLIENT_ID=YOUR_X_APP_CLIENT_ID \
  -e CLIENT_SECRET=YOUR_X_APP_CLIENT_SECRET \
  -- -y @xdevplatform/xurl mcp https://api.x.com/mcp

Verify:

bash
grok mcp doctor xapi
grok mcp list

Add Docs MCP in ~/.grok/config.toml:

toml
[mcp_servers.x-docs]
url = "https://docs.x.com/mcp"
enabled = true

Same week as Grok 4.5 private beta, xAI and X are tightening the Musk-stack agent loop — model + social graph + dev docs in one config file.


Connect VS Code (GitHub Copilot Agent mode)

Add to .vscode/mcp.json:

json
{
  "servers": {
    "xapi": {
      "type": "stdio",
      "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"
      }
    },
    "x-docs": {
      "url": "https://docs.x.com/mcp"
    }
  }
}

Docs MCP — documentation search only

Hosted at https://docs.x.com/mcp. Tools:

ToolDescription
search_xSearch X documentation — endpoints, auth guides, examples
get_page_xFetch full content of a doc page by path

Minimal config (works in any URL-capable MCP client):

json
{
  "mcpServers": {
    "x-docs": {
      "url": "https://docs.x.com/mcp"
    }
  }
}

Use both servers together: docs MCP when the agent needs parameter shapes; xapi when it needs live data.


App-only shortcut (read-only, no bridge)

For read endpoints only, advanced users can point a client directly at the URL with a static App-only Bearer token — no auto-refresh, no user context:

toml
# Grok example
[mcp_servers.xapi_direct]
url = "https://api.x.com/mcp"
enabled = true

[mcp_servers.xapi_direct.headers]
Authorization = "Bearer YOUR_APP_ONLY_BEARER_TOKEN"

The xurl bridge is recommended for bookmarks, Articles, and anything acting as you.


Troubleshooting

SymptomFix
Client times out on startupRaise startup timeout to 300+ s — bridge waits for browser login
Browser never opensHeadless box → run xurl auth oauth2 --headless first
401 / token refresh failedWrong credentials or revoked refresh → re-run xurl auth oauth2
Redirect/callback errorRegister http://localhost:8080/callback on your app
client-not-enrolledMove app to Pay-per-use + Production in developer portal
Empty tool outputDo not run bridge with --verbose — stdout must stay JSON-RPC clean

Test the bridge manually:

bash
npx -y @xdevplatform/xurl mcp https://api.x.com/mcp

Grok users: grok mcp doctor xapi for end-to-end check.


Security and best practices

  • Treat ~/.xurl and tokens as secrets — never paste into chats or commit to git
  • Prefer env vars in config over hard-coded secrets; use per-project .cursor/mcp.json in .gitignore
  • Create a dedicated X app with minimum scopes for MCP
  • The bridge is local — credentials leave your machine only as TLS Bearer calls to api.x.com
  • Read MCP security guide for trust boundaries across all servers

If you are new to the protocol, start with What is MCP? before adding production API access.


OpenAPI and custom agents

Machine-readable spec: https://api.x.com/2/openapi.json

bash
curl https://api.x.com/2/openapi.json -o openapi.json

Use it for Postman import, client generation, or feeding a custom MCP server if you outgrow the hosted tools.


Where this fits in the June 2026 agent stack

Three launches in one week:

DateLaunchAgent angle
June 29Cursor for iOSMobile control plane for cloud agents
June 30X hosted MCPReal-time social API inside any MCP client
June 28Grok 4.5 betaFrontier model + Cursor training signal

X MCP is the data layer — Cursor iOS is the control layer — Grok is the model layer. Together they sketch the SpaceX-adjacent agent stack without waiting for Composer 3.


Explore more MCP servers on explainx.ai

X is one server. The ecosystem has thousands. On explainx.ai/mcp-servers you can:

  • Browse by category — devtools, databases, search, CRM, browser automation
  • Compare profiles — descriptions, install hints, related servers
  • Pair with skills — see Introducing MCP servers on explainx.ai for how MCP + agent skills fit together

Building your own? Our MCP Bootcamp and top MCP directories roundup cover discovery beyond a single vendor.


Related reading

  • Cursor's Google Workspace plugins: Gmail, Drive, Calendar in the IDE
  • Cloudflare Monetization Gateway — x402 MCP payments
  • What is MCP? Complete architecture guide
  • Claude Code MCP servers — connect any tool
  • Introducing MCP servers on explainx.ai
  • MCP security guide (2026)
  • Build your first MCP server
  • Cursor for iOS launch (June 29)
  • xAI Grok Voice Agent Builder — MCP in production phone agents
  • Browse MCP servers

X MCP server URLs, xurl bridge behavior, and OAuth requirements accurate as of June 30, 2026 per docs.x.com/tools/mcp. Verify current setup steps before production use.

Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

Related posts

Jun 27, 2026

What is MCP? Model Context Protocol: Complete Architecture Guide (2026)

MCP is the open standard that gives AI agents live connectors to real systems. This guide covers the full architecture—host, client, server, transport mechanisms, security trust boundaries, and the three primitives—so you can evaluate, build, and deploy MCP integrations with confidence.

Apr 13, 2026

Introducing MCP servers on explainx.ai — browse, compare, and install alongside the skills registry

MCP servers join the explainx.ai hub: searchable directory pages, per-server profiles, and the same SEO/GEO-friendly patterns we use for skills — with links to the official spec, Anthropic’s introduction, and registry skills like mcp-builder.

Aug 7, 2026

Agent Plugins: OpenAI's New Open Standard for Packaging AI Agent Tooling

Agent Plugins is a new open standard, announced Aug 6, 2026 by OpenAI Developers with AWS, Cursor, GitHub, VS Code, and Vercel, that packages Agent Skills and MCP server configs into a single shared manifest — write once, run across Codex, ChatGPT, Cursor, GitHub Copilot, Kiro, and VS Code.