@twitterapis/mcp 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/package.json +4 -3
- package/src/tools.js +16 -1
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Restart Claude Desktop. The `twitter_*` tools appear in the tool picker.
|
|
|
91
91
|
|
|
92
92
|
## Tools
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
52 tools: 37 reads and 15 write actions. Most user endpoints accept `username` (handle without @) **or** `user_id` (`twitter_user_likes` and `twitter_user_tweets_complete` require `user_id`); tweet endpoints accept `id` **or** `url`; paginated endpoints return a `cursor` you pass back to get the next page. Two of the reads are free account/billing lookups (`twitter_account_me`, `twitter_account_payments`).
|
|
95
95
|
|
|
96
96
|
Public reads (search, profiles, tweets, followers, likes) work with just your API key. The **account-only** reads (bookmarks, DMs, home timeline, followers-you-know) and **all write actions** act AS an authenticated X account, so they need a session linked to your key first (returns HTTP 409 until then). Link a session either by registering your x.com cookies (`twitter_customer_session`) or by logging in with a username/password (`twitter_user_login`). Alternatively, pass **per-call inline credentials** on any of those tools (`auth_token` + `ct0`, with optional `proxy_url` / `user_agent`) to act AS that account for a single call without pre-registering a session, so one API key can act as many accounts. For write actions, set `proxy_url` to a residential proxy, since X soft-blocks writes that egress from datacenter IPs. Each write tool is annotated `readOnlyHint: false`; reversing actions (delete, unfollow, unlike, unretweet, unbookmark) are annotated `destructiveHint: true` so MCP clients can prompt before running them.
|
|
97
97
|
|
|
@@ -157,6 +157,7 @@ Link an X account to your key once, so the account-only reads and write actions
|
|
|
157
157
|
| Tool | What it does |
|
|
158
158
|
|---|---|
|
|
159
159
|
| `twitter_customer_session` | Register your x.com session cookies (`auth_token` + `ct0`) against your key |
|
|
160
|
+
| `twitter_customer_session_delete` | Revoke that stored session, deleting your `auth_token` + `ct0` from the service. Idempotent and free |
|
|
160
161
|
| `twitter_user_login` | Log in with `username` + `password` (+ `totp_secret` for 2FA); stores the session against your key. Returns a confirmation, never the cookies |
|
|
161
162
|
|
|
162
163
|
## Usage examples
|
|
@@ -239,7 +240,7 @@ Calls are billed to your twitterapis.com account. Almost every endpoint is $0.00
|
|
|
239
240
|
|
|
240
241
|
**Do I need an X (Twitter) developer account?** No. Get an API key at [twitterapis.com/signup](https://www.twitterapis.com/signup); there is no application or approval step.
|
|
241
242
|
|
|
242
|
-
**Is it read-only?** No. 37 read tools work with just your API key;
|
|
243
|
+
**Is it read-only?** No. 37 read tools work with just your API key; 15 write actions (post, like, retweet, follow, DM, media upload) act as a linked X account or per-call inline credentials.
|
|
243
244
|
|
|
244
245
|
**Which clients are supported?** Claude Desktop, Cursor, Windsurf, and VS Code (Copilot agent mode), or any Model Context Protocol client.
|
|
245
246
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twitterapis/mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Official MCP server for twitterapis.com, the Twitter/X API (search, users, followers, tweets, threads, lists, likes, bookmarks, DMs) plus write actions (post/like/retweet/follow) as native tools for Claude, Cursor, and any MCP client.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
"build:check": "node scripts/gen-tools.mjs --check",
|
|
28
28
|
"openapi:refresh": "node scripts/openapi-refresh.mjs",
|
|
29
29
|
"test": "node scripts/gen-tools.mjs --check && node test/catalog-identity.mjs && node test/tools.test.mjs && node test/smoke.mjs && node test/openapi-parity.mjs && node test/readme-parity.mjs && node test/firewall.mjs && node test/registry-manifests.mjs",
|
|
30
|
-
"prepublishOnly": "npm test",
|
|
30
|
+
"prepublishOnly": "npm test && node test/publish-provenance.mjs",
|
|
31
31
|
"check:openapi-parity": "node test/openapi-parity.mjs",
|
|
32
32
|
"check:firewall": "node test/firewall.mjs",
|
|
33
|
-
"check:registry": "node test/registry-manifests.mjs"
|
|
33
|
+
"check:registry": "node test/registry-manifests.mjs",
|
|
34
|
+
"check:publish-provenance": "node test/publish-provenance.mjs"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
package/src/tools.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// file in memory and fails if it does not match what is committed, so a hand edit
|
|
9
9
|
// here is caught rather than shipped.
|
|
10
10
|
//
|
|
11
|
-
// Catalog:
|
|
11
|
+
// Catalog: 52 tools (37 reads, 15 writes).
|
|
12
12
|
//
|
|
13
13
|
// Each tool maps 1:1 to a REST endpoint at https://api.twitterapis.com. Tool arg
|
|
14
14
|
// names map 1:1 to endpoint query params (every endpoint, including the POST
|
|
@@ -1013,6 +1013,15 @@ export const TOOLS = [
|
|
|
1013
1013
|
),
|
|
1014
1014
|
},
|
|
1015
1015
|
},
|
|
1016
|
+
{
|
|
1017
|
+
name: "twitter_customer_session_delete",
|
|
1018
|
+
path: "/twitter/customer/session/delete",
|
|
1019
|
+
method: "POST",
|
|
1020
|
+
write: true,
|
|
1021
|
+
description:
|
|
1022
|
+
"Revoke the X account session you registered with twitter_customer_session, deleting the stored auth_token and ct0 from twitterapis.com. Self-serve, no ticket and no human in the loop. Scoped to your own API key by construction: it takes no account identifier of any kind, so it cannot reach another key's session. Idempotent and free: revoking twice, or revoking when nothing was stored, still returns ok with deleted=false, and it costs no credits, so a key that is out of balance can still delete its credentials. After this, the authenticated-account tools (twitter_home_timeline, twitter_bookmarks, twitter_dm_list, twitter_dm_conversation, twitter_user_likes) and the write tools stop acting as that account until you register again. IMPORTANT: this deletes the stored copy only. It does NOT log the account out of x.com, so to invalidate the cookies themselves, also revoke the session from your X account settings.",
|
|
1023
|
+
shape: {},
|
|
1024
|
+
},
|
|
1016
1025
|
{
|
|
1017
1026
|
name: "twitter_user_login",
|
|
1018
1027
|
path: "/twitter/user/user_login",
|
|
@@ -1031,6 +1040,12 @@ export const TOOLS = [
|
|
|
1031
1040
|
totp_secret: z.string().optional().describe(
|
|
1032
1041
|
"The account's base32 two-factor (TOTP) secret. Required only when the account has 2FA enabled.",
|
|
1033
1042
|
),
|
|
1043
|
+
proxy_url: z.string().optional().describe(
|
|
1044
|
+
"Optional. HTTP or SOCKS proxy URL to perform the login through, e.g. 'http://user:pass@host:port'. Stored with the session and reused for its later requests. Omit to log in directly from the service's own IP. A residential proxy is recommended: X treats datacenter logins as automated.",
|
|
1045
|
+
),
|
|
1046
|
+
user_agent: z.string().optional().describe(
|
|
1047
|
+
"Optional. Browser User-Agent to mint and use the session with. Defaults to a current Chrome UA. Keep it consistent with the environment the account normally signs in from; a mismatch between the UA and the session is itself a signal to X.",
|
|
1048
|
+
),
|
|
1034
1049
|
},
|
|
1035
1050
|
},
|
|
1036
1051
|
{
|