X-Agent

A Twitter/X automation agent combining free reads (cookie-auth CLI) with official API writes (xmcp MCP server). Two-backend design: Agent Reach for search/read, official OAuth for tweets/DMs.

Architecture

Two-backend split driven by cost:

Path Tool Auth Cost
Read/Search twitter-cli (Agent Reach) Cookie-based $0
Write (tweet, DM, retweet) xmcp MCP server OAuth 1.0a (OOB/PIN flow) X API credits

The xmcp server runs as a Cursor MCP (start-xmcp.sh), routing rules in .cursor/rules/x-agent.mdc direct the agent to pick the right backend per action.

Official X API agent surface

Chris Park's April 2026 self-thread matters because X moved from "API endpoint plus docs" toward an explicit agent-facing surface: Pay-Per-Use availability, XMCP/xurl for agents, official Python and TypeScript XDKs, and an API Playground. Current X docs list official Python and TypeScript SDKs, xurl, API Playground, agent resources, and MCP servers as first-class tools. Source: X/@chrisparkX self-thread, 2026-04-05; Source: X docs, checked 2026-07-04

The current MCP docs expose two hosted servers: X MCP at https://api.x.com/mcp for API actions and Docs MCP at https://docs.x.com/mcp for documentation search. The full user-context route is the local xurl mcp bridge, which performs OAuth 2.0 PKCE and injects a fresh bearer token; app-only bearer can connect directly for read-only endpoints. This updates the original X-Agent design: keep the cost split, but treat official docs MCP + xurl bridge as the current source of truth before extending the older local xmcp setup. Source: X MCP docs, checked 2026-07-04

Source snapshot

As of 2026-07-04, xdevplatform/xmcp is an unlicensed public repo on default branch master, HEAD 63d34362d88ed9f94d54ccd5ecd5bb4d12e11759, pushed 2026-04-09T19:59:20Z, with 829 stars, 123 forks, 17 open issues, and no release tags returned by the source check. xdevplatform/xurl is MIT-licensed, default branch main, npm package @xdevplatform/xurl@1.2.2, GitHub HEAD bfb0f365d14f5ed63416d29aa3abbb21a613f5cb, latest tag v1.2.2, pushed 2026-06-29T22:50:53Z, with 1,252 stars, 105 forks, and 7 open issues. The TypeScript XDK package is @xdevplatform/xdk@0.5.0. Source: npm/GitHub source checks, 2026-07-04

Key Decisions

  1. OOB/PIN OAuth for desktop use - no callback server needed. Token cached to .oauth_tokens for persistence across sessions. Source: Cursor transcript, 2026-04-07
  2. Read + Write + DM permissions on the X Developer Portal app. Required Basic tier ($200/mo credits) for DM access. Source: Cursor transcript, 2026-04-07
  3. Voice/content gated - agent drafts posts using social-draft and content-strategy skills but never posts without user approval. Source: Cursor transcript, 2026-04-07

Repo Maintenance

Also used as a workspace for batch-updating GitHub repo metadata: ran gh repo edit across ~38 repos under Kevin-Liu-01 to improve About sections and add consistent topic tags. Source: Cursor transcript, 2026-04-07


Timeline