{
  "markdown": "# twitterapi.mcp\n\n[![npm](https://img.shields.io/npm/v/@pedrot95dev/twitterapi.mcp)](https://www.npmjs.com/package/@pedrot95dev/twitterapi.mcp)\n\nMCP server that exposes [twitterapi.io](https://twitterapi.io) endpoints as tools for AI agents and MCP hosts. Written in TypeScript, distributed on npm, runnable with a single `npx` command.\n\n## Current Tools\n\n| Tool | Description | API Endpoint | Auth |\n|------|-------------|--------------|------|\n| [`get_user_mentions`](#tool-get_user_mentions) | Fetch tweets mentioning a user. | `GET /twitter/user/mentions` | API key |\n| [`get_tweet_thread_context`](#tool-get_tweet_thread_context) | Fetch a page of the conversation thread around a tweet. | `GET /twitter/tweet/thread_context` | API key |\n| [`create_tweet`](#tool-create_tweet) | Create a tweet or reply. | `POST /twitter/create_tweet_v2` | API key + cookies + proxy |\n| [`delete_tweet`](#tool-delete_tweet) | Delete one of your tweets. | `POST /twitter/delete_tweet_v2` | API key + cookies + proxy |\n\n## Quick Start\n\n### 1. Get an API key\nVisit https://twitterapi.io/dashboard and obtain your `x-api-key`.\n\n### 2. Cookies + proxy for write actions\n\n`create_tweet` and `delete_tweet` authenticate with your account's own session\ncookies. From a browser logged into X, open DevTools → Application → Cookies →\n`https://x.com` and copy the `auth_token` and `ct0` values.\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `TWITTERAPI_IO_KEY` | always | twitterapi.io API key |\n| `TWITTERAPI_IO_AUTH_TOKEN` | writes | `auth_token` cookie from a logged-in X session |\n| `TWITTERAPI_IO_CT0` | writes | `ct0` cookie from the same session |\n| `TWITTERAPI_IO_PROXY` | writes | Residential proxy, `http://user:pass@ip:port` (required by the write endpoints) |\n\nThe server derives the `login_cookies` value twitterapi.io expects from\n`auth_token` + `ct0`. These cookies expire over time (typically weeks); when a\nwrite starts returning an auth error, refresh them from the browser.\n\n**The API key alone is enough for the read tools.** Add the cookie/proxy vars\nonly if you need write actions.\n\n### 3. Add to your MCP host\n\n**Claude Desktop** (`%APPDATA%\\Claude\\claude_desktop_config.json` on Windows,\n`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):\n\n```json\n{\n  \"mcpServers\": {\n    \"twitterapi\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@pedrot95dev/twitterapi.mcp\"],\n      \"env\": {\n        \"TWITTERAPI_IO_KEY\": \"your_key_here\",\n        \"TWITTERAPI_IO_AUTH_TOKEN\": \"your_auth_token_cookie\",\n        \"TWITTERAPI_IO_CT0\": \"your_ct0_cookie\",\n        \"TWITTERAPI_IO_PROXY\": \"http://user:pass@ip:port\"\n      }\n    }\n  }\n}\n```\n\n`npx -y @pedrot95dev/twitterapi.mcp` downloads and runs the latest published version. Only\nNode.js (>= 18) is required — no global install needed.\n\n**Other MCP hosts (e.g. Cursor):** add the same `npx` command + env vars in the\nhost's MCP settings UI or config file.\n\n## Tool: get_user_mentions\n\nFetch tweets that mention or reply to a user. Makes a single request per call;\npage by passing `cursor` from a previous response's `next_cursor`.\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `user_name` | string | (required) | X username, with or without `@` |\n| `since_time` | string | — | Start time filter (e.g. `2025-06-01` or ISO datetime) |\n| `until_time` | string | — | End time filter |\n| `cursor` | string | — | Pagination cursor from a previous `next_cursor` |\n| `query_type` | `\"Latest\"` \\| `\"Relevance\"` | `\"Latest\"` | Sort mode |\n| `limit` | integer | `50` | Max tweets to return from this single request |\n\n```json\n{\n  \"tweets\": [ ... ],\n  \"count\": 12,\n  \"has_next_page\": true,\n  \"next_cursor\": \"DAADDAAB...\",\n  \"status\": \"success\",\n  \"msg\": null\n}\n```\n\n## Tool: get_tweet_thread_context\n\nFetch the conversation thread around a tweet. Returns the original tweet, the\nintermediate replies up the chain, the tweet itself, and its direct replies.\nEach returned tweet includes `entities.urls` with expanded links — useful for\nscanning a mention's surrounding conversation for URLs.\n\nMakes exactly one request per call (1-to-1 with the endpoint — no internal\npagination). Page through longer threads with `cursor`.\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `tweet_id` | string | (required) | The tweet ID to get the thread context for |\n| `cursor` | string | — | Pagination cursor from a previous `next_cursor` |\n\n```json\n{\n  \"tweets\": [ ... ],\n  \"count\": 6,\n  \"has_next_page\": false,\n  \"next_cursor\": \"\",\n  \"status\": \"success\",\n  \"msg\": \"success\"\n}\n```\n\nNote: this endpoint paginates unevenly — a page may return few or zero tweets\nwhile `has_next_page` is still `true`. Follow `next_cursor` until\n`has_next_page` is `false` to collect the whole thread.\n\n## Tool: create_tweet\n\nPost a new tweet or reply. Supports quotes, media, communities, and scheduling.\nRequires the cookie + proxy env vars (see [step 2](#2-cookies--proxy-for-write-actions)).\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `tweet_text` | string | (required) | The text content of the tweet |\n| `reply_to_tweet_id` | string | — | Tweet ID to reply to (makes this a reply) |\n| `quote_tweet_id` | string | — | Tweet ID to quote |\n| `attachment_url` | string | — | URL for quote (alternative to `quote_tweet_id`) |\n| `community_id` | string | — | Post inside a specific community |\n| `is_note_tweet` | boolean | `false` | Allow >280 chars (Premium accounts) |\n| `media_ids` | string[] | — | Media IDs from a prior `/twitter/upload_media_v2` |\n| `schedule_for` | string | — | ISO-8601 future time, e.g. `2026-01-20T10:00:00.000Z` |\n\n```json\n{ \"tweet_id\": \"1234567890123456789\", \"status\": \"success\", \"msg\": \"success\" }\n```\n\n## Tool: delete_tweet\n\nDelete one of your tweets by ID. Requires the cookie + proxy env vars.\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `tweet_id` | string | (required) | The ID of the tweet to delete |\n\n```json\n{ \"status\": \"success\", \"msg\": \"success\" }\n```\n\n## Contributing\n\nLocal development, build, and testing instructions are in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Credits\n\nBased on the official twitterapi-io agent skill: https://github.com/kaitoInfra/twitterapi-io\nAPI service: https://twitterapi.io\n",
  "bytes": 6425,
  "sha": "bed0d0eaa1641762e47d38dca588dd58de6ee1db6689e87f20ccb7531fd255a9",
  "repo_slug": "pedrot95dev/twitterapi.mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_pedrot95dev_twitterapi_00fa864f/readme"
}