convez.ai
PluginIntegração & APIsIntermediário
rcmiskin10

x-poster

rcmiskin10/x-poster

Poste no X do Claude — redija, visualize custo, confirme, publique.

Ver no GitHub
BomPluginScore · de 0 a 100

Plugin para postar no X (Twitter) diretamente do Claude sem sair da sessão. Você redige falando naturalmente, visualiza o custo estimado, e confirma antes de publicar. Usa sua própria app X (pay-per-use, ~$0,015/post) com autenticação OAuth segura e nunca publica automaticamente.

Instalação

$npx convez-ai rcmiskin10/x-poster

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
2
Forks
0
Acompanhando
0
Saúde
57%
Último commit
há 3 meses
Versão
v1.12.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Compartilhar insights e descobertas técnicas durante sessões de desenvolvimento
  • Publicar atualizações em tempo real sem sair do fluxo de trabalho
  • Manter um registro das realizações sem contexto-switch para redes sociais

Veredito

Solução pragmática e bem pensada para quem precisa manter presença social sem interromper o fluxo de desenvolvimento. O modelo de custo transparente (BYO X app) e a garantia de nunca auto-publicar eliminam riscos comuns. Recomendado para desenvolvedores e makers que usam Claude Code regularmente.

README

A tradução para o português deste README ainda está na fila.

x-poster

Post to X without leaving Claude Code. Just say what you're thinking.

You're deep in a build session. A thought lands. A realization, a hot take, the thing you just figured out. Normally it dies in the terminal, or in a notes file you never reopen.

x-poster gives that thought a mouth. You talk to Claude like you already do. It drafts the tweet in your voice, shows you the cost, and posts only when you say "ship it."

No browser tab. No context switch. No autospam.


What's new: MCP connector

The same posting capability is now available as MCP tools — usable in both Claude Desktop and Claude Code (and MCP-for-Windows). Two tools surface the never-auto-publish contract at the protocol level:

  • preview_post — always call this first. Pure, zero network I/O. Returns a cost estimate and a confirm_nonce valid for 10 minutes.
  • publish_post — the only writer. Recomputes cost server-side, then either uses MCP elicitation (if the client supports it) or requires the confirm_nonce from preview_post. Nothing posts without an explicit confirmation step.
  • authorize — one-time account connection, right in the chat: it returns a link, you click Authorize on X, done. No terminal, no scripts.
  • auth_instructions — setup help (the X-app checklist and auth options).

Cost: ~$0.015/post, ~$0.20/post-with-URL — X pay-per-use, billed to your own X app (set daily and monthly caps in the X developer portal). Drafting is covered by your Claude subscription.


What it costs

Two sides to the bill — one you already pay, one is small but real:

  • The AI side: covered by your Claude subscription. x-poster doesn't run its own AI. Drafting happens inside your Claude Code session, so it's covered by the Claude subscription you already pay for — no separate AI API billing.
  • The posting side: X pay-per-use, billed to your own X app. Roughly $0.015 (about a cent and a half) per post, and ~$0.20 per post that contains a URL. This is X's pricing, not ours — you bring your own X developer app and the charges go straight to it. Every post shows you its estimated cost before you confirm, and with no credentials the poster cannot spend at all.
  • Set spending caps. In the X developer portal you can set daily and monthly spend limits on your app, so a runaway bill is structurally impossible.

The software itself is open source (MIT) — no service fee, no hosted middleman.

You bring: a Claude Code subscription you already have, and your own pay-per-use X developer app.

What it does

  • Draft by talking. /x-poster:x-post draft a post about what I shipped today gives you a tweet in your voice. Or hand it final text and it posts that verbatim.
  • Single tweet, thread, or image. Linear threads and one image (via X's v2 media upload).
  • Long-form ready. Character count doesn't block posting — long-form (X Premium) content works out of the box, and X enforces your account's real limit at publish. Set X_MAX_TWEET_CHARS=280 if you'd rather keep the classic limit enforced locally.
  • Cost preview before you spend. Every draft is dry-run priced and character-checked first.
  • A hard never-auto-publish gate. Nothing leaves your machine until you confirm. With no credentials the poster refuses to post at all, so a bare run literally cannot spend.
  • Your voice, your rules. Point it at your own voice file and your own banned-phrase list.
  • Token hygiene built in. OAuth2-PKCE bootstrap, refresh-token rotation persisted for you.

Who it's for

Indie hackers vibing in Claude Code who have good thoughts mid-build and want them out in the world the moment they land, without breaking flow to open X, write, and post. If your best material dies in the terminal, this is for you.


Set up in ~5 minutes — no terminal needed

Three steps, all in your browser and Claude. This is the recommended path for everyone.

Step 1 — Create your X app

This is the only fiddly part, and it's a one-time copy-paste exercise. Signing up costs nothing; posting bills your app pay-per-use (~$0.015/post — see What it costs).

  1. Go to developer.x.com, sign in with your X account, and create a Project + App on the pay-per-use plan. While you're there, set daily and monthly spend caps on the app so your bill has a hard ceiling.

  2. Open your app's User authentication settings → Edit and enter exactly:

    SettingValue
    App permissionsRead and write
    Type of AppWeb App, Automated App or Bot (confidential client)
    Callback URI / Redirect URLhttp://127.0.0.1:8723/callback
    Website URLanything, e.g. your X profile URL

    If your portal shows a scopes picker, enable: tweet.read, tweet.write, users.read, media.write (image upload), offline.access (stay signed in).

  3. Save, then copy the Client ID and Client Secret it shows you (Keys and tokens tab). Keep them somewhere safe for the next step.

Step 2 — Install the connector

  1. Download x-poster-<version>.mcpb from the latest release.
  2. Double-click it (Claude Desktop), or drag it into Claude settings → Extensions / Connectors.
  3. Paste the Client ID and Client Secret when prompted. Leave the Refresh Token field blank. They're stored in your OS keychain — you won't be asked again.

Step 3 — Connect your X account (in the chat)

Tell Claude:

authorize x-poster

It replies with a link. Open it, click Authorize app, and you'll see "Authorized ✓ — you can close this tab." That's it. Now try:

post a tweet: hello from x-poster

Claude previews the post and the cost first, and nothing publishes until you say yes.

Building the bundle yourself instead: bash scripts/build-mcpb.sh outputs x-poster.mcpb; install it the same way.


Use in Claude Code via the plugin

The plugin auto-registers the MCP server via .mcp.json; no claude mcp add needed. A SessionStart hook installs the MCP SDK to ${CLAUDE_PLUGIN_DATA}/node_modules on first launch (needs network once; subsequent launches use the local cache).

Credentials for the plugin MCP server. The plugin has no GUI, so supply creds one of two ways:

  • Set X_ENV_FILE=/abs/path/to/x-poster.env (the same file the /x-poster:x-post slash command uses). The MCP server reads it at startup.
  • Or export X_CLIENT_ID, X_CLIENT_SECRET, X_REFRESH_TOKEN in your shell before launching Claude Code.

process.env always wins over the env file if both are present.

Manual fallback (if the plugin path is unavailable):

claude mcp add x-poster \
  -e X_ENV_FILE=/abs/path/x-poster.env \
  -- node /abs/path/_packages/x-poster/mcp/server.mjs

The slash command (unchanged)

/plugin marketplace add rcmiskin10/x-poster
/plugin install x-poster@x-poster

Then a one-time setup: create your own X app, mint a refresh token, and point the plugin at your env file with /plugin configure x-poster. Full steps in plugins/x-poster/README.md, about 5 minutes.

/x-poster:x-post draft a post about the bug I just killed

It drafts, scores against a built-in bookmarkability rubric, dry-runs the cost, and asks "ship it?" Nothing posts until you say so.


CLI alternative: mint the refresh token in a terminal

Prefer env files over the in-chat authorize tool (e.g. for the slash-command path)? Same X app as Step 1 above, then:

node --env-file=./x-poster.env bin/x-auth.mjs

A browser opens — click Authorize. The script prints X_REFRESH_TOKEN=…. Paste that line into your env file. The token stays on your machine; nothing is committed.

(If port 8723 is taken, pick another, set X_AUTH_PORT, and register the matching callback URL.)


⚠️ Token rotation — read this before you start

X refresh tokens are single-use and rotate. Every post consumes the current token and X issues a new one. x-poster persists the rotated token to a local state file so you are never locked out. The resolution order for the state file is:

  1. X_STATE_FILE env var (if set)
  2. ${CLAUDE_PLUGIN_DATA}/token (Claude Code plugin path)
  3. ~/.local/state/x-poster/token (XDG default)

What this means in practice:

  • The X_REFRESH_TOKEN value you enter at install time (keychain) or in your env file is a one-time seed. After the first post, the live token lives in the state file — not the keychain or the env file.
  • If you delete or lose the state file, just re-connect: run the authorize tool again (or re-run bin/x-auth.mjs and update X_REFRESH_TOKEN in your env / keychain).
  • Do not run two posting sessions against the same seed concurrently. The second post will burn the same token the first just rotated away, causing a 401.

What it is NOT

  • Not an autoposter. There is no "post while I sleep" mode, by design. The human gate is the point, and it's also what keeps the AI side on your Claude subscription (an always-on version would bill the Claude API on top of X's per-post charges).
  • Not a growth-hack bot. One thought, one confirmation, one post.
  • Not a hosted service. It runs on your machine, with your keys, on your subscription.

How it works

Three pieces, cleanly split:

  • Core (core/poster.mjs, core/token-store.mjs): zero-dependency Node. OAuth, posting, threads, image upload, dry-run cost, token rotation. Calls no AI. Vendored byte-for-byte into every surface by scripts/vendor-core.sh; drift is caught by CI.
  • MCP server (mcp/server.mjs): MCP stdio server. Exports makeTools (pure, testable), makePostAdapter, startServer. Requires @modelcontextprotocol/sdk (isolated to mcp/).
  • Plugin payload (the /x-poster:x-post command): runs in your Claude session, does the drafting and scoring. This is where the "just by talking" comes from.

That split is why your subscription covers the smart part and the tool costs nothing to run.

License

MIT.

Ver o original no GitHub

Bom para

Relacionados