Add to Claude Code
156 addsAdd this MCP server to Claude Code.
Name: Twitter/X MCP
Merge into: ~/.claude/mcp.json under mcpServers
---
{
"mcpServers": {
"twitter": {
"command": "npx",
"args": ["-y", "twitter-mcp"],
"env": {
"TWITTER_API_KEY": "<YOUR_API_KEY>",
"TWITTER_API_SECRET": "<YOUR_API_SECRET>",
"TWITTER_ACCESS_TOKEN": "<YOUR_ACCESS_TOKEN>",
"TWITTER_ACCESS_SECRET": "<YOUR_ACCESS_SECRET>"
}
}
}
}
// ── Setup ────────────────────────────────────────────────────────────────────
// 1. Apply for a Twitter Developer account at https://developer.twitter.com/
// 2. Create a project and app in the Developer Portal
// 3. Generate API Key, API Secret, Access Token, and Access Token Secret
// 4. Ensure your app has Read and Write permissions
//
// ── Available tools ──────────────────────────────────────────────────────────
// post_tweet post a new tweet
// search_tweets search recent tweets by keyword
// get_timeline fetch your home timeline
// get_user_tweets get tweets from a specific user
// reply_to_tweet reply to an existing tweet
// like_tweet like a tweet
// retweet retweet a tweet
// get_tweet fetch a single tweet by ID
Paste into Claude Code to connect this MCP server.
How to add
Full guide →Click Add, then paste into Claude Code. Claude will connect the MCP server in your settings.
Target: .claude/mcp.json → mcpServers