Twitter MCP Server
Schnellinstallation
Gehen Sie zuerst zu http://app.newsliquid.com/mcp, um Ihren API-Token zu erhalten.
Claude Code
claude mcp add twitter \
-e OPENNEWS_TOKEN=<your-token> \
-- uv --directory /path/to/twitter-mcp run twitter-mcpErsetzen Sie
/path/to/twitter-mcpdurch Ihren lokalen Projektpfad und<your-token>durch Ihren Token.
OpenClaw
export OPENNEWS_TOKEN="<your-token>"
cp -r openclaw-skill/opentwitter ~/.openclaw/skills/Related MCP server: Apex MCP for X Management
Lassen Sie KI für Sie prüfen und installieren
Nicht sicher, ob dieser MCP sicher ist? Fügen Sie den untenstehenden Prompt in Ihren KI-Assistenten ein – er wird zuerst den Quellcode überprüfen und dann installieren, wenn er sicher ist:
Kopieren Sie diesen Prompt und senden Sie ihn an Ihren KI-Assistenten (ersetzen Sie
<project-path>und<your-token>durch tatsächliche Werte):
Please review and install the twitter-mcp MCP server for me. The project is at <project-path>.
Steps:
1. Review these files for security:
- src/twitter_mcp/api_client.py — Confirm it only connects to ai.6551.io, no data sent elsewhere
- src/twitter_mcp/config.py — Confirm token is only read from local config.json or env vars, no hardcoded secrets or leaks
- src/twitter_mcp/tools.py — Confirm all tools only perform API queries, no file writes, command execution, or dangerous operations
- pyproject.toml — Confirm dependencies are only mcp, httpx, no suspicious packages
2. Tell me your conclusion: safe / risky / problematic, with specific reasons
3. If safe, run the install (get Token from http://app.newsliquid.com/mcp):
claude mcp add twitter -e OPENNEWS_TOKEN=<your-token> -- uv --directory <project-path> run twitter-mcpWas kann es tun?
Sobald verbunden, fragen Sie einfach Ihren KI-Assistenten:
Sie sagen | Es tut |
"Zeige das Twitter-Profil von @elonmusk" | Benutzerprofilinformationen abrufen |
"Was hat @VitalikButerin kürzlich getwittert?" | Die letzten Tweets des Benutzers abrufen |
"Suche nach Bitcoin-bezogenen Tweets" | Stichwortsuche |
"Finde Tweets mit dem Hashtag #crypto" | Hashtag-Suche |
"Beliebte Tweets über ETH mit 1000+ Likes" | Suche mit Engagement-Filtern |
"Überwache @elonmusk mit Follower-Tracking" | Benutzer mit Optionen zur Beobachtungsliste hinzufügen |
"Wer hat diesen Tweet zitiert?" | Zitat-Tweets für einen Tweet abrufen |
"Wer hat diesen Tweet retweetet?" | Benutzer abrufen, die einen Tweet retweetet haben |
"Wer ist @elonmusk kürzlich gefolgt?" | Neue Follower-Ereignisse abrufen |
"Wer hat @elonmusk entfolgt?" | Entfolger-Ereignisse abrufen |
"Welche Tweets hat @elonmusk gelöscht?" | Gelöschte Tweets abrufen |
"Welche KOLs folgen @elonmusk?" | KOL-Follower abrufen |
Verfügbare Tools
Tool | Beschreibung |
| Benutzerprofil nach Benutzername abrufen |
| Benutzerprofil nach numerischer ID abrufen |
| Die letzten Tweets eines Benutzers abrufen |
| Tweets mit einfachen Filtern suchen |
| Erweiterte Suche mit mehreren Filtern |
| Follower-/Entfolger-Ereignisse abrufen |
| Gelöschte Tweets eines Benutzers abrufen |
| KOL-Follower (Key Opinion Leader) abrufen |
| Twitter-Artikel nach ID abrufen |
| Tweet nach ID mit verschachtelten Antwort-/Zitat-Tweets abrufen |
| Tweets abrufen, die einen bestimmten Tweet zitieren |
| Benutzer abrufen, die einen bestimmten Tweet retweetet haben |
| Alle Twitter-Überwachungsbenutzer abrufen |
| Einen Twitter-Benutzer zur Überwachungsliste hinzufügen (mit Optionen für Ereignistypen) |
| Einen Twitter-Benutzer aus der Überwachungsliste löschen |
Konfiguration
API-Token abrufen
Gehen Sie zu http://app.newsliquid.com/mcp, um Ihren API-Token zu erhalten.
Legen Sie die Umgebungsvariable fest:
# macOS / Linux
export OPENNEWS_TOKEN="<your-token>"
# Windows PowerShell
$env:OPENNEWS_TOKEN = "<your-token>"Variable | Erforderlich | Beschreibung |
| Ja | 6551 API Bearer Token (erhalten von http://app.newsliquid.com/mcp) |
| Nein | REST-API-URL überschreiben |
| Nein | Maximale Ergebnisse pro Abfrage (Standard: 100) |
Unterstützt auch config.json im Projektstamm (Umgebungsvariablen haben Vorrang):
{
"api_base_url": "https://ai.6551.io",
"api_token": "<your-token>",
"max_rows": 100
}WebSocket-Echtzeit-Abonnements
Endpunkt: wss://ai.6551.io/open/twitter_wss?token=YOUR_TOKEN
Abonnieren Sie Echtzeit-Ereignisse von Ihren überwachten Twitter-Konten.
Heartbeat
Um die Verbindung aufrechtzuerhalten, kann der Client ping senden, und der Server antwortet mit pong.
Twitter-Ereignisse abonnieren
{
"jsonrpc": "2.0",
"id": 1,
"method": "twitter.subscribe"
}Antwort:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"success": true
}
}Abbestellen
{
"jsonrpc": "2.0",
"id": 2,
"method": "twitter.unsubscribe"
}Server-Push – Twitter-Ereignis
Wenn ein überwachtes Konto Aktivität aufweist, sendet der Server:
{
"jsonrpc": "2.0",
"method": "twitter.event",
"params": {
"id": 123456,
"twAccount": "elonmusk",
"twUserName": "Elon Musk",
"profileUrl": "https://twitter.com/elonmusk",
"eventType": "NEW_TWEET",
"content": "...",
"ca": "0x1234...",
"remark": "Custom note",
"createdAt": "2026-03-06T10:00:00Z"
}
}Hinweis: Die Struktur des content-Felds variiert je nach Ereignistyp (siehe unten).
**Event Types and Content Structure**:
#### Tweet Events
- `NEW_TWEET` - New tweet posted
- `NEW_TWEET_REPLY` - New reply tweet
- `NEW_TWEET_QUOTE` - New quote tweet
- `NEW_RETWEET` - Retweeted
- `CA` - Tweet with CA address
Content structure for tweet events:
```json
{
"id": "1234567890",
"text": "Tweet content...",
"createdAt": "2026-03-06T10:00:00Z",
"language": "en",
"retweetCount": 100,
"favoriteCount": 500,
"replyCount": 20,
"quoteCount": 10,
"viewCount": 10000,
"userScreenName": "elonmusk",
"userName": "Elon Musk",
"userIdStr": "44196397",
"userFollowers": 170000000,
"userVerified": true,
"conversationId": "1234567890",
"isReply": false,
"isQuote": false,
"hashtags": ["crypto", "bitcoin"],
"media": [
{
"type": "photo",
"url": "https://...",
"thumbUrl": "https://..."
}
],
"urls": [
{
"url": "https://...",
"expandedUrl": "https://...",
"displayUrl": "example.com"
}
],
"mentions": [
{
"username": "VitalikButerin",
"name": "Vitalik Buterin"
}
]
}Follower-Ereignisse
NEW_FOLLOWER- Dieses Konto ist einem Benutzer gefolgtNEW_UNFOLLOWER- Dieses Konto hat einem Benutzer entfolgt
Inhaltsstruktur für Follower-Ereignisse (Array):
[
{
"id": 123,
"twId": 44196397,
"twAccount": "elonmusk",
"twUserName": "Elon Musk",
"twUserLabel": "Verified",
"description": "User bio...",
"profileUrl": "https://...",
"bannerUrl": "https://...",
"followerCount": 170000000,
"friendCount": 500,
"createdAt": "2026-03-06T10:00:00Z"
}
]Profilaktualisierungs-Ereignisse
UPDATE_NAME- Benutzername geändert (Inhalt: neue Namenszeichenfolge)UPDATE_DESCRIPTION- Bio aktualisiert (Inhalt: neue Beschreibungszeichenfolge)UPDATE_AVATAR- Profilbild geändert (Inhalt: neue Avatar-URL-Zeichenfolge)UPDATE_BANNER- Bannerbild geändert (Inhalt: neue Banner-URL-Zeichenfolge)
Andere Ereignisse
TWEET_TOPPING- Tweet angeheftetDELETE- Tweet gelöschtSYSTEM- SystemereignisTRANSLATE- Tweet-ÜbersetzungCA_CREATE- CA-Token erstellt
Datenstrukturen
Twitter-Benutzer
{
"userId": "44196397",
"screenName": "elonmusk",
"name": "Elon Musk",
"description": "...",
"followersCount": 170000000,
"friendsCount": 500,
"statusesCount": 30000,
"verified": true
}Tweet
{
"id": "1234567890",
"text": "Tweet content...",
"createdAt": "2024-02-20T12:00:00Z",
"retweetCount": 1000,
"favoriteCount": 5000,
"replyCount": 200,
"userScreenName": "elonmusk",
"hashtags": ["crypto", "bitcoin"],
"urls": [{"url": "https://..."}]
}Ersetzen Sie in allen folgenden Konfigurationen
/path/to/twitter-mcpdurch Ihren tatsächlichen lokalen Projektpfad und<your-token>durch Ihren Token von http://app.newsliquid.com/mcp.
Claude Desktop
Konfiguration bearbeiten (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"OPENNEWS_TOKEN": "<your-token>"
}
}
}
}Cursor
~/.cursor/mcp.json oder Einstellungen > MCP-Server:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"OPENNEWS_TOKEN": "<your-token>"
}
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"OPENNEWS_TOKEN": "<your-token>"
}
}
}
}Cline
VS Code-Seitenleiste > Cline > MCP-Server > Konfigurieren, bearbeiten Sie cline_mcp_settings.json:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"OPENNEWS_TOKEN": "<your-token>"
},
"disabled": false,
"autoApprove": []
}
}
}Continue.dev
~/.continue/config.yaml:
mcpServers:
- name: twitter
command: uv
args:
- --directory
- /path/to/twitter-mcp
- run
- twitter-mcp
env:
OPENNEWS_TOKEN: <your-token>Cherry Studio
Einstellungen > MCP-Server > Hinzufügen > Typ stdio: Befehl uv, Argumente --directory /path/to/twitter-mcp run twitter-mcp, Umgebung OPENNEWS_TOKEN.
Zed Editor
~/.config/zed/settings.json:
{
"context_servers": {
"twitter": {
"command": {
"path": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"OPENNEWS_TOKEN": "<your-token>"
}
}
}
}
}Beliebiger stdio-MCP-Client
OPENNEWS_TOKEN=<your-token> \
uv --directory /path/to/twitter-mcp run twitter-mcpKompatibilität
Client | Installationsmethode | Status |
Claude Code |
| Einzeiler |
OpenClaw | Skill-Verzeichnis kopieren | Einzeiler |
Claude Desktop | JSON-Konfiguration | Unterstützt |
Cursor | JSON-Konfiguration | Unterstützt |
Windsurf | JSON-Konfiguration | Unterstützt |
Cline | JSON-Konfiguration | Unterstützt |
Continue.dev | YAML / JSON | Unterstützt |
Cherry Studio | GUI | Unterstützt |
Zed | JSON-Konfiguration | Unterstützt |
Entwicklung
cd /path/to/twitter-mcp
uv sync
uv run twitter-mcp# MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/twitter-mcp run twitter-mcpProjektstruktur
├── README.md
├── docs/
│ ├── README_JA.md # 日本語
│ └── README_KO.md # 한국어
├── openclaw-skill/opentwitter/ # OpenClaw Skill
├── pyproject.toml
├── config.json
└── src/twitter_mcp/
├── server.py # Entry point
├── app.py # FastMCP instance
├── config.py # Config loader
├── api_client.py # HTTP client
└── tools.py # 8 toolsLizenz
MIT
Available Tools
12 toolsadd_twitter_watchB
Add a Twitter user to monitoring list.
Args: username: Twitter username to monitor (without @).
Inputs: username (required).
delete_twitter_watchC
Delete a Twitter user from monitoring list.
Args: watch_id: The monitoring record ID to delete.
Inputs: watch_id (required).
get_twitter_article_by_idC
Get Twitter article by ID.
Args: article_id: Twitter article ID.
Inputs: article_id (required).
get_twitter_deleted_tweetsB
Get deleted tweets from a Twitter/X user.
Args: username: Twitter username (without @). limit: Maximum tweets to return (default 20, max 100).
Inputs: username (required), limit.
get_twitter_follower_eventsB
Get follower/unfollower events for a Twitter/X user.
Args: username: Twitter username (without @). is_follow: True for new followers, False for unfollowers. limit: Maximum events to return (default 20, max 100).
Inputs: username (required), is_follow, limit.
get_twitter_kol_followersC
Get KOL (Key Opinion Leader) followers for a Twitter/X user.
Returns which influential accounts (KOLs) are following this user.
Args: username: Twitter username (without @).
Inputs: username (required).
get_twitter_userA
Get Twitter/X user profile information by username.
Args: username: Twitter username (without @, e.g. "elonmusk").
Inputs: username (required).
get_twitter_user_by_idB
Get Twitter/X user profile information by user ID.
Args: user_id: Twitter user ID (numeric string).
Inputs: user_id (required).
get_twitter_user_tweetsA
Get recent tweets from a specific Twitter/X user.
Args: username: Twitter username (without @). limit: Maximum tweets to return (default 20, max 100). include_replies: Include reply tweets (default False). include_retweets: Include retweets (default False).
Inputs: username (required), limit, include_replies, include_retweets.
get_twitter_watchB
Get all Twitter monitoring users for the current user.
Returns a list of Twitter accounts being monitored.
Inputs: no named parameters.
search_twitterA
Search Twitter/X for tweets matching criteria.
Args: keywords: Search keywords. from_user: Filter tweets from specific user (without @). hashtag: Filter by hashtag (without #). min_likes: Minimum likes threshold. limit: Maximum tweets to return (default 20, max 100).
Inputs: keywords, from_user, hashtag, min_likes, +1 more.
search_twitter_advancedB
Advanced Twitter/X search with multiple filters.
Args: keywords: Search keywords. from_user: Filter tweets from specific user. to_user: Filter tweets to specific user. mention_user: Filter tweets mentioning specific user. hashtag: Filter by hashtag (without #). exclude_replies: Exclude reply tweets. exclude_retweets: Exclude retweets. min_likes: Minimum likes threshold. min_retweets: Minimum retweets threshold. min_replies: Minimum replies threshold. since_date: Start date (YYYY-MM-DD). until_date: End date (YYYY-MM-DD). lang: Language code (e.g. "en", "zh"). product: Sort by "Top" or "Latest" (default "Top"). limit: Maximum tweets to return (default 20, max 100).
Inputs: keywords, from_user, to_user, mention_user, +11 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes, but there is some overlap between get_twitter_user and get_twitter_user_by_id (both retrieve user profiles via different identifiers) and between search_twitter and search_twitter_advanced (both search tweets, with the latter being a superset). The descriptions clarify the differences, preventing major confusion.
All tool names follow a consistent snake_case pattern with clear verb_noun structures (e.g., add_twitter_watch, get_twitter_user_tweets, search_twitter_advanced). The naming is predictable and uniform across all 12 tools.
With 12 tools, the server is well-scoped for Twitter/X monitoring and data retrieval. The count is appropriate, covering user management, tweet fetching, search, and monitoring without being overwhelming or insufficient for the domain.
The toolset provides strong coverage for monitoring and retrieving Twitter data, including user profiles, tweets, searches, and follower events. Minor gaps exist, such as no tools for posting tweets or interacting with tweets (e.g., liking, retweeting), but core retrieval and monitoring workflows are well-covered.
Maintenance
Related MCP Connectors
Live X/Twitter data: profiles, tweets, search, followers, lists and trends. 29 read-only tools.
Read-only public X (Twitter) data: profiles, tweets, threads, followers, search. Pay per result.
Real-time Twitter (X) advanced search, user timelines, profiles & followers MCP ($0.03/1K).
311Real-time Twitter (X) advanced search, user timelines, profiles & followers MCP ($0.03/1K).
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables interaction with X (formerly Twitter), allowing for posting tweets, searching content, managing accounts, and organizing lists.113MIT
- AlicenseNot gradedqualityDmaintenanceEnables complete management of X (Twitter) accounts through a single API key, supporting functions like getting tweets, searching, generating and posting replies.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with X (Twitter) to post tweets, threads, and replies while retrieving tweet metrics and account information. It supports core management tasks like deleting tweets and verifying authentication through the Twitter API.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to access Twitter/X data including user profiles, tweets, search, and follower events via a set of MCP tools.MIT