mcp-x: 42 X API tools designed so the model can't burn your money

GoldBroccoli7073 · reddit · 2026-09-10

Finding the only existing X API MCP server abandoned at 64 stars and a single Python file, a developer rewrote it properly in Go: 42 tools across posts, users, lists and media, identical over stdio and http, every tool annotated with readOnlyHint/destructiveHint, returning structured JSON mirrored into the text block for clients that ignore structuredContent.

The core constraint: X killed its free tier and bills reads per resource returned, so asking for 100 results costs 20x asking for 5. Hence tool descriptions that argue for the smallest useful count, a sizing tool that costs no post-read budget, batch lookups, manual pagination, and hard spend ceilings in env vars rather than the model's hands.

Error handling turned out to be most of the work: X returns application/problem+ failures the Go client doesn't parse, so everything is classified into a domain error set surfaced identically from all 42 tools, with non-retryable errors stating "do not retry". The server refuses to start on bad credentials (catching the read-only-token trap where regenerating is required for write perms), and media upload reads only from a required MEDIAROOT with symlinks resolved — otherwise an LLM could read and publish any file on the host. MIT licensed, v0.1.1, with Docker image, prebuilt binaries and an .mcpb bundle.

Related event: Developer builds mcp-x: 42 X API tools designed to stop agents overspending(2 posts)→

Original post →

More from coding & agent

coding & agent channel →