darvis/api-x

darvis/api-x is a Laravel package that posts short updates, with one optional image, to X (formerly Twitter). You call it from PHP, from the command line with php artisan x:post, or let an AI agent such as Claude do it through a local MCP server.

This is an unofficial, independent open-source package: it is not an official X product and is not affiliated with X Corp.

Who it is for

A developer who wants to share what they are building without leaving the editor: release notes of a package, a screenshot of a new screen, a short “working on” update written by the agent you already work with.

What it does

  • Uploads one JPEG, PNG, GIF or WebP (local path or URL, at most 5 MB) and attaches it to the post
  • Checks the text the way X counts it, before anything is sent or billed
  • Refuses links unless you allow them, because X bills posts with a link at a much higher rate
  • Caps the number of posts per day and offers a dry run
  • Registers a local MCP server with one tool, when laravel/mcp is installed
  • Adds a page to post from the browser, with the history of every post, when Livewire and Flux are installed

What it does not do

  • It posts as one account: the one the keys belong to. There is no connect flow for other users.
  • No threads, polls, video or scheduling. Schedule with Laravel’s scheduler if you need it.

Pages