x-wing-mcp

x-wing-mcp

An MCP server for X (Twitter) that enables creating posts, threads, likes, follows, and DMs, plus reading posts, timelines, mentions, and search results via a unified OAuth 2.0 connection.

Category
Visit Server

README

x-wing-mcp

A stdio MCP server for X (Twitter) that combines x-wing write tools with x_data read tools. All tools share one process, one .env, and one official xdk OAuth 2.0 app.

Tools

Write tools

Tool Description Required scope
post Create a single post tweet.write
create_thread Create a multi-post thread tweet.write
like Like a post like.write
repost Repost a post tweet.write
follow Follow a user by ID follows.write
unfollow Unfollow a user by source/target ID follows.write
dm_send Send a direct message dm.write

Read tools

Tool Description Required scope
x_fetch_urls Fetch exact public posts by URL/ID tweet.read
x_read_user_posts Recent posts for one user tweet.read + users.read
x_search_posts Search public posts tweet.read
x_read_owned_timeline Authenticated account timeline tweet.read
x_read_mentions Mentions for the authenticated account tweet.read
x_read_thread Thread/conversation from an anchor post tweet.read
x_read_replies Replies to one post tweet.read
x_read_quotes Quote posts of one post tweet.read
x_read_follow_graph Followers/following for one user follows.read
x_read_article Published X Article via wrapper tweet tweet.read
x_collect_posts One-shot bulk collection query tweet.read
x_data_status Server/provider status none
x_data_healthcheck Provider diagnostics none

Read tools use an internal provider router (official_x, syndication, socialdata, getxapi). max_cost_usd is required on every read tool except status/healthcheck.

Provisioning

  1. Ensure this repo's .env exists and is readable only by the owner:
    chmod 600 .env
    
  2. Populate .env with OAuth 2.0 credentials from the X developer portal:
    X_OAUTH2_CLIENT_ID=...
    X_OAUTH2_CLIENT_SECRET=...
    X_OAUTH2_ACCESS_TOKEN=...
    X_OAUTH2_REFRESH_TOKEN=...
    X_OAUTH2_SCOPES="offline.access dm.read tweet.write like.write like.read users.read dm.write tweet.read bookmark.write follows.write follows.read"
    
    Legacy aliases (X_CLIENT_ID, X_CLIENT_SECRET, X_ACCESS_TOKEN, X_REFRESH_TOKEN, X_SCOPES) are also accepted.
  3. Optional paid/backup providers:
    SOCIALDATA_API_KEY=...
    GETXAPI_API_KEY=...
    
    Leave blank to rely on official_x + syndication only.
  4. If the access token is expired, run the included OAuth setup script or use the CLI refresh path to obtain a fresh token.

Running

python -m server

The server speaks MCP over stdio. stdout is the MCP protocol stream — no other process should write to it.

Testing

python -m pytest tests/ -q

Project layout

.
├── .env                 # real tokens, gitignored, chmod 600
├── .env.example         # committed template
├── .gitignore           # ignores .env and auth-state files
├── pyproject.toml       # x-wing-mcp package metadata
├── README.md            # this file
├── x_client.py          # vendored + patched x-wing client
├── oauth_setup.py       # vendored + patched OAuth setup
├── server.py            # FastMCP stdio server (read + write tools)
├── xdata/               # vendored x_data read providers/router/server
├── config/              # provider routing configuration
└── tests/               # vendored + new MCP tests

Verification results

  • python -c "import x_client; print(x_client.env_path)"<repo_root>/.env
  • MCP handshake via the wrapper script: initializetools/list returns exactly the 20 tools above.
  • x_data_status reports all configured providers healthy when tokens/keys are present.
  • Live token check via _validate_access_token against users/me: valid after refresh (access token refreshed successfully; .env and auth-state remain 0600).

Deployment notes

  • This repo is repo-relative; it can be relocated without changes.
  • Tokens live only in <repo_root>/.env. After migration, no X OAuth tokens should remain in ~/.hermes/.env or profile .env files.
  • The merged x-wing Hermes MCP server is wired into:
    • ~/.hermes/config.yaml (default / main profile)
    • ~/.hermes/profiles/yan-cgo/config.yaml
    • ~/.hermes/profiles/scout/config.yaml — read-only via tools.exclude on the 7 write tools
  • Wrapper script: x-wing-mcp-hermes.sh (repo root, executable). It deliberately does not source ~/.hermes/.env; the server reads tokens exclusively from <repo_root>/.env.

Roadmap

See AGENTS.md. Repo reconciliation is already complete: this repo (bob0x-ai/x-wing-mcp) is the canonical source of truth.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured