MCP serversSocial publishingLeer en español
Set up the X (Twitter) MCP server
Search posts, read timelines and publish or reply on X locally using your own X Developer API v2 keys.
Before you start
X does not offer an official first-party remote MCP server; community servers run locally over stdio with your own X API v2 credentials.
Create an app in the X Developer Portal, enable Read and Write permissions, and generate OAuth 1.0a user tokens.
Add it to your client
This server runs locally over stdio, so use Claude Desktop rather than Claude web.
Open Settings › Developer › Edit Config (claude_desktop_config.json).
Add the block below, restart Claude Desktop and test a read-only prompt.
{
"mcpServers": {
"x-twitter": {
"command": "node",
"args": [
"/path/to/x-mcp-server/build/index.js"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_SECRET": "YOUR_X_API_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_SECRET": "YOUR_X_ACCESS_SECRET"
}
}
}
}Browser-only clients like Claude web and ChatGPT require a remote HTTPS endpoint; local stdio servers run in desktop apps and terminal clients.
Register the local stdio command in Claude Code using the command below.
Paste your X (Twitter) API key or token from your account settings where shown.
Confirm the tools load by running /mcp inside Claude Code.
claude mcp add -e X_API_KEY=YOUR_X_API_KEY -e X_API_SECRET=YOUR_X_API_SECRET -e X_ACCESS_TOKEN=YOUR_X_ACCESS_TOKEN -e X_ACCESS_SECRET=YOUR_X_ACCESS_SECRET x-twitter -- node /path/to/x-mcp-server/build/index.jsOpen .cursor/mcp.json in your project or go to Cursor Settings › Tools & MCP.
Paste the local configuration below and replace placeholder environment variables with your credentials.
Paste your X (Twitter) API key or token from your account settings where shown.
{
"mcpServers": {
"x-twitter": {
"command": "node",
"args": [
"/path/to/x-mcp-server/build/index.js"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_SECRET": "YOUR_X_API_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_SECRET": "YOUR_X_ACCESS_SECRET"
}
}
}
}Add the stdio configuration below to .vscode/mcp.json.
Paste your X (Twitter) API key or token from your account settings where shown.
Start the server from the VS Code MCP panel.
{
"servers": {
"x-twitter": {
"type": "stdio",
"command": "node",
"args": [
"/path/to/x-mcp-server/build/index.js"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_SECRET": "YOUR_X_API_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_SECRET": "YOUR_X_ACCESS_SECRET"
}
}
}
}Register the local server in Codex CLI with the command below.
Paste your X (Twitter) API key or token from your account settings where shown.
Verify the connection with codex mcp list.
codex mcp add --env X_API_KEY=YOUR_X_API_KEY --env X_API_SECRET=YOUR_X_API_SECRET --env X_ACCESS_TOKEN=YOUR_X_ACCESS_TOKEN --env X_ACCESS_SECRET=YOUR_X_ACCESS_SECRET x-twitter -- node /path/to/x-mcp-server/build/index.jsChatGPT only connects to remote HTTPS MCP servers, not local stdio processes.
To use X (Twitter) from ChatGPT, deploy a remote HTTPS bridge or check the official documentation.
Reference documentation: https://github.com/DataWhisker/x-mcp-server
What you can do
- Post updates, threads, quotes and replies via X API v2.
- Search recent posts and inspect user timelines within your API tier.
- Upload media and manage likes or bookmarks.
“Draft a 3-post X thread summarizing our pricing update and check that every post fits under 280 characters.”
What it can change
Can publish live posts, send replies, upload media and delete posts on your X account immediately.
Skip X Developer keys with Spica Post's remote OAuth MCP
Running your own X API v2 app requires developer credentials and paid X API tiers for meaningful volume. Spica Post publishes live to X today via one remote OAuth MCP link (works in Claude web, ChatGPT and Cursor), checks weighted 280-char link rules and shows every draft before posting.
“Draft an X post about our new feature, check the link weight, and wait for my approval.”
Questions
Does X (Twitter) have an official MCP server?
No official hosted X MCP server exists today. Developers either run local community servers with X API v2 keys or connect through a remote OAuth MCP publisher like Spica Post.
Can a local X MCP server work inside ChatGPT or Claude web?
No. Local stdio servers require a desktop or CLI MCP client such as Claude Desktop, Claude Code, Cursor or Codex.
Pair your stack with one remote OAuth MCP for social publishing.
Works with the assistant you already use: Claude, ChatGPT, Gemini, Grok and more.


