Skip to main content
Glama
Twitter MCP Server

Twitter MCP Server

by 6551Team

Instalación rápida

Primero, ve a http://app.newsliquid.com/mcp para obtener tu API Token.

Claude Code

claude mcp add twitter \
  -e OPENNEWS_TOKEN=<your-token> \
  -- uv --directory /path/to/twitter-mcp run twitter-mcp

Reemplaza /path/to/twitter-mcp con la ruta de tu proyecto local y <your-token> con tu Token.

OpenClaw

export OPENNEWS_TOKEN="<your-token>"
cp -r openclaw-skill/opentwitter ~/.openclaw/skills/

Related MCP server: Apex MCP for X Management

Deja que la IA lo revise e instale por ti

¿No estás seguro de si este MCP es seguro? Pega el prompt a continuación a tu asistente de IA — revisará el código fuente primero y, si es seguro, lo instalará.

Copia este prompt y envíalo a tu asistente de IA (reemplaza <project-path> y <your-token> con los valores reales):

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-mcp

¿Qué puede hacer?

Una vez conectado, solo pregúntale a tu asistente de IA:

Tú dices

Lo que hace

"Muestra el perfil de Twitter de @elonmusk"

Obtener información del perfil del usuario

"¿Qué tuiteó @VitalikButerin recientemente?"

Obtener los tweets recientes del usuario

"Busca tweets relacionados con Bitcoin"

Búsqueda por palabra clave

"Encuentra tweets con el hashtag #crypto"

Búsqueda por hashtag

"Tweets populares sobre ETH con más de 1000 me gusta"

Búsqueda con filtros de interacción

"Monitoriza a @elonmusk con seguimiento de seguidores"

Añadir usuario a la lista de seguimiento con opciones

"¿Quién citó este tweet?"

Obtener los tweets con cita de un tweet

"¿Quién retuiteó este tweet?"

Obtener los usuarios que retuitearon un tweet

"¿Quién siguió a @elonmusk recientemente?"

Obtener nuevos eventos de seguidores

"¿Quién dejó de seguir a @elonmusk?"

Obtener eventos de unfollow

"¿Qué tweets eliminó @elonmusk?"

Obtener tweets eliminados

"¿Qué KOLs siguen a @elonmusk?"

Obtener seguidores KOL


Herramientas disponibles

Herramienta

Descripción

get_twitter_user

Obtener perfil de usuario por nombre de usuario

get_twitter_user_by_id

Obtener perfil de usuario por ID numérico

get_twitter_user_tweets

Obtener tweets recientes de un usuario

search_twitter

Buscar tweets con filtros básicos

search_twitter_advanced

Búsqueda avanzada con múltiples filtros

get_twitter_follower_events

Obtener eventos de seguidores/unfollow

get_twitter_deleted_tweets

Obtener tweets eliminados de un usuario

get_twitter_kol_followers

Obtener seguidores KOL (Key Opinion Leader)

get_twitter_article_by_id

Obtener artículo de Twitter por ID

get_twitter_tweet_by_id

Obtener tweet por ID con tweets de respuesta/cita anidados

get_twitter_quote_tweets_by_id

Obtener tweets que citan un tweet específico

get_twitter_retweet_users_by_id

Obtener usuarios que retuitearon un tweet específico

get_twitter_watch

Obtener todos los usuarios en seguimiento de Twitter

add_twitter_watch

Añadir un usuario de Twitter a la lista de seguimiento (con opciones de tipo de evento)

delete_twitter_watch

Eliminar un usuario de Twitter de la lista de seguimiento


Configuración

Obtener API Token

Ve a http://app.newsliquid.com/mcp para obtener tu API Token.

Configura la variable de entorno:

# macOS / Linux
export OPENNEWS_TOKEN="<your-token>"

# Windows PowerShell
$env:OPENNEWS_TOKEN = "<your-token>"

Variable

Requerida

Descripción

OPENNEWS_TOKEN

Sí

Token Bearer de la API 6551 (obtener de http://app.newsliquid.com/mcp)

TWITTER_API_BASE

No

Anular la URL de la API REST

TWITTER_MAX_ROWS

No

Máximo de resultados por consulta (por defecto: 100)

También admite config.json en la raíz del proyecto (las variables de entorno tienen prioridad):

{
  "api_base_url": "https://ai.6551.io",
  "api_token": "<your-token>",
  "max_rows": 100
}

Suscripciones en tiempo real por WebSocket

Endpoint: wss://ai.6551.io/open/twitter_wss?token=YOUR_TOKEN

Suscríbete a eventos en tiempo real de tus cuentas de Twitter en seguimiento.

Heartbeat

Para mantener la conexión activa, el cliente puede enviar ping y el servidor responde con pong.

Suscribirse a eventos de Twitter

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "twitter.subscribe"
}

Respuesta:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "success": true
  }
}

Cancelar la suscripción

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "twitter.unsubscribe"
}

Push del servidor: evento de Twitter

Cuando una cuenta en seguimiento tiene actividad, el servidor envía:

{
  "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"
  }
}

Nota: La estructura del campo content varía según el tipo de evento (ver más abajo).


**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"
    }
  ]
}

Eventos de seguidores

  • NEW_FOLLOWER - Esta cuenta siguió a un usuario

  • NEW_UNFOLLOWER - Esta cuenta dejó de seguir a un usuario

Estructura de contenido para eventos de seguidores (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"
  }
]

Eventos de actualización de perfil

  • UPDATE_NAME - Nombre de usuario cambiado (content: cadena con el nuevo nombre)

  • UPDATE_DESCRIPTION - Biografía actualizada (content: cadena con la nueva descripción)

  • UPDATE_AVATAR - Foto de perfil cambiada (content: cadena con la nueva URL del avatar)

  • UPDATE_BANNER - Imagen de banner cambiada (content: cadena con la nueva URL del banner)

Otros eventos

  • TWEET_TOPPING - Tweet fijado

  • DELETE - Tweet eliminado

  • SYSTEM - Evento del sistema

  • TRANSLATE - Traducción del tweet

  • CA_CREATE - Token CA creado


Estructuras de datos

Usuario de Twitter

{
  "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://..."}]
}

En todas las configuraciones siguientes, reemplaza /path/to/twitter-mcp con tu ruta real del proyecto local y <your-token> con tu Token de http://app.newsliquid.com/mcp.

Claude Desktop

Edita la configuración (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 o Configuración > Servidores MCP:

{
  "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

Barra lateral de VS Code > Cline > Servidores MCP > Configurar, edita 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

Configuración > Servidores MCP > Añadir > Tipo stdio: Comando uv, Argumentos --directory /path/to/twitter-mcp run twitter-mcp, Entorno 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>"
        }
      }
    }
  }
}

Cualquier cliente MCP stdio

OPENNEWS_TOKEN=<your-token> \
  uv --directory /path/to/twitter-mcp run twitter-mcp

Compatibilidad

Cliente

Método de instalación

Estado

Claude Code

claude mcp add

Una línea

OpenClaw

Copiar directorio de skill

Una línea

Claude Desktop

Configuración JSON

Compatible

Cursor

Configuración JSON

Compatible

Windsurf

Configuración JSON

Compatible

Cline

Configuración JSON

Compatible

Continue.dev

YAML / JSON

Compatible

Cherry Studio

GUI

Compatible

Zed

Configuración JSON

Compatible


Desarrollo

cd /path/to/twitter-mcp
uv sync
uv run twitter-mcp
# MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/twitter-mcp run twitter-mcp

Estructura del proyecto

├── 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 tools

Licencia

MIT

Available Tools

12 tools
add_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

    A3.5/5.0

    Scored across 12 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables complete management of X (Twitter) accounts through a single API key, supporting functions like getting tweets, searching, generating and posting replies.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to access Twitter/X data including user profiles, tweets, search, and follower events via a set of MCP tools.
      MIT