Xmcp
An Ai agentic tool that creates posts on x automatically using mcp servers.
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
- Clone the repository
git clone https://github.com/debasmitaas/Xmcp.git
- Navigate to the project directory
cd Xmcp
- Install dependencies
npm install
- 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
- Run the application
npm start
- 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
mcp-nodejs-debugger
🐞 MCP Node.js debugger
mcp -node
MCP Server implemented in JavaScript using Node.js that demonstrates how to build an MCP server with a custom prompt and custom tools, including one that loads an environment variable from a configuration file, to integrate seamlessly with AI-assisted environments like Cursor IDE.
pega-dx
Pega DX MCP Server - Enabling conversational interaction with Pega Infinity™ applications. This MCP Server transforms Pega Infinity™ interactions into intuitive, conversational experiences through the Model Context Protocol.
lichess
A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Lichess chess platform through natural language. Play games, analyze positions, manage your account, and participate in tournaments—all by simply talking to Claude.
mcp-graphql-tools
GraphQL MCP server for AI assistants
xgmem
Global Memory MCP server, that manage all projects data.