Skip to content
VS Code

X (Twitter) for VS Code

io.github.role1776/mcp-x

Search, read and publish X posts and manage users, lists and media via the X API v2.

client:VS Code transport:stdio runtime:oci

Install X (Twitter) in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "x-api-key",
      "description": "X_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "x-api-key-secret",
      "description": "X_API_KEY_SECRET",
      "password": true
    },
    {
      "type": "promptString",
      "id": "x-access-token",
      "description": "X_ACCESS_TOKEN",
      "password": true
    },
    {
      "type": "promptString",
      "id": "x-access-token-secret",
      "description": "X_ACCESS_TOKEN_SECRET",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-root",
      "description": "MEDIA_ROOT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-transport",
      "description": "MCP_TRANSPORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-name",
      "description": "MCP_NAME",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-path",
      "description": "MCP_PATH",
      "password": true
    },
    {
      "type": "promptString",
      "id": "server-port",
      "description": "SERVER_PORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "server-read-timeout",
      "description": "SERVER_READ_TIMEOUT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "server-write-timeout",
      "description": "SERVER_WRITE_TIMEOUT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "log-mode",
      "description": "LOG_MODE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "max-idle-conns-per-host",
      "description": "MAX_IDLE_CONNS_PER_HOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "x-debug",
      "description": "X_DEBUG",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-queries",
      "description": "POSTS_MAX_QUERIES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-usernames",
      "description": "POSTS_MAX_USERNAMES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-ids",
      "description": "POSTS_MAX_IDS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-default-results",
      "description": "POSTS_DEFAULT_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-results",
      "description": "POSTS_MAX_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-default-days",
      "description": "POSTS_DEFAULT_DAYS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-days",
      "description": "POSTS_MAX_DAYS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-default-timeout-ms",
      "description": "POSTS_DEFAULT_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-min-timeout-ms",
      "description": "POSTS_MIN_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "posts-max-timeout-ms",
      "description": "POSTS_MAX_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-max-usernames",
      "description": "USERS_MAX_USERNAMES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-max-ids",
      "description": "USERS_MAX_IDS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-default-results",
      "description": "USERS_DEFAULT_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-max-results",
      "description": "USERS_MAX_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-default-timeout-ms",
      "description": "USERS_DEFAULT_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-min-timeout-ms",
      "description": "USERS_MIN_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "users-max-timeout-ms",
      "description": "USERS_MAX_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "lists-default-results",
      "description": "LISTS_DEFAULT_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "lists-max-results",
      "description": "LISTS_MAX_RESULTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "lists-default-timeout-ms",
      "description": "LISTS_DEFAULT_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "lists-min-timeout-ms",
      "description": "LISTS_MIN_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "lists-max-timeout-ms",
      "description": "LISTS_MAX_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-chunk-bytes",
      "description": "MEDIA_CHUNK_BYTES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-poll-interval-ms",
      "description": "MEDIA_POLL_INTERVAL_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-default-timeout-ms",
      "description": "MEDIA_DEFAULT_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-min-timeout-ms",
      "description": "MEDIA_MIN_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "media-max-timeout-ms",
      "description": "MEDIA_MAX_TIMEOUT_MS",
      "password": true
    }
  ],
  "servers": {
    "mcp-x": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/role1776/mcp-x:0.1.1"
      ],
      "env": {
        "X_API_KEY": "${input:x-api-key}",
        "X_API_KEY_SECRET": "${input:x-api-key-secret}",
        "X_ACCESS_TOKEN": "${input:x-access-token}",
        "X_ACCESS_TOKEN_SECRET": "${input:x-access-token-secret}",
        "MEDIA_ROOT": "${input:media-root}",
        "MCP_TRANSPORT": "${input:mcp-transport}",
        "MCP_NAME": "${input:mcp-name}",
        "MCP_PATH": "${input:mcp-path}",
        "SERVER_PORT": "${input:server-port}",
        "SERVER_READ_TIMEOUT": "${input:server-read-timeout}",
        "SERVER_WRITE_TIMEOUT": "${input:server-write-timeout}",
        "LOG_MODE": "${input:log-mode}",
        "MAX_IDLE_CONNS_PER_HOST": "${input:max-idle-conns-per-host}",
        "X_DEBUG": "${input:x-debug}",
        "POSTS_MAX_QUERIES": "${input:posts-max-queries}",
        "POSTS_MAX_USERNAMES": "${input:posts-max-usernames}",
        "POSTS_MAX_IDS": "${input:posts-max-ids}",
        "POSTS_DEFAULT_RESULTS": "${input:posts-default-results}",
        "POSTS_MAX_RESULTS": "${input:posts-max-results}",
        "POSTS_DEFAULT_DAYS": "${input:posts-default-days}",
        "POSTS_MAX_DAYS": "${input:posts-max-days}",
        "POSTS_DEFAULT_TIMEOUT_MS": "${input:posts-default-timeout-ms}",
        "POSTS_MIN_TIMEOUT_MS": "${input:posts-min-timeout-ms}",
        "POSTS_MAX_TIMEOUT_MS": "${input:posts-max-timeout-ms}",
        "USERS_MAX_USERNAMES": "${input:users-max-usernames}",
        "USERS_MAX_IDS": "${input:users-max-ids}",
        "USERS_DEFAULT_RESULTS": "${input:users-default-results}",
        "USERS_MAX_RESULTS": "${input:users-max-results}",
        "USERS_DEFAULT_TIMEOUT_MS": "${input:users-default-timeout-ms}",
        "USERS_MIN_TIMEOUT_MS": "${input:users-min-timeout-ms}",
        "USERS_MAX_TIMEOUT_MS": "${input:users-max-timeout-ms}",
        "LISTS_DEFAULT_RESULTS": "${input:lists-default-results}",
        "LISTS_MAX_RESULTS": "${input:lists-max-results}",
        "LISTS_DEFAULT_TIMEOUT_MS": "${input:lists-default-timeout-ms}",
        "LISTS_MIN_TIMEOUT_MS": "${input:lists-min-timeout-ms}",
        "LISTS_MAX_TIMEOUT_MS": "${input:lists-max-timeout-ms}",
        "MEDIA_CHUNK_BYTES": "${input:media-chunk-bytes}",
        "MEDIA_POLL_INTERVAL_MS": "${input:media-poll-interval-ms}",
        "MEDIA_DEFAULT_TIMEOUT_MS": "${input:media-default-timeout-ms}",
        "MEDIA_MIN_TIMEOUT_MS": "${input:media-min-timeout-ms}",
        "MEDIA_MAX_TIMEOUT_MS": "${input:media-max-timeout-ms}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

X (Twitter) in other clients