x-post-mcp
A minimal MCP server for posting tweets to X (Twitter) via API v2, supporting tweet creation, replies, and quote tweets.
README
x-post-mcp
A minimal MCP server for posting tweets to X (Twitter) via API v2. Zero runtime dependencies.
Installation
npm install -g x-post-mcp
# or
npx x-post-mcp
Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"x-post-mcp": {
"command": "npx",
"args": ["x-post-mcp"],
"env": {
"X_BEARER_TOKEN": "<your-bearer-token>"
}
}
}
}
Getting a Bearer Token
See the detailed step-by-step guide: English | 中文
Quick overview:
- Go to X Developer Portal
- Create a project and app
- Configure User Authentication with
Read and writepermission - Generate OAuth 2.0 Token with
tweet.read,tweet.write,users.read,offline.accessscopes
Recommended: Use auto-refresh configuration with X_CLIENT_ID, X_CLIENT_SECRET, and X_REFRESH_TOKEN to avoid manual token refresh every 2 hours.
Tool
send_tweet
Post a new tweet to X.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | ✓ | Tweet content |
| reply_to_tweet_id | string | Tweet ID to reply to | |
| quote_tweet_id | string | Tweet ID to quote |
Skill Example
You can create a skill file to help AI agents use this MCP. Save as .claude/skills/post-tweet.md:
# Post Tweet Skill
Post a tweet to X (Twitter) using the x-post-mcp server.
## Instructions
1. Confirm the tweet content with the user before posting
2. Call the `send_tweet` tool with the user's message
3. Report the result back to the user
## Examples
**Simple tweet:**
User: 帮我发一条推文:Hello World!
Assistant: [calls send_tweet with text: "Hello World!"]
**Reply to a tweet:**
User: 回复这条推文 1234567890:感谢分享!
Assistant: [calls send_tweet with text: "感谢分享!", reply_to_tweet_id: "1234567890"]
**Quote tweet:**
User: 引用推文 1234567890 并评论:这个观点很有意思
Assistant: [calls send_tweet with text: "这个观点很有意思", quote_tweet_id: "1234567890"]
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.