x-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x-mcpshow me my timeline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
x-mcp
A Model Context Protocol (MCP) server for the X (Twitter) API. Built with the official @xdevplatform/xdk SDK and OAuth 2.0 PKCE authentication.
Features
23 tools across users, posts, bookmarks, likes, and lists
OAuth 2.0 PKCE with automatic token refresh
Dual output: markdown (human-readable) or JSON (structured)
MCP tool annotations:
readOnlyHint,destructiveHint,idempotentHint
Related MCP server: X MCP Server
Prerequisites
Node.js v18+
pnpm
X API OAuth 2.0 credentials (Client ID and Secret)
Setup
Install dependencies:
pnpm installConfigure environment:
cp .env.example .envEdit
.env:X_CLIENT_ID=your_oauth2_client_id X_CLIENT_SECRET=your_oauth2_client_secret X_REDIRECT_URI=http://localhost:3000/callbackAuthenticate:
pnpm run setup-authBuild:
pnpm run build
Getting X API Credentials
Go to the X Developer Portal
Create a Project and App
Enable OAuth 2.0 in app settings
Set app type to Web App
Add callback URL:
http://localhost:3000/callbackCopy Client ID and Client Secret from the OAuth 2.0 section
Claude Desktop Integration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"x-mcp": {
"command": "node",
"args": ["/path/to/x-mcp/dist/index.js"],
"env": {
"X_TOKENS_PATH": "/path/to/x-mcp/.tokens.json",
"X_CLIENT_ID": "your_client_id",
"X_CLIENT_SECRET": "your_client_secret",
"X_REDIRECT_URI": "http://localhost:3000/callback"
}
}
}
}Tools
Users
Tool | Description | Parameters |
| Fetch a user profile by username |
|
| Get the authenticated user's profile |
|
| Get a user's followers |
|
| Get accounts a user follows |
|
Posts
Tool | Description | Parameters |
| Fetch recent posts from a user (excludes retweets/replies) |
|
| Get your home timeline (reverse chronological) |
|
| Search recent posts (last 7 days) |
|
Bookmarks
Tool | Description | Parameters |
| Fetch your bookmarked posts |
|
| Bookmark a post |
|
| Remove a bookmark |
|
Likes
Tool | Description | Parameters |
| Fetch your liked posts |
|
| Like a post |
|
| Unlike a post |
|
Lists
Tool | Description | Parameters |
| Get your owned lists |
|
| Get list details by ID |
|
| Get posts from a list |
|
| Get members of a list |
|
| Create a new list |
|
| Update a list |
|
| Delete a list |
|
| Add a user to a list |
|
| Remove a user from a list |
|
Project Structure
src/
├── index.ts # MCP server entry point
├── constants.ts # Shared constants
├── types.ts # TypeScript interfaces
├── setup-auth.ts # OAuth 2.0 setup flow
├── schemas/
│ └── common.ts # Shared Zod schemas
├── services/
│ ├── auth-manager.ts # OAuth 2.0 token management
│ └── x-client.ts # X API client wrapper
├── tools/
│ ├── users.ts # User profile tools
│ ├── tweets.ts # Post/timeline tools
│ ├── bookmarks.ts # Bookmark tools
│ ├── likes.ts # Like tools
│ └── lists.ts # List management tools
└── utils/
└── formatting.ts # Response formatting helpersScripts
Command | Description |
| Compile TypeScript |
| Run in development mode |
| Run compiled server |
| Authenticate with X |
| Reset saved tokens |
API Access Tiers
Tier | What works |
Free | Post creation, basic read access |
Basic ($200/mo) | All read/write endpoints, followers/following |
Pro ($5,000/mo) | Higher rate limits, full search |
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables interaction with X (formerly Twitter), allowing for posting tweets, searching content, managing accounts, and organizing lists.Last updated143MIT
- Flicense-qualityDmaintenanceEnables interaction with X (Twitter) API v2 with multi-user OAuth 2.0 support, allowing users to manage bookmarks, create tweets, and access user information with encrypted token storage and automatic refresh.Last updated10
- Alicense-qualityBmaintenanceProvides programmatic X (Twitter) engagement via MCP, offering 24 tools for search, timelines, notifications, bookmarks, profiles, and tweet actions through a headless browser.Last updatedMIT
- AlicenseBqualityCmaintenanceEnables interacting with Twitter/X through natural language, including searching tweets, posting, sending DMs, and managing timelines via any MCP client.Last updated8MIT
Related MCP Connectors
128 REST operations. 120 MCP routes; 119 JSON/text ops. OAuth 2.1. Not affiliated with X Corp.
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
Hosted MCP for X/Twitter and Reddit. 12 read-only tools, no API keys, free during beta.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/namank42/x-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server