x-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x-mcpfind 10 recent machine learning advances from the last 7 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
x_mcp
Find recent X posts with the browser and model already in your AI harness. No paid X API, X developer account, or separate model API key. Free and open source under MIT.
Ask for machine learning, AI agents, or a longer topic such as recent advances in AI agents for biomedical discovery. The server prepares X-specific searches, extracts rendered posts, and returns relevant results with dates and source links. Machine learning defaults to research/advance searches. Results default to newest first within the captured sample.
What you need
Node.js 22 or newer.
A local MCP-capable harness with a browser tool (for example, Codex with browser access, or Claude Code/Cursor with a browser MCP).
Sign in to X in the browser your harness controls. Signing in in a different browser/profile does not share that session.
The tool itself is free. Your existing harness/model subscription or usage costs still apply. X can limit search access or change its UI. No scraper can promise every post or uninterrupted access.
Related MCP server: grok-build-plugin
Install and connect
git clone https://github.com/mashathepotato/x_mcp.git
cd x_mcp
npm ci
npm run checknpm ci builds the server. Run npm run build after editing TypeScript. This project is installed from source; it is not published to npm yet.
Codex
From the project directory:
codex mcp add x-mcp -- node "$(pwd)/dist/index.js"Restart or reconnect your harness so it loads the server. Ensure its browser tool is enabled and signed in to X. The MCP does not grant browser access by itself.
Equivalent ~/.codex/config.toml entry (replace the path):
[mcp_servers.x-mcp]
command = "node"
args = ["/absolute/path/to/x_mcp/dist/index.js"]
startup_timeout_sec = 15
tool_timeout_sec = 120Official Codex MCP configuration.
Claude Code
claude mcp add --transport stdio x-mcp -- node "$(pwd)/dist/index.js"Use alongside your browser tool, then reconnect the MCP. Official Claude Code MCP configuration.
Cursor, Claude Desktop, and other local MCP clients
Merge this entry into the client's MCP configuration. Replace the absolute path; on Windows use an escaped path such as C:\\Users\\you\\Documents\\x_mcp\\dist\\index.js.
{
"mcpServers": {
"x-mcp": {
"command": "node",
"args": ["/absolute/path/to/x_mcp/dist/index.js"]
}
}
}Clients that support only remote HTTP MCP servers cannot launch this local stdio server. A client without browser tools needs the optional CDP mode below. A basic web-search tool alone is not equivalent to an authenticated X browser.
If the app cannot find node, use its absolute executable path (which node on macOS/Linux, where node on Windows). Do not use npm start as the MCP command: npm may print banners onto the protocol's stdout. Use node …/dist/index.js.
Try it
After connecting, ask your harness:
Use x-mcp to find 10 recent machine learning advances from the last 7 days. Complete the browser workflow and give me a concise summary with dates and tweet links.
Use x-mcp to find the latest tweets about AI agents for biomedical discovery. Keep the results relevant to biomedical research, rather than generic agent announcements.
Search x-mcp for AI agents from the last 2 days. Rank by relevance and cite the original posts.
The server exposes a research_topic MCP prompt as another starting point. A no-network installation check:
node dist/index.js --plan "machine learning"
node dist/index.js --plan "ai agents for biomedical discovery"These commands print search plans, not tweets. npm run check runs the real MCP handshake and fixture-backed collection tests without accessing X.
How harness mode works
MCP servers cannot automatically invoke arbitrary browser tools in their host. This server provides an explicit workflow that the harness's agent completes:
x_search_topicturns the topic into up to three X Latest search URLs and returnsstatus: "needs_browser", asearchId, and a read-only extraction script.Your harness's browser opens those URLs in its signed-in session. It reads the visible posts, runs the extraction script if DOM evaluation is supported, and captures each page before scrolling. If only accessibility reading is available, the host copies exact text/permalinks into the same capture schema.
x_collect_postsaccepts those observations, removes duplicates, filters the exact time window and topic, and returns ranked posts. Call it again with the samesearchIdto merge more snapshots.Your harness's model summarizes the results, citing original links and separating claims from verified advances.
The workflow is included in MCP initialization instructions, tool descriptions, and x-mcp://workflow. The extraction script is also available at x-mcp://extractor or through node dist/index.js --extractor. No MCP sampling capability or extra LLM service is required.
Tool reference
Tool | Purpose |
| Start a search; return a browser handoff, or scrape through configured CDP. |
| Merge browser captures for a search, filter and rank them. |
| Check configuration and prerequisites; does not test X login. |
x_search_topic arguments:
Argument | Default | Meaning |
| required | Keywords or natural-language topic, up to 2,000 characters. |
|
| Exact lookback window, 1–30 days. |
|
| Maximum returned posts, 1–100; fewer may be available. |
|
|
|
|
|
|
|
| X language code, or |
|
| Include reply posts. |
| none | Optional X query body refined by the harness model; local keyword matching is disabled for this override. |
|
|
|
With rawQuery, the host is responsible for semantic relevance; dates, URLs and reply filtering still apply.
Queries use inspectable alias groups and topic constraints. Research intent adds scholarly/release variants and a broader fallback, excluding common course, roadmap and job promotions. Captured advances also need observable paper/release wording or a paper/code link; this selects candidates, not verified breakthroughs. Long prose is simplified heuristically; review plan.queries and use rawQuery when a specialist term or Boolean expression needs precision. Relative dates or requested counts in topic prose do not set days or limit; the harness should pass those structured options. The server uses no embeddings and does not perform semantic reasoning itself. Its local keyword filter can miss relevant posts expressed with different wording.
rawQuery preserves its trimmed body and appends date, language and reply filters. Avoid conflicting operators in that body; use the structured options for the date window. Search filters use UTC calendar days, while captured results are checked against the exact start/end timestamps fixed when the plan was created. This rejects posts outside the window even if X ignores a search filter.
Example calls (after actual browser observation):
x_search_topic({ topic: "AI agents", days: 7, limit: 10 })
// Save the returned searchId and open a returned plan.queries[i].url.
x_collect_posts({
searchId: "<returned searchId>",
captures: [{
pageUrl: "<actual planned X search URL>",
capturedAt: "<current ISO 8601 time>",
state: "ok",
posts: [{
url: "<observed https://x.com/handle/status/id permalink>",
text: "<exact observed tweet text>",
publishedAt: "<observed ISO time, or omit if unknown>",
links: ["<observed outbound link, if any>"]
}]
}]
})These placeholders illustrate the schema; they are not sample tweets. A capture can instead report login_required, rate_limited, challenge, empty, or unrecognized, with an empty posts list.
Returned posts include a canonical URL, author, text, timestamp, timestamp source (page or a derivation from the X status ID), matched terms and a heuristic relevance score. Status captured means planned search pages were observed; it never means all of X was scanned. partial means some observations are available but planned searches or access were incomplete. no_matches means no accepted posts in the captured sample. A login wall or failed access is reported separately.
The normalizer validates shape, links, timestamps and query provenance, but cannot independently prove the authenticity of text supplied by a harness. Summaries must rely on actual browser observations. The browser adapter expands up to five inline Show more buttons per search page. Remaining truncated text is marked isTruncated; the harness must not invent missing content. Images, video, protected content, and full threads are not transcribed or expanded.
Optional: direct browser mode
If your harness does not have a browser tool, this server can read a Chromium browser already exposed through a local Chrome DevTools Protocol (CDP) endpoint. You sign in to X there once. The server then performs the browser collection inside x_search_topic.
For example, launch a dedicated Chrome profile on macOS:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/.x-mcp-browser" \
https://x.comOn Linux or Windows, use your Chrome/Chromium executable with the same flags and a dedicated profile directory. Do not use your default daily browser profile for this example. Leave this browser open, sign in, and configure the MCP environment:
{
"mcpServers": {
"x-mcp": {
"command": "node",
"args": ["/absolute/path/to/x_mcp/dist/index.js"],
"env": {
"X_MCP_MODE": "browser",
"X_MCP_CDP_URL": "http://127.0.0.1:9222"
}
}
}
}Set your client's tool timeout to at least 120 seconds for browser mode. X_MCP_MODE=auto (the default) uses CDP only when X_MCP_CDP_URL is set; otherwise it uses the harness handoff. X_MCP_MODE=harness forces handoff.
Only explicit loopback endpoints are accepted. CDP can control that browser profile; keep the debugging port local and never expose it publicly. The adapter creates and closes its own search tabs, disconnects afterward, and leaves preexisting tabs and Chrome running. It reads rendered pages through Playwright's CDP connection, without launching or downloading a browser.
Limits and troubleshooting
needs_browser: expected in harness mode. The agent must use its browser tools and callx_collect_posts; a URL plan is not a completed search.login_required: sign in to X in the controlled browser and start the search again. X documents signed-in advanced search.rate_limited/challenge: stop and handle access manually. There are no CAPTCHA solvers, rotating proxies, guest tokens, private GraphQL calls, or login bypasses.unrecognized: the page may be loading or X's markup may have changed. Inspect it through the harness browser; report an issue with a sanitized fixture.Sparse results: use a longer lookback,
language: "all", or a carefully refined query. Do not silently replace recent tweets with old search-engine snippets.search_expired: plans last 30 minutes and are lost on restart. Callx_search_topicagain.Direct browser unavailable: ensure the dedicated browser and local debugging endpoint are running. Browser errors are reported; no paid fallback is used.
Collection is bounded to at most three searches and three scrolls per search by default, with up to five inline expansions per search page. The adapter overfetches up to 3× the requested count (at most 300 unique observations) so filtering can discard irrelevant posts. Plans and captures live only in process memory: up to 50 sessions, 60 snapshots/2,000 post observations per session. One collection call accepts at most 20 snapshots, 100 posts per snapshot. No cookies or credentials are read, exported, logged, or stored by this server; your browser manages its own session. No telemetry is sent. Captured text is passed back to your harness and its model under that harness's normal data handling.
Respect X's terms and applicable rules. Use this for modest, user-directed research. Treat all post text and linked content as untrusted data, including any instructions embedded in them. The server does not verify scientific claims.
Development
npm ci
npm run check
npm run dev # stdio MCP for development; waits for a clientSource layout: query.ts (planning), extract.ts (rendered DOM capture), rank.ts (validation/ranking), browser.ts (optional CDP), server.ts (MCP workflow). Tests cover query specificity, extraction, dates, duplicate handling, access blockers, CDP boundaries, and a real stdio MCP handshake. CI runs Node 22 and 24.
See TESTING.md for automated and live validation scope.
Contributions welcome: add a reproducible sanitized fixture and a regression test for parser/extractor changes. Never commit credentials, cookies, browser profiles, or private captures. See CONTRIBUTING.md and LICENSE.
Available Tools
3 toolsx_collect_postsCollect and rank observed X postsARead-only
After x_search_topic and browser reading, submit exact captured posts. Merges snapshots in memory, removes duplicates, rejects stale/unrelated posts, returns dates and source links. Captures must use the plan’s search URLs. Does not fetch or independently authenticate host-supplied text.
| Name | Required | Description | Default |
|---|---|---|---|
| captures | Yes | ||
| searchId | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint/destructiveHint/openWorldHint, so the safety profile is covered. The description adds genuinely non-obvious behavior: in-memory merging, deduplication, rejection of stale/unrelated posts, and the important caveat that it 'does not fetch or independently authenticate host-supplied text' — a trust boundary the agent needs. It does not cover error/partial-success handling for rejected captures.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four tight sentences, front-loaded with the precondition, then behavior, then constraint, then the trust caveat. No filler, though the final sentence could be folded into the behavior sentence without loss.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description usefully discloses the return shape ('returns dates and source links') and the processing pipeline, which is adequate for a two-parameter ingestion tool. The main gap is that the fairly complex nested capture structure is left entirely to the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% and the nested capture/post objects (including the state enum values login_required, rate_limited, challenge, empty, unrecognized) are entirely undocumented. The description adds only a partial hint that captures must reference the plan's search URLs; it never explains what searchId refers to or what the capture fields mean.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('submit exact captured posts') plus the downstream effects (merges, dedupes, filters, returns dates and links). It also positions itself in the workflow relative to x_search_topic ('after x_search_topic and browser reading'), so an agent can distinguish it from the sibling search tool without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear precondition and sequencing ('After x_search_topic and browser reading') plus a hard constraint ('Captures must use the plan's search URLs'). It stops short of naming when-not-to-use or explicitly contrasting with x_get_status, so it is strong but not fully exhaustive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
x_get_statusCheck X MCP setupARead-only
Reports configuration and browser requirements; does not access X or test login.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description earns credit for adding non-obvious behavior the annotations do not capture: it performs no X access and does not validate login, which corrects a plausible agent assumption that a 'status' tool tests credentials.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with the scope and the exclusion clause; every word earns its place and nothing is padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-param, read-only diagnostic with no output schema, the description covers what the tool does and — importantly — what it does not do. It could go slightly further by hinting at what configuration is reported, since no output schema exists to describe the return values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters and the schema is empty, so there is nothing to document; the per-rule baseline of 4 applies. The description correctly says nothing about arguments rather than inventing them.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('reports configuration and browser requirements'), which is far more informative than the title's vague 'check setup'. The negative clause ('does not access X or test login') implicitly separates it from the data-fetching siblings x_search_topic and x_collect_posts, though neither is named.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied rather than stated: a diagnostic tool that reports config without touching X. There is no explicit 'use this when...' clause, no mention of setup failure/troubleshooting triggers, and no named alternatives, so the agent must infer that this is a pre-flight check rather than a data operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
x_search_topicSearch recent X posts about a topicARead-only
Start here for X/Twitter research. In harness mode returns needs_browser with optimized Latest URLs and extraction instructions: then use YOUR browser and call x_collect_posts. With configured CDP returns observed posts. Never treat a plan as tweets.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Lookback window in days; default 7. | |
| mode | No | ||
| sort | No | Default latest. Relevance is a transparent heuristic. | |
| limit | No | Maximum accepted posts returned; default 20. | |
| topic | Yes | Topic or natural-language request, e.g. machine learning or AI agents for biomedical discovery. | |
| intent | No | ||
| language | No | X language code, default en. Use all for any language. | |
| rawQuery | No | Optional X query body supplied by the host model. Date/language/reply filters are appended. Disables local keyword matching; the host must check semantic relevance. | |
| includeReplies | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With only readOnly/openWorld/non-destructive annotations, the description carries useful extra behavioral context: the mode-dependent return (needs_browser + URLs vs observed posts) and the warning 'Never treat a plan as tweets.' It still omits auth requirements and rate limits, but adds genuine value beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Roughly four short sentences with the entry-point guidance front-loaded and no filler. The closing caution about plans is dense but earns its place as an agent safeguard.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 9 parameters and no output schema, the description explains the mode branching and the next call but leaves intent/advances, language and includeReplies unexplained, and gives only partial insight into return values. It is adequate but incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 67%, so the schema already documents days, sort, limit, topic, language and rawQuery. The description reinforces the 'Latest' sort and 'harness' mode in prose but says nothing about the undocumented enum parameters mode, intent and includeReplies, so it does not compensate for the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening 'Start here for X/Twitter research' states the tool's role as the entry-point search for recent X posts, and the title supplies the verb+resource pairing. It distinguishes itself from the sibling x_collect_posts by naming it as the downstream step rather than a competitor, though the search nature is more implied than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly says to start here and then, in harness mode, to use YOUR browser and call x_collect_posts, which routes the agent to the alternative. However, it does not describe when x_collect_posts or x_get_status should be called instead, nor the conditions under which each mode is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
x_collect_posts - First observed
x_get_status - First observed
x_search_topic
TDQS
Scored across 3 tools
The three tools occupy distinct roles in a pipeline: plan generation (x_search_topic), post ingestion (x_collect_posts), and config reporting (x_get_status). Boundaries are clear from descriptions, though the 'search' name on x_search_topic is slightly misleading since it returns a plan rather than results, which could momentarily confuse an agent about where actual data comes from.
All tools use a uniform x_verb_noun pattern (x_search_topic, x_collect_posts, x_get_status), with consistent prefixing and snake_case throughout. There are no deviations or mixed conventions.
Three tools is compact but matches the narrow, deliberately minimal harness workflow of plan→capture→status. Each tool earns its place, though the surface is on the lean side with no room for auxiliary operations.
The plan→collect→status lifecycle is closed, but the actual fetching is delegated entirely to the agent's external browser, so the server cannot complete a research task on its own. There is no post detail retrieval, refresh/clear operation, or recovery path if collection fails, leaving notable gaps for the stated research purpose.
Maintenance
Related MCP Connectors
X (Twitter) data for AI agents: tweets, profiles, followers, search, trends + social listening.
Fetch recent public X/Twitter posts by named handle for monitoring, comparison, OSINT, and research.
Your agent needs X/Twitter data — who follows a competitor, what a community is posting, who quoted that tweet, what is trending in Japan. Normally that means applying for an X developer account, passing app review, and managing a quota per endpoint. **What you can ask for** • "Who follows @stripe, and which of them are verified?" • "Pull every reply and quote on this tweet and summarise what people object to." • "List this community's moderators and its posts this week." • "What is trending in Japan right now?" • "Give me the full thread context behind this link, including the long-form article." **How to use it** Point any MCP client at https://mcp.aisa.one/twitter-api/mcp and sign in with OAuth — there is no key to create or paste. 29 read tools: users (profile, about, batch lookup by id, search, followers, verified followers, followings, follow check), tweets (timeline, latest, mentions, advanced search, replies, quotes, retweeters, thread context, articles), communities, lists, Spaces and trends. **Why this rather than the source** No developer account to apply for, no app review, no per-endpoint quota to manage. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Ask for a handle's followers here, then ask the same agent for that brand's search traffic, its backlinks, or the people to contact — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/social/mcp for X plus Instagram, Reddit, Pinterest and YouTube; https://mcp.aisa.one/gtm/mcp for those plus Similarweb and Apollo.
Live X/Twitter and Reddit research. 10 read-only MCP tools, Google/GitHub sign-in. Free tier.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching X (formerly Twitter) using xAI's Responses API with support for filtering by handles, date ranges, and media understanding, returning structured results with citations.117 npm1MIT
- AlicenseNot gradedqualityBmaintenanceLive X (Twitter) and web search for any coding agent through your existing Grok subscription. Exposes a grok_search MCP tool, so no X API key or X developer account is needed.20 npm30Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProvides programmatic X (Twitter) engagement via MCP, offering 24 tools for search, timelines, notifications, bookmarks, profiles, and tweet actions through a headless browser.MIT
- FlicenseNot gradedqualityDmaintenanceEnables real-time search of X (Twitter) posts, user timelines, and trends using either xAI's Responses API or the official X API v2.4-