Skip to main content
Glama
Steph-ux

x-mcp-playwright

by Steph-ux

x-mcp-playwright

Un servidor MCP de Twitter/X impulsado por patchright (fork sigiloso de Playwright) y un perfil de usuario de Chrome persistente.

9 herramientas agrupadas — 33 acciones conservadas, cero funcionalidad perdida.


1. Instalación

git clone <this-repo> x-mcp-playwright
cd x-mcp-playwright

python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate

pip install -e .
patchright install chromium

Inicio de sesión por única vez

x-mcp-login
# or: python login.py

Abre una ventana de navegador real. Inicia sesión en X con normalidad y luego cierra la ventana. La sesión se guarda en ~/.x-mcp-playwright/profile/.


2. Registro en tu cliente MCP

Claude Code

claude mcp add --scope user x-twitter x-mcp-server

Claude Desktop

{
  "mcpServers": {
    "x-twitter": {
      "command": "x-mcp-server",
      "env": { "X_MCP_HEADLESS": "1" }
    }
  }
}

Si x-mcp-server no está en el PATH, usa:

{
  "mcpServers": {
    "x-twitter": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["-m", "x_mcp_server"]
    }
  }
}

Docker (VPS sin interfaz gráfica)

docker build -t x-mcp-playwright .
docker run -i --rm \
  -v ~/.x-mcp-playwright/profile:/root/.x-mcp-playwright/profile \
  x-mcp-playwright

3. Catálogo de herramientas (9 herramientas, 33 acciones)

x_post — Publicar tweets (6 acciones)

acción

Argumentos obligatorios

Descripción

post

text

Publicar un solo tweet

thread

tweets (separados por saltos de línea)

Publicar un hilo

post_media

text, media_paths (separados por comas)

Hasta 4 imágenes o 1 vídeo

reply

tweet_url, reply_text

Responder a un tweet

quote

tweet_url, comment

Citar un tweet con comentario

delete

tweet_url

Eliminar tu tweet

x_engage — Interactuar con tweets (4 acciones)

acción

Argumentos obligatorios

Parámetro on

like

tweet_url

on=True para dar like, False para quitarlo

retweet

tweet_url

on=True para RT, False para deshacer

bookmark

tweet_url

on=True para guardar, False para eliminar

pin

tweet_url

on=True para fijar, False para desfijar

x_user — Operaciones de usuario (6 acciones)

acción

Argumentos obligatorios

Opcional

profile

handle

timeline

handle

tab="tweets"|"likes"|"media", limit

connections

handle

kind="followers"|"following", limit

follow

handle

on=True para seguir, False para dejar de seguir

block

handle

mute

handle

argumento

Por defecto

Descripción

query

Palabras clave de búsqueda

filter

"top"

"latest", "people", "media"

from_user

Filtrar por autor

to_user

Filtrar por destinatario

since / until

Rango de fechas (YYYY-MM-DD)

min_likes

0

Mínimo de likes

min_retweets

0

Mínimo de retweets

lang

Código de idioma

limit

10

Máximo de resultados

x_feed — Explorar feeds (4 acciones)

acción

Descripción

home

Tu cronología de inicio. Opcional: tab="for_you"|"following"

bookmarks

Tus marcadores guardados

notifications

Menciones, likes, seguidores

trending

Lo que está pasando

x_tweet — Detalles del tweet (4 acciones)

acción

Argumentos obligatorios

Descripción

details

tweet_url

Tweet completo con métricas

replies

tweet_url

Respuestas en un tweet

analytics

tweet_url

Impresiones/interacciones (tweets propios)

engagers

tweet_url

Quiénes dieron like/retweetearon (kind="likes"|"retweets")

x_list — Listas

Escenario

Argumentos

Tus listas

Sin argumentos

Listas de un usuario

handle

Tweets de una lista

list_id

x_dm — Mensajes directos (3 acciones)

acción

Argumentos obligatorios

Descripción

send

handle, message

Enviar un DM

conversations

Listar hilos de DM recientes

messages

handle

Leer mensajes con un usuario

x_session — Gestión de sesión (2 acciones)

acción

Descripción

check

Devuelve {logged_in, current_url, user_handle}

screenshot

Captura cualquier página de X. Opcional: url, full_page


4. Variables de entorno

Variable

Por defecto

Descripción

X_MCP_HEADLESS

1

0 para ver la ventana del navegador

X_MCP_TIMEOUT_MS

20000

Tiempo de espera predeterminado de Playwright (ms)

X_MCP_SCREENSHOT_DIR

~/.x-mcp-playwright/screenshots

Capturas de pantalla de depuración

X_MCP_USE_SYSTEM_CHROME

0

1 para usar el Chrome del sistema


5. Seguridad

  • Limitador de frecuencia: Las acciones de escritura (post, delete, DM, reply) están limitadas a 1/min. Las acciones de interacción (like, RT, follow) están limitadas a 2/min. Las acciones de lectura son ilimitadas.

  • Keepalive de sesión: Una tarea en segundo plano hace ping a X cada 30 min. Registra una advertencia si la sesión expira.

  • Vinculado a tu cuenta real. Cualquier cosa que haga el LLM, la hiciste tú.


6. Recursos MCP

  • x://session/status — Estado de inicio de sesión

  • x://version — Versión del servidor

  • x://tools/list — Todas las herramientas

  • x://tools/categories — Taxonomía agrupada

7. Prompts de MCP

  • analyze_tweet(tweet_url) — Obtener y analizar un tweet (sentimiento, interacción, tono de respuesta)

  • draft_reply(tweet_url, intent) — Redactar 3 variantes de respuesta de menos de 280 caracteres


7. Desarrollo

make install     # deps + chromium
make login       # interactive X login
make test        # unit tests (no browser)
make smoke       # live search test
make server      # run MCP server
make lint        # compile-check
make clean       # remove pycache, screenshots

8. Seguridad

  • Vinculado a tu cuenta real. Cualquier cosa que haga el LLM, la hiciste tú.

  • Límite: <= 1-2 acciones de publicación/respuesta por minuto.

  • Restringe las herramientas destructivas (delete, block, send_dm) a la aprobación humana en el VPS.


Licencia

MIT

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native

  • Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.

  • Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).

View all MCP Connectors

Latest Blog Posts

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/Steph-ux/x-mcp-playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server