Skip to main content
Glama

surfagent-x

X adapter for SurfAgent.

This adapter gives AI agents X-native verbs for navigation, extraction, posting, replies, likes, reposts, proof-first task execution, recovery, and deeper research workflows.

What this adapter is for

Use surfagent-x when you need reliable X workflows like:

  • opening key X surfaces

  • checking route-specific state

  • extracting timelines, profiles, communities, posts, and threads

  • creating posts and replies

  • liking posts

  • running X-specific recovery flows

  • doing broader topic or community research with receipts

Related MCP server: Spectre

Why this exists

X is not a generic website.

It has:

  • route-specific UI states

  • React-sensitive composer behavior

  • flaky button-state signals

  • community-specific flows

  • delayed state settlement after actions

So this adapter wraps X-specific navigation, action, verification, and recovery into dedicated tools.

It also now bakes in some hard-won X lessons:

  • account switching uses a trust hierarchy instead of one weak extraction pass

  • flaky switcher or composer states can trigger visual snapshot escalation

  • composer flows auto-recover with real typing when text appears present but X still keeps submit disabled

  • built-in state maps help agents reason about switcher, composer, and community surfaces faster

Core tool groups

Health and setup

  • x_health_check

  • x_open

Navigation and state

  • x_get_state

  • x_get_state_map

  • x_open_home

  • x_open_profile

  • x_open_notifications

  • x_open_search

  • x_open_post

  • x_get_timeline

  • x_search_posts

  • x_open_community

  • x_search_communities

  • x_search_profiles

  • x_get_community_feed

  • x_extract_community

  • x_extract_post

  • x_extract_profile

  • x_get_profile_posts

  • x_get_post_thread

Actions

  • x_get_composer_state

  • x_create_post

  • x_reply_to_post

  • x_like_post

  • x_repost_post

  • x_follow_profile

  • x_engage_post_task

  • x_quote_post_task

  • x_verify_text_visible

  • x_recover

Autonomous research

  • x_research_topic

  • x_map_community

Receipts and saved runs

Autonomous research tools can optionally save bundles to disk.

Default output path:

  • ~/.surfagent/receipts/x-research

Saved runs can include:

  • bundle.json

  • summary.json

  • receipts.json

  • per-dataset JSON files

  • SUMMARY.md

How to use it

Run this adapter alongside the base SurfAgent MCP.

{
  "mcpServers": {
    "surfagent": {
      "command": "npx",
      "args": ["-y", "surfagent-mcp"]
    },
    "surfagent-x": {
      "command": "npx",
      "args": ["-y", "surfagent-x"]
    }
  }
}

CLI task runner

For repeatable X actions, prefer the built-in deterministic task runner over a live improvised browser loop.

surfagent-x task engage-post --account reggiesurfagent --url https://x.com/surfagentapp/status/123 --repost
surfagent-x task quote-post --account solvingdilemma --url https://x.com/surfagentapp/status/123 --text "Real browser-native agents need proof, not vibes."

Each task run writes a journal plus screenshots under:

  • ${SURFAGENT_RUN_DIR:-$TMPDIR/surfagent-x-runs}

If you are new to SurfAgent, start here first:

When to use this vs skills vs raw MCP

  • use surfagent-mcp for raw browser control

  • use surfagent-skills for workflow rules and operating discipline

  • use surfagent-x when you want reliable X-native verbs instead of rediscovering X every run

Environment variables

  • SURFAGENT_DAEMON_URL default: http://127.0.0.1:7201

  • SURFAGENT_AUTH_TOKEN optional override, otherwise auto-detected

  • SURFAGENT_RUN_DIR optional override for task-runner journals and screenshots

Status

Early, but already one of the more capable SurfAgent adapters.

License

MIT

Available Tools

38 tools
x_community_post_taskB

Run a deterministic community-post task with membership check, screenshots, composer recovery, and feed verification.

Inputs: url (required), text (required), account (required), join.

x_create_postA

Create a new X post from the home composer with button-state verification and automatic real-typing fallback if X rejects the initial input.

Inputs: text (required).

x_engage_post_taskB

Run a deterministic engage-post task with account switch, screenshots, optional like/repost actions, and a persisted run journal.

Inputs: url (required), account (required), like, repost.

x_extract_communityC

Open a community and return structured community metadata, including name, description, member/post hints, and join state when visible.

Inputs: url (required).

x_extract_postB

Open a post and return a structured post record with author, text, media, and visible stats.

Inputs: url (required), tabId.

x_extract_profileB

Open a profile and return a structured profile record with bio, stats, and pinned post when visible.

Inputs: username (required), tabId.

x_follow_profileB

Follow an X profile and verify the resulting follow state from the active account.

Inputs: username (required), tabId.

x_follow_profile_taskB

Run a deterministic follow-profile task with account switching, screenshots, and profile-state verification.

Inputs: account (required), username (required).

x_get_accountsB

Inspect the active X account and any account-switcher entries currently visible.

Inputs: no named parameters.

x_get_community_feedA

Extract visible posts from the current or specified X community feed.

Inputs: url, limit.

x_get_composer_stateA

Inspect the current X composer state, including whether the Post/Reply button is enabled.

Inputs: no named parameters.

x_get_post_threadA

Open a post and extract the visible thread/timeline around it as structured post rows.

Inputs: url (required), limit, tabId.

x_get_profile_postsC

Open a profile and extract visible posts from that profile timeline.

Inputs: username (required), limit, tabId.

x_get_stateA

Get structured X page state for the current tab: route, page kind, selected tabs, composer state, and account info.

Inputs: no named parameters.

x_get_state_mapB

Return the built-in X state maps for flaky surfaces like account switcher, composer, community, home, post, and profile.

Inputs: surface.

x_get_timelineC

Extract the currently visible X timeline posts with author, text, status URL, and social action labels.

Inputs: limit.

x_health_checkA

Check whether X is open in SurfAgent, identify current X page state, and report composer/account readiness.

Inputs: no named parameters.

x_like_postB

Like a specific X post and verify resulting button state.

Inputs: url, tabId, postId, username.

x_map_communityB

Run an autonomous community mapping pass: open a community, extract feed rows, and profile a sample of visible participants.

Inputs: url (required), save, query, feedLimit, +2 more.

x_openB

Open X in SurfAgent. Optionally choose a starting section such as home, notifications, search, or a profile path.

Inputs: path.

x_open_communityB

Open an X community URL directly. Useful because community navigation has its own weird composer behavior.

Inputs: url (required).

x_open_homeB

Open the X home timeline and wait for a settled X page state.

Inputs: no named parameters.

x_open_notificationsB

Open X notifications.

Inputs: no named parameters.

x_open_postC

Open a specific X post by full URL or by username + status ID.

Inputs: url, tabId, postId, username.

x_open_profileC

Open a profile by username.

Inputs: username (required).

x_quote_post_taskB

Run a deterministic quote-post task with screenshots before and after submit, account switching, and profile-level verification.

Inputs: url (required), text (required), account (required), like.

x_recoverB

Apply lightweight X recovery actions for common stuck states: composer, home, or target URL.

Inputs: url, mode.

x_reply_post_taskB

Run a deterministic reply-post task with account switching, screenshots, and post-surface verification.

Inputs: url (required), text (required), account (required), like.

x_reply_to_postB

Reply to a specific post with pre-submit composer verification, automatic real-typing fallback, and post-submit visibility verification.

Inputs: text (required), url, tabId, postId, +1 more.

x_repost_postB

Repost a specific X post and verify the resulting repost state.

Inputs: url, tabId, postId, username.

x_research_topicB

Run an autonomous X research pass for a topic, with retries, receipts, post/thread/profile extraction, and community sampling.

Inputs: query (required), save, outputDir, postLimit, +3 more.

x_search_communitiesC

Search X communities and return community cards/links discovered on the search surface.

Inputs: query (required), limit.

x_search_postsC

Search X posts and return extracted live results from the search timeline.

Inputs: query (required), limit.

x_search_profilesC

Search X profiles and return discovered accounts with display names, handles, bios, and URLs.

Inputs: query (required), limit.

x_switch_accountA

Switch X accounts through the in-session account switcher and verify the resulting active account state.

Inputs: account (required).

x_switch_account_and_act_taskC

Run a deterministic account switch followed by a focused action like open-home, open-url, or follow-profile.

Inputs: action (required), account (required), url, username.

x_verify_text_visibleB

Verify that a specific text snippet is visible on X. Scope can target body, article content, or the active composer.

Inputs: text (required), scope.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 38 tools

    Disambiguation3/5

    Primitive actions and deterministic task wrappers overlap heavily (e.g., x_reply_to_post vs x_reply_post_task, x_follow_profile vs x_follow_profile_task, x_switch_account vs x_switch_account_and_act_task). Multiple post-reading tools also overlap (x_open_post, x_extract_post, x_get_post_thread). Descriptions help distinguish them, but an agent must read carefully to avoid misselection.

    Naming Consistency4/5

    Tool names are consistently snake_case with an x_ prefix and generally follow a verb_noun pattern. Minor deviations exist: retrieval verbs mix get and extract, and some names are bare verbs or multi-word task names. The pattern is still predictable overall.

    Tool Count2/5

    With 38 tools, the surface is heavy for a single-domain server. Many high-level task wrappers duplicate simpler primitives (reply, follow, switch-account), inflating the count beyond what the core X automation domain requires.

    Completeness4/5

    The set covers core X lifecycle operations: open, read, search, post, reply, like, repost, follow, communities, accounts, state, and health. Missing operations like delete post, unfollow, unlike, and direct messages are notable but agents can work around most core workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to interact with Twitter/X through Playwright browser automation without requiring an official API key. It provides tools for posting content, searching tweets, reading feeds, and managing social interactions like follows and likes.
      5
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables AI agents to search, read user profiles, timelines, media, follow threads, track trends, and manage accounts on X/Twitter via GraphQL, without browser automation or paid API keys.
      113
      90 PyPI
      13
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to fully automate X/Twitter interactions including searching, posting, engaging, and managing multiple accounts without paid API keys.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides 19+ tools for AI agents to interact with X/Twitter, including search, posting, analysis, and monitoring capabilities.
      24 npm
      3
      MIT