twitterapi-io-mcp 1.0.16 → 1.0.17
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/data/docs.json +17 -7
- package/index.js +13 -6
- package/package.json +1 -1
package/data/docs.json
CHANGED
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"scraped_at": "2025-12-27T12:27:28.087Z",
|
|
143
143
|
"type": "endpoint",
|
|
144
144
|
"title": "twitterapi.io - Twitter data, 96% cheaper. No auth, no limits, just API.",
|
|
145
|
-
"description": "Create a tweet.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Trial operation price: $0.003 per call. ",
|
|
145
|
+
"description": "Create a tweet.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Trial operation price: $0.003 per call. TROUBLESHOOTING: If you get 400 errors, the most common cause is a faulty login_cookie. Ensure you used a valid 16-character string totp_secret (not numbers) when calling user_login_v2. Re-login with the correct totp_secret to get a fresh cookie.",
|
|
146
146
|
"path": "/twitter/create_tweet_v2",
|
|
147
147
|
"code_snippets": [
|
|
148
148
|
"curl --request POST \\\n --url https://api.twitterapi.io/twitter/create_tweet_v2 \\\n --header 'Content-Type: application/json' \\\n --header 'X-API-Key: <api-key>' \\\n --data '\n{\n \"login_cookies\": \"<string>\",\n \"tweet_text\": \"<string>\",\n \"proxy\": \"<string>\",\n \"reply_to_tweet_id\": \"<string>\",\n \"attachment_url\": \"<string>\",\n \"community_id\": \"<string>\",\n \"is_note_tweet\": true,\n \"media_ids\": \"<array>\"\n}\n'",
|
|
@@ -947,7 +947,7 @@
|
|
|
947
947
|
"scraped_at": "2025-12-27T12:27:45.765Z",
|
|
948
948
|
"type": "endpoint",
|
|
949
949
|
"title": "twitterapi.io - Twitter data, 96% cheaper. No auth, no limits, just API.",
|
|
950
|
-
"description": "Log in directly using your email, username, password, and 2FA secret key. And obtain the Login_cookie, to post tweets, etc. Please note that the Login_cookie obtained through login_v2 can only be used for APIs with the \"v2\" suffix, such as create_tweet_v2. Trial operation price: $0.003 per call. ",
|
|
950
|
+
"description": "Log in directly using your email, username, password, and 2FA secret key. And obtain the Login_cookie, to post tweets, etc. Please note that the Login_cookie obtained through login_v2 can only be used for APIs with the \"v2\" suffix, such as create_tweet_v2. Trial operation price: $0.003 per call. IMPORTANT: The totp_secret (2FA secret) must be a 16-character string (not numbers). Without a valid totp_secret, the login_cookie may be faulty, causing 400 errors on all V2 action endpoints (create_tweet_v2, like_tweet_v2, etc.). We highly recommend enabling 2FA for reliable cookie generation.",
|
|
951
951
|
"path": "/twitter/user_login_v2",
|
|
952
952
|
"code_snippets": [
|
|
953
953
|
"curl --request POST \\\n --url https://api.twitterapi.io/twitter/user_login_v2 \\\n --header 'Content-Type: application/json' \\\n --header 'X-API-Key: <api-key>' \\\n --data '\n{\n \"user_name\": \"<string>\",\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"proxy\": \"<string>\",\n \"totp_secret\": \"<string>\"\n}\n'",
|
|
@@ -966,7 +966,9 @@
|
|
|
966
966
|
"url": "https://docs.twitterapi.io/api-reference/endpoint/update_avatar_v2",
|
|
967
967
|
"description": "Update Twitter profile picture. Requires login_cookies from user_login_v2. Trial price: $0.003/call. Image: JPG/PNG, 400x400px recommended, max 700KB.",
|
|
968
968
|
"raw_text": "PATCH /twitter/update_avatar_v2 - Update profile picture. Parameters: login_cookies (required), proxy (required), file (binary, required). Response: {status, message}",
|
|
969
|
-
"scraped_at": "2026-01-26T10:24:36.597Z"
|
|
969
|
+
"scraped_at": "2026-01-26T10:24:36.597Z",
|
|
970
|
+
"method": "PATCH",
|
|
971
|
+
"curl_example": "curl --request PATCH \\\n --url https://api.twitterapi.io/twitter/update_avatar_v2 \\\n --header 'Content-Type: multipart/form-data' \\\n --header 'X-API-Key: <api-key>' \\\n --form file=@avatar.jpg \\\n --form 'proxy=<string>' \\\n --form 'login_cookies=<string>'"
|
|
970
972
|
},
|
|
971
973
|
"update_banner_v2": {
|
|
972
974
|
"name": "update_banner_v2",
|
|
@@ -976,7 +978,9 @@
|
|
|
976
978
|
"url": "https://docs.twitterapi.io/api-reference/endpoint/update_banner_v2",
|
|
977
979
|
"description": "Update Twitter banner/header image. Requires login_cookies from user_login_v2. Trial price: $0.003/call. Image: JPG/PNG, 1500x500px recommended, max 2MB.",
|
|
978
980
|
"raw_text": "PATCH /twitter/update_banner_v2 - Update banner image. Parameters: login_cookies (required), proxy (required), file (binary, required). Response: {status, message}",
|
|
979
|
-
"scraped_at": "2026-01-26T10:24:36.598Z"
|
|
981
|
+
"scraped_at": "2026-01-26T10:24:36.598Z",
|
|
982
|
+
"method": "PATCH",
|
|
983
|
+
"curl_example": "curl --request PATCH \\\n --url https://api.twitterapi.io/twitter/update_banner_v2 \\\n --header 'Content-Type: multipart/form-data' \\\n --header 'X-API-Key: <api-key>' \\\n --form file=@banner.jpg \\\n --form 'proxy=<string>' \\\n --form 'login_cookies=<string>'"
|
|
980
984
|
},
|
|
981
985
|
"update_profile_v2": {
|
|
982
986
|
"name": "update_profile_v2",
|
|
@@ -986,7 +990,9 @@
|
|
|
986
990
|
"url": "https://docs.twitterapi.io/api-reference/endpoint/update_profile_v2",
|
|
987
991
|
"description": "Update Twitter profile info (name, bio, location, url). Requires login_cookies from user_login_v2. Trial price: $0.003/call.",
|
|
988
992
|
"raw_text": "PATCH /twitter/update_profile_v2 - Update profile info. Parameters: login_cookies (required), proxy (required), name (optional, max 50 chars), description (optional, max 160 chars), location (optional, max 30 chars), url (optional). Response: {status, message}",
|
|
989
|
-
"scraped_at": "2026-01-26T10:24:36.598Z"
|
|
993
|
+
"scraped_at": "2026-01-26T10:24:36.598Z",
|
|
994
|
+
"method": "PATCH",
|
|
995
|
+
"curl_example": "curl --request PATCH \\\n --url https://api.twitterapi.io/twitter/update_profile_v2 \\\n --header 'Content-Type: application/json' \\\n --header 'X-API-Key: <api-key>' \\\n --data '{\n \"login_cookies\": \"<string>\",\n \"proxy\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"location\": \"<string>\",\n \"url\": \"<string>\"\n}'"
|
|
990
996
|
},
|
|
991
997
|
"get_tweet_replies_v2": {
|
|
992
998
|
"name": "get_tweet_replies_v2",
|
|
@@ -996,7 +1002,9 @@
|
|
|
996
1002
|
"url": "https://docs.twitterapi.io/api-reference/endpoint/get_tweet_replies_v2",
|
|
997
1003
|
"description": "Get tweet replies by tweet ID (V2). Returns up to 20 replies per page. Supports pagination and sorting by Relevance, Latest, or Likes.",
|
|
998
1004
|
"raw_text": "GET /twitter/tweet/replies/v2 - Get tweet replies. Parameters: tweetId (required), cursor (optional), queryType (optional: Relevance/Latest/Likes). Response: {replies[], has_next_page, next_cursor, status, message}",
|
|
999
|
-
"scraped_at": "2026-01-26T10:24:36.598Z"
|
|
1005
|
+
"scraped_at": "2026-01-26T10:24:36.598Z",
|
|
1006
|
+
"method": "GET",
|
|
1007
|
+
"curl_example": "curl --request GET \\\n --url https://api.twitterapi.io/twitter/tweet/replies/v2 \\\n --header 'X-API-Key: <api-key>'"
|
|
1000
1008
|
},
|
|
1001
1009
|
"get_user_to_monitor_tweet": {
|
|
1002
1010
|
"name": "get_user_to_monitor_tweet",
|
|
@@ -1006,7 +1014,9 @@
|
|
|
1006
1014
|
"url": "https://docs.twitterapi.io/api-reference/endpoint/get_user_to_monitor_tweet",
|
|
1007
1015
|
"description": "Get all users that have been added for tweet monitoring. Returns list of monitored users with their settings.",
|
|
1008
1016
|
"raw_text": "GET /oapi/x_user_stream/get_user_to_monitor_tweet - Get monitored users. No parameters required. Response: {status, msg, data[{id_for_user, x_user_id, x_user_name, x_user_screen_name, is_monitor_tweet, is_monitor_profile, ...}]}",
|
|
1009
|
-
"scraped_at": "2026-01-26T10:24:36.598Z"
|
|
1017
|
+
"scraped_at": "2026-01-26T10:24:36.598Z",
|
|
1018
|
+
"method": "GET",
|
|
1019
|
+
"curl_example": "curl --request GET \\\n --url https://api.twitterapi.io/oapi/x_user_stream/get_user_to_monitor_tweet \\\n --header 'X-API-Key: <api-key>'"
|
|
1010
1020
|
}
|
|
1011
1021
|
},
|
|
1012
1022
|
"pages": {
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* TwitterAPI.io Documentation MCP Server v1.0.
|
|
3
|
+
* TwitterAPI.io Documentation MCP Server v1.0.17
|
|
4
4
|
*
|
|
5
5
|
* Production-ready MCP server with:
|
|
6
6
|
* - Comprehensive error handling with ErrorType classification
|
|
@@ -1151,7 +1151,9 @@ function resolveAuthMeta(authMeta) {
|
|
|
1151
1151
|
function formatEndpointMarkdown(endpointName, endpoint, authMeta = {}) {
|
|
1152
1152
|
const auth = resolveAuthMeta(authMeta);
|
|
1153
1153
|
const extractedMethod = extractHttpMethodFromCurl(endpoint?.curl_example);
|
|
1154
|
-
const
|
|
1154
|
+
const typeUpper = endpoint.type?.toUpperCase?.();
|
|
1155
|
+
const typeMethod = typeUpper && VALID_HTTP_METHODS.has(typeUpper) ? typeUpper : null;
|
|
1156
|
+
const method = endpoint.method || typeMethod || extractedMethod || "GET";
|
|
1155
1157
|
const curlExample =
|
|
1156
1158
|
endpoint.curl_example ||
|
|
1157
1159
|
`curl --request ${method} \\\n --url ${auth.baseUrl}${endpoint.path || ''} \\\n --header '${auth.header}: ${auth.headerValue}'`;
|
|
@@ -1195,8 +1197,13 @@ function extractHttpMethodFromCurl(curlExample) {
|
|
|
1195
1197
|
return match?.[1] ? match[1].toUpperCase() : null;
|
|
1196
1198
|
}
|
|
1197
1199
|
|
|
1200
|
+
const VALID_HTTP_METHODS = new Set(["GET", "POST", "PUT", "DELETE", "PATCH"]);
|
|
1201
|
+
|
|
1198
1202
|
function getEndpointMethod(endpoint) {
|
|
1199
|
-
|
|
1203
|
+
if (endpoint?.method) return endpoint.method;
|
|
1204
|
+
const t = endpoint?.type?.toUpperCase?.();
|
|
1205
|
+
if (t && VALID_HTTP_METHODS.has(t)) return t;
|
|
1206
|
+
return extractHttpMethodFromCurl(endpoint?.curl_example) || "GET";
|
|
1200
1207
|
}
|
|
1201
1208
|
|
|
1202
1209
|
function safeCanonicalizeUrl(url) {
|
|
@@ -2299,9 +2306,9 @@ ${examples.javascript}
|
|
|
2299
2306
|
\`\`\``;
|
|
2300
2307
|
|
|
2301
2308
|
return formatToolSuccess(markdown, {
|
|
2302
|
-
header,
|
|
2303
|
-
base_url: baseUrl,
|
|
2304
|
-
dashboard_url: dashboardUrl,
|
|
2309
|
+
header: auth.header,
|
|
2310
|
+
base_url: auth.baseUrl,
|
|
2311
|
+
dashboard_url: auth.dashboardUrl,
|
|
2305
2312
|
examples,
|
|
2306
2313
|
markdown
|
|
2307
2314
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twitterapi-io-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"mcpName": "io.github.dorukardahan/twitterapi-io-mcp",
|
|
5
5
|
"description": "TwitterAPI.io MCP server providing offline access to docs (endpoints, pages, blogs) for Claude and other AI assistants",
|
|
6
6
|
"main": "index.js",
|