x-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
x-mcp
Public X/Twitter data, inside your AI agent.Look up posts, profiles, timelines, followers and trends through one read-only MCP endpoint.No X login, API key or local server needed to use the hosted endpoint.
Quick start Features Tools Development 日本語で読む
Upstream keyword search is disabled (checked November 27, 2026). search_posts and typeahead fail fast with code: "feature_unavailable" and a hint that names the alternative, such as get_profile_statuses for a from:jack query. Posts, profiles, timelines, followers, reposters and trends work.
Features
👤 Read posts and profiles — Paste a post link (
x.com,twitter.com, mobile) or ID, or a handle with or without@or as a profile URL. You get text, metrics, media, quotes, polls, Community Notes and the text of X Articles.🧵 Browse an account — Recent posts and reposts (optionally with replies), media posts, X Articles, followers and the accounts it follows.
🔁 See who reposted a post — List the accounts that reposted it.
🪶 Small, agent-friendly results — Compact JSON summaries.
countis enforced andnext_cursorcontinues without gaps. A 2-post timeline is about 1,500 characters, down from about 125,000 in 0.1.🧭 Errors that say what to do next — Every failure has a
code, aretryableflag and ahint, e.g. which tool to use while search is down.🔌 Connect any remote MCP client — Use the hosted Streamable HTTP endpoint, or run the TypeScript + Hono Worker yourself. The bundled skill teaches agents when to use each tool.
Related MCP server: x-mcp
Quick start
You need an AI agent or MCP client that supports remote Streamable HTTP. Using the hosted endpoint requires no Cloudflare account or repository clone.
1. Load the skill and connect
The bundled skill tells an agent when and how to use each tool. Paste this into an agent that can load skills and configure MCP servers:
Install or load the x-mcp skill first:
https://raw.githubusercontent.com/kandotrun/x-mcp/main/skills/x-mcp/SKILL.md
Then configure an MCP server named `x` with Streamable HTTP:
https://x.mcp.2-38.com/mcp
Verify tools/list includes the tools documented in the skill.
Call get_post with { "id": "https://x.com/jack/status/20" } and check that post.text is "just setting up my twttr".
If a tool returns an upstream error such as feature_unavailable, report it separately from MCP setup.
Use this MCP for public, read-only X/Twitter lookups.Longer prompts in both languages are in Agent install prompts.
To add the server yourself, register it as x:
Client | Command |
Claude Code |
|
Codex (CLI, IDE extension, ChatGPT desktop) |
|
Gemini CLI |
|
GitHub Copilot CLI |
|
Devin Desktop (formerly Windsurf) |
|
Cline |
|
Hermes Agent |
|
For Claude Code, --transport http is required (the default is stdio). Other clients are configured as below. Tool names then appear as mcp__x__get_post (Claude Code), mcp_x_get_post (Hermes, Gemini CLI) and so on.
Customize → Connectors → Add → Add custom connector: name x, URL https://x.mcp.2-38.com/mcp, no authentication. Then enable x per conversation from the "+" menu → Connectors. On Team and Enterprise plans, an owner adds it under Organization settings → Connectors. The connector syncs to Desktop and mobile.
Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project), then restart Cursor:
{
"mcpServers": {
"x": { "url": "https://x.mcp.2-38.com/mcp" }
}
}One-click install link: cursor://anysphere.cursor-deeplink/mcp/install?name=x&config=eyJ1cmwiOiJodHRwczovL3gubWNwLjItMzguY29tL21jcCJ9
For the Copilot agent harness (the default since VS Code 1.143), add this to ~/.copilot/mcp-config.json (shared with GitHub Copilot CLI) or to .mcp.json at the workspace root:
{
"mcpServers": {
"x": { "type": "http", "url": "https://x.mcp.2-38.com/mcp", "tools": ["*"] }
}
}Older VS Code (Local harness) uses .vscode/mcp.json with a different top-level key: {"servers": {"x": {"type": "http", "url": "https://x.mcp.2-38.com/mcp"}}}.
gemini mcp add --scope user --transport http x https://x.mcp.2-38.com/mcp writes this to ~/.gemini/settings.json (older releases need "httpUrl" instead of "url"):
{
"mcpServers": {
"x": { "url": "https://x.mcp.2-38.com/mcp", "type": "http" }
}
}Antigravity (CLI and IDE) reads ~/.gemini/config/mcp_config.json and uses serverUrl:
{
"mcpServers": {
"x": { "serverUrl": "https://x.mcp.2-38.com/mcp" }
}
}Devin Desktop (formerly Windsurf):
devin mcp add -s user x https://x.mcp.2-38.com/mcp. The legacy Windsurf Cascade agent reads~/.codeium/windsurf/mcp_config.jsonwith{"mcpServers": {"x": {"serverUrl": "https://x.mcp.2-38.com/mcp"}}}.Cline:
cline mcp add x https://x.mcp.2-38.com/mcp --transport http --yes, or in the Cline panel: MCP Servers → Remote Servers, transport Streamable HTTP. When editingcline_mcp_settings.jsonby hand, set"type": "streamableHttp"; without it Cline falls back to legacy SSE, which this server does not offer.Zed: in
~/.config/zed/settings.json, add{"context_servers": {"x": {"url": "https://x.mcp.2-38.com/mcp"}}}.
hermes skills inspect https://raw.githubusercontent.com/kandotrun/x-mcp/main/skills/x-mcp/SKILL.md
hermes skills install https://raw.githubusercontent.com/kandotrun/x-mcp/main/skills/x-mcp/SKILL.md --category social-media -y
hermes mcp add x --url https://x.mcp.2-38.com/mcp
hermes mcp test xhermes mcp add is interactive: answer n when it asks whether the server needs authentication, then enable all tools. Agents and scripts should add this entry to ~/.hermes/config.yaml instead:
mcp_servers:
x:
url: "https://x.mcp.2-38.com/mcp"Start a new session or run /reload-mcp after changing configuration. Hermes prefixes tool names with mcp_x_, for example mcp_x_get_post.
For clients that use mcpServers, start with:
{
"mcpServers": {
"x": {
"url": "https://x.mcp.2-38.com/mcp"
}
}
}Some clients use servers instead, or require an explicit transport/type field. Select HTTP / Streamable HTTP, with no authentication, and keep the same URL. The server is stateless: it answers POST /mcp and returns 405 for GET and DELETE, so there is no legacy SSE stream. A client that only runs local stdio servers can use a bridge:
{
"mcpServers": {
"x": { "command": "npx", "args": ["-y", "mcp-remote", "https://x.mcp.2-38.com/mcp"] }
}
}2. Try a lookup
Ask your connected agent:
Show me @jack's latest 2 posts with links.
The corresponding tool call is get_profile_statuses with:
{ "handle": "jack", "count": 2 }Tool results are compact JSON in MCP text content. A single post from get_post with { "id": "https://x.com/jack/status/20" } looks like this:
{"post":{"id":"20","url":"https://x.com/jack/status/20","created_at":"2006-03-21T20:50:14Z","author":{"handle":"jack","name":"jack","verified":true},"text":"just setting up my twttr","lang":"en","metrics":{"replies":19262,"reposts":126282,"quotes":8063,"likes":324575,"bookmarks":25521}}}Tools
Choose the narrowest tool for the question. These are tool arguments, not raw HTTP requests.
You want to… | Tool | Example arguments |
Fetch a known post |
|
|
Look up a public profile |
|
|
Read an account's recent posts |
|
|
Read an account's media posts |
|
|
Read an account's X Articles |
|
|
List an account's followers |
|
|
List the accounts it follows |
|
|
List who reposted a post |
|
|
See trends |
|
|
Search public posts (unavailable upstream now) |
|
|
Get account/query suggestions (unavailable upstream now) |
|
|
Deprecated: static summary of upstream endpoints |
|
|
idaccepts post URLs (x.com,twitter.com, mobile,/photo/1and?s=20suffixes) or numeric IDs as strings.handleacceptsjack,@jackorhttps://x.com/jack.countaccepts 1–100 and defaults to 10; the server enforces it.get_profile_statusestakesinclude_replies: truefor replies.response_format: "detailed"returns the full upstream objects (several times larger) instead of the concise fields.Replies to a post and whole threads cannot be listed.
Results and errors
Single objects return {post} or {user}. Lists return:
{"posts":[...],"returned":2,"has_more":true,"next_cursor":"xc1...."}users replaces posts for account lists. While has_more is true, pass next_cursor back unchanged as cursor to continue. Cursors are bound to the tool and its arguments, and 0.1 raw upstream cursors still work. note explains short or empty results, and no result exceeds 30,000 characters.
Errors are tool results with isError: true:
{"error":"Keyword search is unavailable upstream right now (HTTP 503). This is not caused by your query, and retrying will not help.","code":"feature_unavailable","retryable":false,"hint":"This query asks for posts from @jack: call get_profile_statuses with {\"handle\":\"jack\",\"count\":10} and filter the results yourself.","upstream_status":503}code is one of invalid_argument, invalid_cursor, not_found, restricted, feature_unavailable, rate_limited, timeout, upstream_unavailable or internal. Retry only when retryable is true. Report upstream errors as failures, not as empty results. See CHANGELOG.md for what changed from the 0.1 {upstreamUrl, status, data} output.
How it works
flowchart LR
agent["AI agent / MCP client"] -->|Streamable HTTP| worker["x-mcp · Hono Worker"]
worker -->|Public GET requests| proxy["twitter.2-38.com/api/fx/2/…"]
proxy -->|Upstream response| worker
worker -->|Compact JSON in MCP text content| agentThe Worker exposes twelve read-only tools through the MCP TypeScript SDK. It calls the existing public proxy at https://twitter.2-38.com/api/fx, normalizes and trims the responses, and pages through them for you; it does not connect to your X account.
Endpoint | Purpose |
Streamable HTTP MCP endpoint for clients (POST only) | |
Discovery metadata and tool names | |
Worker health, version and configured upstream base; does not test upstream availability |
Scope and limits
Public and read-only. No posting, liking, reposting, following, DMs, notifications, private accounts or authenticated timelines.
Queries leave your client. They are sent to this public Worker and
twitter.2-38.com. Keep secrets, private data and access tokens out of tool arguments.Upstream-dependent data. Availability, rate limits and response shape depend on
twitter.2-38.com. A connected MCP server can still return upstream errors.Bounded requests. Request bodies are limited to 64 KiB and tool arguments to 32 elements. Each tool call makes at most 3 upstream requests, each with a 10-second timeout, and one HTTP request (including a JSON-RPC batch) at most 10.
Stateless pagination.
next_cursorremembers which posts of the current upstream page were already returned, so posts deleted or added between calls never make another post go missing. Posts added at the top after the first call are normally skipped; omitcursorto start again from the newest. A post that appears on two different upstream pages can be returned twice, so de-duplicate byid. When the upstream answers a later page of an account's list with "not found", which it sometimes does by mistake, the server asks once more; if the page stays "not found", or a page that still had unread posts comes back empty, it returns a retryableupstream_unavailableerror instead of ending the list early. A garbage 0.1-style raw cursor makes the upstream restart from the newest page.Client-dependent setup. Configuration keys and skill installation differ by client. The URL and Streamable HTTP transport remain the same.
Development
For working on the Worker, you need Node.js 24 or later, pnpm 12 (installation; Node 25 and later no longer bundle Corepack) and, optionally, just. From a fresh clone:
git clone https://github.com/kandotrun/x-mcp.git
cd x-mcp
pnpm install
just check # wrangler types + TypeScript for src and tests
just test # vitest
just dev # http://localhost:8787/mcp, using wrangler.example.jsonc
just smoke # MCP smoke test against the local server (add --offline to skip upstream calls)
just build # bundle the Worker without deployingEvery recipe has a pnpm run equivalent in package.json. CI runs check, test, build and an offline smoke test in workerd.
Path | Contents |
Agent-facing contract: tool schemas and descriptions, output envelopes, messages, limits | |
Pure logic: input normalization, cursors, pagination, projection, error classification | |
The only I/O: upstream routes, HTTP client, per-call session | |
Tool handlers, MCP server wiring, Hono routes | |
Unit and MCP-level tests with synthetic fixtures; end-to-end smoke test | |
Agent installation, configuration and usage guide | |
English and Japanese copy/paste prompts | |
Deployment template with a placeholder account ID |
Worker vars:
Var | Default | Meaning |
|
| Upstream proxy base (https only) |
|
| Only changes tool wording; set |
Deploy your own Worker
Copy the example config, set your Cloudflare account ID and your own route/domain in wrangler.jsonc, then deploy:
cp wrangler.example.jsonc wrangler.jsonc
# edit account_id and routes in wrangler.jsonc
just deploywrangler.jsonc is gitignored. Keep account-specific configuration, .dev.vars, .env*, tokens and API keys out of Git.
Verify a deployment
For the hosted instance (pass your own URL for your deployment):
curl -fsS https://x.mcp.2-38.com/health
curl -fsS https://x.mcp.2-38.com/.well-known/mcp.json
just smoke-remote # or: pnpm run smoke https://x.mcp.2-38.com/mcpThe smoke test connects as an MCP client, checks tools/list, reads https://x.com/jack/status/20 with get_post (expecting "just setting up my twttr") and pages through get_profile_statuses. It also warns when SEARCH_ENABLED no longer matches the live search state. A working health/discovery endpoint alone does not prove data retrieval.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Official MCP server for twitterapis.com. Twitter/X search, users, DMs, Grok, monitoring and writes.
Hosted TwitterAPI.io MCP: read-only Twitter/X search, users, followers, replies, quotes, trends.
Official TwitterAPI.io MCP (canonical: io.twitterapi/mcp-server). Tweets, users, followers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA read-only X/Twitter MCP server that enables data retrieval for user profiles, tweets, and social graphs using OAuth 2.0 Bearer Token authentication. It supports searching recent tweets, viewing timelines, and tracking engagement metrics like followers, likes, and retweets.3MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server for public X/Twitter search and retrieval via twitter.2-38.com-
- AlicenseBqualityDmaintenanceRead-only X/Twitter research MCP server using xAI's Responses API. Supports OAuth login for X Premium users and falls back to API key authentication.5MIT
- AlicenseAqualityBmaintenanceMCP server for the Twitter/X API, enabling search, user profiles, tweets, followers, and more via natural language.94699 npm7MIT