X (Twitter) MCP by usefulapi

v1.3.1
io.usefulapi/twitter-x Checked 3 days ago Published 2 days ago

Look up users, search and read posts, and publish or delete your own posts in X.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

twitterx_get_user_by_username Get a user by username

Look up an X user by username and return the user object (id, name, description, public metrics). Use this first to get the numeric user id the other tools need. X API: GET /2/users/by/username/{username}.

ParameterTypeDescription
username *stringX username, with or without the leading @.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_user Get a user by id

Get one X user by numeric id, with the requested user fields. X API: GET /2/users/{id}.

ParameterTypeDescription
user_id *stringNumeric X id.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_me Get the authenticated user

Return the X account that owns the token. Needs the X sign-in (user context); an app-only Bearer Token gets an error. X API: GET /2/users/me.

ParameterTypeDescription
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_followers List followers

List the followers of a user, one page at a time (up to 1000 per page). Follow meta.next_token for more. X API: GET /2/users/{id}/followers.

ParameterTypeDescription
user_id *stringNumeric X id.
max_resultsintegerUsers per page, 1-1000.
pagination_tokenstringPagination token from meta.next_token of the previous page.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_following List accounts a user follows

List the accounts one user follows, one page at a time (up to 1000 per page). X API: GET /2/users/{id}/following.

ParameterTypeDescription
user_id *stringNumeric X id.
max_resultsintegerUsers per page, 1-1000.
pagination_tokenstringPagination token from meta.next_token of the previous page.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_post Get a post by id

Get one X post by numeric id, with the requested post fields and expansions. X API: GET /2/tweets/{id}.

ParameterTypeDescription
post_id *stringNumeric X id.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_posts Get several posts by id

Get up to 100 X posts in one call from a comma list of numeric ids. X API: GET /2/tweets?ids=.

ParameterTypeDescription
post_ids *stringComma-separated numeric post ids, up to 100.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_search_recent_posts Search recent posts

Search X posts from the last 7 days with the X query language (operators such as from:, to:, lang:, -is:retweet). Returns up to 100 posts per page. X API: GET /2/tweets/search/recent.

ParameterTypeDescription
query *stringX search query, for example "mcp server lang:en -is:retweet".
end_timestringISO 8601 end time, e.g. 2026-11-20T00:00:00Z.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
max_resultsintegerPosts per page, 10-100.
next_tokenstringPagination token from meta.next_token.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
sort_orderstringResult order.
start_timestringISO 8601 start time, e.g. 2026-11-01T00:00:00Z.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_user_posts List a user's posts

List the posts of one user, newest first, one page at a time. Replies and retweets can be excluded. X API: GET /2/users/{id}/tweets.

ParameterTypeDescription
user_id *stringNumeric X id.
end_timestringISO 8601 end time, e.g. 2026-11-20T00:00:00Z.
excludestringComma list to exclude: retweets, replies.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
max_resultsintegerPosts per page, 5-100.
pagination_tokenstringPagination token from meta.next_token of the previous page.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
start_timestringISO 8601 start time, e.g. 2026-11-01T00:00:00Z.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_user_mentions List posts that mention a user

List posts that mention one user, one page at a time. X API: GET /2/users/{id}/mentions.

ParameterTypeDescription
user_id *stringNumeric X id.
end_timestringISO 8601 end time, e.g. 2026-11-20T00:00:00Z.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
max_resultsintegerPosts per page, 5-100.
pagination_tokenstringPagination token from meta.next_token of the previous page.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
start_timestringISO 8601 start time, e.g. 2026-11-01T00:00:00Z.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_get_liked_posts List posts a user liked

List the posts one user liked, one page at a time. X API: GET /2/users/{id}/liked_tweets.

ParameterTypeDescription
user_id *stringNumeric X id.
expansionsstringComma list of expansions, e.g. author_id,attachments.media_keys.
max_resultsintegerPosts per page, 1-100.
pagination_tokenstringPagination token from meta.next_token of the previous page.
post_fieldsstringComma list of post fields, e.g. created_at,public_metrics,author_id.
user_fieldsstringComma list of user fields, e.g. description,public_metrics,verified.

twitterx_create_post Create a post

Publish one post from the authenticated account, only when the user asks for it. Needs a user-context access token and uses pay-per-usage credits. Set reply_to_post_id to reply to a post. X API: POST /2/tweets.

ParameterTypeDescription
text *stringPost text, up to 280 characters.
reply_to_post_idstringPost id to reply to, if any.

twitterx_delete_post Delete a post

Delete one post from the authenticated account, only when the user asks for it. This cannot be undone. Needs a user-context access token. X API: DELETE /2/tweets/{id}.

ParameterTypeDescription
post_id *stringNumeric X id.