@twitterapis/mcp 0.7.2 → 0.7.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.5 (2026-08-16)
4
+
5
+ ### Fixed
6
+
7
+ - **5 write tools sent every arg as a URL query-string parameter with no request body**, silently failing 100% of calls: `twitter_monitor_create`, `twitter_monitor_update`, `twitter_monitor_webhook_create`, `twitter_x_user_stream_add_user`, `twitter_x_user_stream_remove_user`. Their backend routes read only `c.req.json()` with no query-string fallback, unlike most write endpoints here which accept either. Every call to any of these 5 returned a 400 "Provide `<field>` in the JSON body" error. Now sends `jsonBody: true` so args travel as a real JSON body, matching what the backend actually reads. Found by an independent review, confirmed live against production before and after the fix (see this repo's own test/smoke.mjs pattern).
8
+ - **`twitter_monitor_update`'s `domain_filter` now accepts `null`** (in addition to an empty string) to clear an existing filter, matching its documented "pass an empty string (or null) to clear" behavior, which the schema previously rejected.
9
+
10
+ ## 0.7.4 (2026-08-15)
11
+
12
+ ### Added
13
+
14
+ - **`domain_filter` on `twitter_monitor_create` and `twitter_monitor_update`** (task #30 follow-up): an optional bare hostname or full URL that restricts a monitor's delivery to only the new posts carrying a link to that host or a subdomain of it. Normalized server-side (lowercased, scheme/path/query/fragment/leading `www.`/trailing port stripped), rejected with a 400 on an invalid hostname shape after normalization. Pass an empty string on update to clear an existing filter; omit the field to leave it unchanged. A filtered-out post still advances the monitor's cursor and is never a metered read either way, it just isn't delivered. This param was already live on the backend and unrestricted for every account; it was undocumented until now. No new tool, no catalog count change.
15
+
16
+ ## 0.7.3 (2026-08-15)
17
+
18
+ ### Added
19
+
20
+ - **`twitter_monitor_account_health`** (task #111): account-wide monitoring rollup in ONE call, distinct from `twitter_monitor_health` (which needs an id and reports one monitor's cursor): service status ("operational" or "degraded"), active/paused/total counts across every monitor you own, and pending/delivered/failed delivery counts from the last 24 hours. Takes no arguments. A key with zero monitors gets zeroed counts back, never an error. Free per call. The catalog is now **75 tools: 46 reads and 29 write actions**.
21
+
3
22
  ## 0.7.2 (2026-08-14)
4
23
 
5
24
  ### Added
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
- 74 tools: 45 reads and 29 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`); the 13 monitoring tools are also free (account administration, not metered reads).
94
+ 75 tools: 46 reads and 29 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`); the 14 monitoring tools are also free (account administration, not metered reads).
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 **most 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, monitor/webhook delete) are annotated `destructiveHint: true` so MCP clients can prompt before running them. The **monitoring** tools (see below) are the one exception: they administer your twitterapis.com account, not an X session, so they need only your API key, no linked session and no inline credentials.
97
97
 
@@ -177,6 +177,7 @@ Watch an X account for new posts and get them pushed to your own HTTPS endpoint,
177
177
  | `twitter_monitor_update` | Pause/resume a monitor or change its `webhook_ids` restriction |
178
178
  | `twitter_monitor_delete` | Stop and remove a monitor (irreversible) |
179
179
  | `twitter_monitor_health` | One monitor's status, degradation flag, poll interval, cursor position |
180
+ | `twitter_monitor_account_health` | Account-wide rollup: service status, active/paused monitor counts, 24h delivery outcome counts, one call |
180
181
  | `twitter_monitor_deliveries` | Recent delivery events across every monitor, with detection + delivery latency |
181
182
  | `twitter_x_user_stream_add_user` | Compat drop-in for `twitter_monitor_create` using an x_user_stream-shaped envelope |
182
183
  | `twitter_x_user_stream_remove_user` | Compat drop-in for `twitter_monitor_delete` using an x_user_stream-shaped envelope |
@@ -276,7 +277,7 @@ Calls are billed to your twitterapis.com account. Almost every endpoint is $0.00
276
277
 
277
278
  **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.
278
279
 
279
- **Is it read-only?** No. 45 read tools work with just your API key; 29 write actions (post, like, retweet, follow, DM, media upload, article create/edit/publish/delete, monitor/webhook create/update/delete) act as a linked X account or per-call inline credentials, except monitor/webhook CRUD, which is account administration and needs only your API key.
280
+ **Is it read-only?** No. 46 read tools work with just your API key; 29 write actions (post, like, retweet, follow, DM, media upload, article create/edit/publish/delete, monitor/webhook create/update/delete) act as a linked X account or per-call inline credentials, except monitor/webhook CRUD, which is account administration and needs only your API key.
280
281
 
281
282
  **Which clients are supported?** Claude Desktop, Cursor, Windsurf, and VS Code (Copilot agent mode), or any Model Context Protocol client.
282
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twitterapis/mcp",
3
- "version": "0.7.2",
3
+ "version": "0.7.5",
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",
package/src/tools.js CHANGED
@@ -8,12 +8,12 @@
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: 74 tools (45 reads, 29 writes).
11
+ // Catalog: 75 tools (46 reads, 29 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
15
15
  // write actions, reads its params from the query string), except the per-call
16
- // inline credentials, which travel as x-* request headers, the 4
16
+ // inline credentials, which travel as x-* request headers, the 9
17
17
  // jsonBody tools, whose fields travel in a JSON request body, and any arg listed
18
18
  // in pathParams, which is substituted into the URL path (e.g. {id}) instead. A
19
19
  // tool with `method: "POST"` or `method: "DELETE"` is a write that acts on
@@ -1370,6 +1370,7 @@ export const TOOLS = [
1370
1370
  path: "/twitter/monitor",
1371
1371
  method: "POST",
1372
1372
  write: true,
1373
+ jsonBody: true,
1373
1374
  description:
1374
1375
  "Start watching an X account for new posts. Every new post from that handle is HMAC-signed and delivered to your registered webhook(s) on a shared poll interval (see twitter_monitor_webhook_create to register a delivery URL first). Free: monitor creation is account administration, not a metered read. Returns the new monitor's id, plus its normalized handle, status, and poll_interval_ms.",
1375
1376
  shape: {
@@ -1379,6 +1380,9 @@ export const TOOLS = [
1379
1380
  webhook_ids: z.string().optional().describe(
1380
1381
  "Optional. Comma-separated webhook id(s) from twitter_monitor_webhook_create to restrict this monitor's deliveries to. Omit to deliver to every active webhook on the account (the default).",
1381
1382
  ),
1383
+ domain_filter: z.string().optional().describe(
1384
+ "Optional. A bare hostname ('example.com') or a full URL ('https://example.com/blog') to restrict delivery to only the new posts that link to that host or a subdomain of it (e.g. 'example.com' matches both example.com and blog.example.com). Normalized server-side: lowercased, scheme/path/query/fragment/leading www./trailing :port stripped. Omit for no filter, the default (deliver every new post). Rejected with a 400 if what remains after normalization is not a valid hostname shape. A post with no matching link is filtered out of delivery, never silently dropped: it still advances the monitor's cursor and counts toward the account's tweets_domain_filtered health metric.",
1385
+ ),
1382
1386
  },
1383
1387
  },
1384
1388
  {
@@ -1393,9 +1397,10 @@ export const TOOLS = [
1393
1397
  path: "/twitter/monitor/{id}",
1394
1398
  method: "POST",
1395
1399
  write: true,
1400
+ jsonBody: true,
1396
1401
  pathParams: ["id"],
1397
1402
  description:
1398
- "Partially update an existing monitor: pause or resume it via status, change which webhooks receive its events via webhook_ids, or both in the same call (applied atomically). Resuming a paused monitor re-runs the same capacity and per-account cap checks as creating a new one, since it adds load back to the shared pool. Free per call. Both fields are optional; omit either to leave it unchanged.",
1403
+ "Partially update an existing monitor: pause or resume it via status, change which webhooks receive its events via webhook_ids, change or clear its domain_filter, or any combination in the same call (applied atomically). Resuming a paused monitor re-runs the same capacity and per-account cap checks as creating a new one, since it adds load back to the shared pool. Free per call. All three fields are optional; omit any of them to leave that part unchanged.",
1399
1404
  shape: {
1400
1405
  id: z.string().describe(
1401
1406
  "The monitor's id, from twitter_monitor_create or twitter_monitor_list.",
@@ -1406,6 +1411,9 @@ export const TOOLS = [
1406
1411
  webhook_ids: z.string().optional().describe(
1407
1412
  "Optional. Comma-separated webhook id(s) to restrict delivery to. Pass an empty string to clear the restriction back to 'deliver to every active webhook'. Omit entirely to leave it unchanged.",
1408
1413
  ),
1414
+ domain_filter: z.string().nullable().optional().describe(
1415
+ "Optional. A bare hostname or full URL to restrict delivery to, same shape and normalization as twitter_monitor_create's domain_filter. Pass an empty string (or null) to clear an existing filter back to 'deliver every new post'. Omit entirely to leave the current filter unchanged. Rejected with a 400 if a non-empty value does not normalize to a valid hostname.",
1416
+ ),
1409
1417
  },
1410
1418
  },
1411
1419
  {
@@ -1435,6 +1443,13 @@ export const TOOLS = [
1435
1443
  ),
1436
1444
  },
1437
1445
  },
1446
+ {
1447
+ name: "twitter_monitor_account_health",
1448
+ path: "/twitter/monitor/health",
1449
+ description:
1450
+ "Account-wide monitoring rollup in ONE call, distinct from twitter_monitor_health (which needs an id and reports one monitor's cursor): service status ('operational' or 'degraded'), active/paused/total counts across every monitor you own, and pending/delivered/failed delivery counts from the last 24 hours. Takes no arguments. A key with zero monitors gets zeroed counts back, never an error. Free per call.",
1451
+ shape: {},
1452
+ },
1438
1453
  {
1439
1454
  name: "twitter_monitor_deliveries",
1440
1455
  path: "/twitter/monitor/deliveries",
@@ -1451,6 +1466,7 @@ export const TOOLS = [
1451
1466
  path: "/oapi/x_user_stream/add_user_to_monitor_tweet",
1452
1467
  method: "POST",
1453
1468
  write: true,
1469
+ jsonBody: true,
1454
1470
  description:
1455
1471
  "Compat drop-in for twitter_monitor_create using an x_user_stream-shaped request/response envelope: watch an X account for new posts, translated onto the same underlying monitor system. Free per call. Prefer twitter_monitor_create for new integrations; this exists for migrating an existing x_user_stream-shaped integration without a rewrite.",
1456
1472
  shape: {
@@ -1465,6 +1481,7 @@ export const TOOLS = [
1465
1481
  method: "POST",
1466
1482
  write: true,
1467
1483
  destructive: true,
1484
+ jsonBody: true,
1468
1485
  description:
1469
1486
  "Compat drop-in for twitter_monitor_delete using an x_user_stream-shaped envelope: stop watching an account. Irreversible. Free per call.",
1470
1487
  shape: {
@@ -1485,6 +1502,7 @@ export const TOOLS = [
1485
1502
  path: "/twitter/webhook",
1486
1503
  method: "POST",
1487
1504
  write: true,
1505
+ jsonBody: true,
1488
1506
  description:
1489
1507
  "Register an HTTPS endpoint to receive signed monitor events. The HMAC signing secret is returned ONLY in this response, store it immediately: it cannot be retrieved again, and it is what you use to verify the X-TwitterAPIs-Signature header on every delivery. Free per call.",
1490
1508
  shape: {