Get the FREE Ultimate OpenClaw Setup Guide →

Xmcp

An Ai agentic tool that creates posts on x automatically using mcp servers.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio debasmitaas-xmcp node path/to/server.js \
  --env GEMINI_API_KEY="your_google_gemini_api_key" \
  --env TWITTER_API_KEY="your_api_key" \
  --env TWITTER_API_SECRET="your_api_secret" \
  --env TWITTER_ACCESS_TOKEN="your_access_token" \
  --env TWITTER_ACCESS_SECRET="your_access_secret"

How to use

Xmcp is a command-line tool that uses AI to help you compose and publish tweets directly from your terminal. It can generate tweet content based on prompts or topics, format tweets using customizable templates, and post them to your Twitter/X account securely using OAuth 2.0. The tool also supports draft management, allowing you to save, edit, and publish drafts when you’re ready. To get started, install dependencies and configure your API credentials, then use the CLI to generate, review, and post tweets from the command line.

Typical workflow: run the CLI with your desired prompt or topic to generate a tweet draft, apply any chosen template, and then post or save as a draft. You can create multiple templates for different styles or campaigns, and manage drafts within the tool for future posting. The integration with Gemini AI provides content suggestions or prompts to help you craft engaging tweets, while securely stored Twitter credentials ensure authorized posting without exposing tokens in your commands.

How to install

Prerequisites

  • Node.js v14 or higher
  • npm v6 or higher
  • Google Gemini API key
  • A Twitter Developer Account with API credentials

Installation steps

  1. Clone the repository
git clone https://github.com/debasmitaas/Xmcp.git
  1. Navigate to the project directory
cd Xmcp
  1. Install dependencies
npm install
  1. Configure environment variables
  • Create a .env file in the root directory and add your credentials. Example content:
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
GEMINI_API_KEY=your_google_gemini_api_key
  1. Run the application
npm start
  1. Optional: customize templates and drafts as per your workflow by editing config/template files in the project.

Additional notes

Tips and notes:

  • Keep your Twitter API credentials secure; use environment variables or a secrets management tool.
  • If you see authorization errors, recheck OAuth tokens and ensure your Twitter app has the required permissions.
  • The Gemini API key is used to generate content suggestions; monitor usage quotas and pricing for AI features.
  • Templates help enforce consistent branding for your tweets; consider separate templates for announcements, prompts, and engagement posts.
  • For drafts, organize by campaign or topic to streamline posting later.
  • If the CLI requires specific paths to entry scripts, adjust the node args to point to the correct server file in your setup.
  • Ensure your network allows outbound requests to Twitter and Gemini APIs; check firewall or proxy settings if you encounter connectivity issues.

Related MCP Servers

Sponsor this space

Reach thousands of developers