tweet-scheduler-mcp: Why I Built My Own Tweet Scheduler

I was paying Buffer-like tools $7-$12/month to schedule tweets. That's a significant spend in a year to do something that boils down to: hold this text, post it at this time.

I also didn't like that my tweets lived in another SaaS app's UI, disconnected from where I actually think and write — my Obsidian vault. I'd draft something in markdown, copy it into the tool, format it there, schedule it there. Two systems for one piece of content.

So I built tweet-scheduler-mcp. It's an MCP server. Open source, MIT license. I made it public today.

What It Does

Compose, schedule, and post tweets and threads. Two interfaces, same database:

Claude Code/tweet "text" posts immediately. /tweet --schedule "tomorrow 9am" schedules. /tweet --thread composes a thread conversationally with Claude. This is the primary interface for me. I'm already in Claude Code for most of my work; tweeting shouldn't require a context switch.

Terminal CLI — 14 subcommands. tweet-scheduler post, schedule, thread, list, cancel, costs. For scripting and quick one-offs.

Both read and write to the same SQLite database. No sync conflicts, no separate state.

The 30-Second Undo

Post a tweet and you get a 30-second countdown. Cancel it before the timer runs out and the tweet never goes live.

This sounds trivial. It isn't. It changes how you relate to the post button. You stop agonizing over whether to hit send because you know you have a window. The result is you actually post more, and the things you cancel are genuinely worth cancelling.

Gmail figured this out years ago. Twitter tools haven't.

Vault Integration

If you use Obsidian, your tweet drafts live in your vault as markdown files with YAML frontmatter. The MCP server reads them directly. /tweet --from draft.md publishes a vault draft. /tweet --drafts lists what's available.

This means your tweets are version-controlled, searchable, and sitting next to the ideas that spawned them. They're part of your content system, not a separate silo.

Official X API, Pay-Per-Use

No third-party Twitter APIs. No scraping. Direct OAuth 2.0 PKCE authentication with X's API v2.

The pay-per-use tier charges $0.01 per post and $0.005 per read. The tool tracks costs in real-time — per endpoint, per period — with budget alerts. Most months my spend is under $1.

Compare that to Buffer, Typefully, Hypefury — $7-30/month depending on tier. If you're posting 50-100 tweets a month, you're looking at $0.50-1.00 versus $84-360/year.

Threads and Scheduling

Thread support handles reply chaining automatically. First tweet posts standalone, each subsequent tweet replies to the previous one. Schedule an entire thread and it posts as a unit.

Natural language scheduling: "tomorrow 9am", "Friday afternoon", "in 2 hours". A launchd daemon polls every 60 seconds on macOS. It survives sleep/wake. If your machine was off and a tweet is overdue by more than 6 hours, it gets marked missed instead of posting stale content into the timeline.

Technical Details

  • TypeScript/Node.js 18+
  • MCP SDK (stdio transport) for Claude Code integration
  • sql.js (SQLite compiled to WASM) with WAL mode
  • 200+ unit tests (Vitest)
  • OAuth 2.0 PKCE — tokens stored at ~/.config/tweet-scheduler/
  • YAML config with environment variable substitution

9 MCP tools exposed: verify_auth, post_tweet, post_thread, schedule_tweet, list_scheduled, cancel_tweet, list_drafts, post_from_draft, get_costs.

Setup

git clone https://github.com/maheshcr/tweet-scheduler-mcp.git
cd tweet-scheduler-mcp
npm install && npm run build
npx tweet-scheduler init    # interactive setup
npx tweet-scheduler auth    # OAuth flow

Add to Claude Code's MCP config (~/.claude/settings.json), point it at the built server, restart Claude Code. The /tweet slash command handles the rest.

Why Open Source

I built this for myself. I'm releasing it because the MCP ecosystem needs practical tools that solve real problems, not demos. If you use Claude Code and post to X, this might save you time and money.

MIT license. No telemetry. Self-hosted. Your data stays on your machine.

github.com/maheshcr/tweet-scheduler-mcp