xippios-x-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
xippios-x
Typed Python client, MCP server and FastAPI routes for X API v2, part of the xippios SDK family. Names and semantics follow the upstream documentation; every response carries its metadata (source, endpoint, retrieved_at, request).
Scope
Of X API v2 the package wraps thirteen reads, with the app's Bearer Token, in four groups of its
OpenAPI document (docs/upstream/): Users, Posts, Lists and Usage. Each but one has a task:
users by username and by id, a user's posts, posts by id, the recent search, the post counts
over the archive and over the last seven days, the Lists that a user owns, a List's posts and
its members, the project's usage and the credit balance. A documented choice that a caller of
a task cannot make stands here with its public issue:
The fields and the expansions of an answer. The tasks fix
user.fields,post.fields,list.fieldsandusage.fields;get_usersandget_users_by_idstake the one expansionmost_recent_post_id, and no other task takesexpansions, a List'sowner_idamong them;media.fields,poll.fields,place.fieldsand the counts'search_count.fieldsare never sent.pagination_tokenof the search and the counts, X's second name for theirnext_token, is left out with them (https://github.com/xippios/sdk-x/issues/62).The
urlof a List's members, other accounts, whichget_list_membersdoes not ask for (https://github.com/xippios/sdk-x/issues/23).The Lists that a user follows, the one read without a task: its wrapper
get_users_followed_listsstands, but X answered the recorded request with HTTP 403,client-not-enrolled, at the app's level of access (https://github.com/xippios/sdk-x/issues/92).
The package leaves out these reads of the four groups, and all of the other groups:
the search of the whole archive (https://github.com/xippios/sdk-x/issues/39);
a single user, a single post and a List by id, and a single user by username (https://github.com/xippios/sdk-x/issues/40);
the search of users, the mentions, followers, followed users, affiliates and List memberships of a user, the quotes and reposts of a post and the followers of a List (https://github.com/xippios/sdk-x/issues/41);
the other groups, Spaces, News, Trends, Communities and Media among them, the streams, every write and every read in a user's context (https://github.com/xippios/sdk-x/issues/42).
What the package adds is the check of a call before its request, the pace of one request a
second and errors that say what X refused. It writes no query, ranks and stores no post and
collects no pages: a conversation is the caller's own
search_recent_posts("conversation_id:<id>").
Related MCP server: x-mcp-ai
Install
uv add xippios-x # client only
uv add "xippios-x[mcp]" # + MCP server
uv add "xippios-x[http]" # + FastAPI routerSet X_API_KEY in the environment to your X app's Bearer Token, which X also calls the
App only Access Token (Developer Console, Keys and tokens), not the console's API Key,
the OAuth 1.0a consumer key. Nothing is read from files.
30-second example
from xippios.x import tasks
users = tasks.get_users(["USDA", "FAO"]) # 0.010 USD a user found
usda = next(user for user in users.data.data if user.username == "USDA")
page = tasks.get_user_posts(usda.id, max_results=10) # 0.005 USD a post returned
for post in page.data.data or []:
print(post.created_at, post.public_metrics.like_count, post.text)
print(page.meta.retrieved_at, page.meta.request, page.data.meta.result_count)
older = tasks.get_user_posts(usda.id, pagination_token=page.data.meta.next_token)Every task returns one page as X sends it, in result.data; a call that returns data
spends X credits at the prices of X's pricing page, which each task's docstring names (the
page states none for get_usage and get_usage_credits). Paging is the caller's, with the
next_token of the previous page's meta. What identifies an answer, usernames, id or query, is
positional, and every other argument goes by name. A task sends its one request once, since X
bills a read: no error is retried, and RateLimitError.retry_after says how many seconds to
wait before the next call.
get_users returns the users found in data and a problem in errors for each username that
X does not find, also where it finds none, get_users_by_ids likewise for each user id, and
get_posts the posts found and a problem for each id that it does not find; get_user_posts,
get_user_owned_lists and get_list_posts raise NotFoundError for a user or a List that X
lacks, while get_list_members returns X's page for a List that X lacks,
as X sends it. get_user_posts and get_list_posts raise AuthError with X's words for a
user or a List whose posts X withholds, a protected user or a private List say. A call that the package refuses before its
request raises InvalidRequestError, whose text ends with Nothing was sent..
meta.published_at and meta.vintage stay empty: X states no release time and no release
identifier for a page, and each post carries its own created_at.
The thirteen wrappers of xippios.x.api are async and return core's Answer: X's page in
payload and the time at which the client got it in retrieved_at, which a task gives as
meta.retrieved_at.
MCP
{
"mcpServers": {
"x": {
"command": "uvx",
"args": ["--from", "xippios-x[mcp]", "xippios-x-mcp"],
"env": { "X_API_KEY": "..." }
}
}
}xippios-x-mcp serves stdio; --http serves streamable HTTP instead. Tools are read-only
and named x_<verb>_<noun>; every call that returns data spends X credits, and each
tool's description gives its price (the pricing page states none for x_get_usage and
x_get_usage_credits). A tool returns one page, which its result cap holds whole for
Latin-script text: up to 100 posts in 140,000 bytes, 100 users or 100 members of a List in
160,000, about 65 users with their most recent posts, and 64 KB for 100 Lists of a user, in any
script, and for the counts, which a month of hourly buckets fits. A page
of mostly non-Latin text or with long posts, whose whole text comes in note_post, or minute
counts over more than about 14 hours, can be cut, with a note on how to see the rest.
Status
Upstream operation | Task function | MCP tool | Status |
|
|
| alpha; 0.010 USD a user, 0.005 USD more with |
|
|
| alpha; 0.010 USD a user, 0.005 USD more with |
|
|
| alpha; 0.005 USD a post |
|
|
| alpha; 0.005 USD a post |
|
|
| alpha; 0.005 USD a post; query of 512 characters at most |
|
|
| alpha; 0.010 USD a request; query of 1,024 characters at most |
|
|
| alpha; 0.005 USD a request; query of 512 characters at most |
|
|
| alpha; 0.005 USD a List |
|
|
| alpha; 0.005 USD a post |
|
|
| alpha; 0.010 USD a member, counted as a user |
|
|
| alpha; no price stated |
|
|
| alpha; no price stated |
Prices are those of X's pricing page in the snapshot that docs/upstream/FETCHED.md dates
(docs/upstream/pages/pricing.md); a post or user read again the same UTC day is not billed
again, a counts request always is. A List of a user is billed as List: Read. The page does not
say how a List's posts and members are billed, so they are counted as posts and users, the upper
bound.
Upstream terms and attribution
Data comes from X API v2 (https://x.com) under the
X Developer Agreement and the
X Developer Policy, which bind every app that
uses it; this package adds no rights to it. Documentation snapshot and its attribution:
docs/upstream/FETCHED.md.
Workflows
ci.yml runs ruff, its format check, mypy, pytest and pre-commit on Python 3.12, 3.13 and
3.14, requires a changelog entry of every pull request but Dependabot's and refuses a
fixture file over 256 KiB that a pull request adds or changes. It runs on every pull request and,
called by publish.yml, once for a release, and its job ci is the check the
organization's ruleset requires. It is handed no secret, and no variable switches it off.
publish.yml is the release train (conventions §12): on a push to main whose
pyproject.toml names a version that has no tag yet and has its section in CHANGELOG.md,
it runs ci.yml, refuses a core pinned to git, tags the merge commit, builds the package
and, once a reviewer of the environment pypi approves the run, publishes it to PyPI by
trusted publishing. Every push to main and a dispatch start it, and a push that brings no
release ends quietly. It is handed no secret: the step that tells a release is handed the
job's token as GH_TOKEN, the tag goes with the job's token and PyPI trusts the workflow
itself. Its job tag holds the one checkout of the repository that keeps its credentials,
since it pushes the tag with the job's token; every other checkout sets
persist-credentials: false (conventions §13). No variable switches it off.
live.yml runs every live test against the upstream with --tb=short --assert=plain, so
its public log holds neither a failing test's arguments nor the values an assertion compared.
It runs every night at 01:24 UTC and on demand, never on a pull request.
Each test fails on an empty page. The nightly run spends one billable call, the test whose turn
it is by the day's number, so that each of the ten tasks that X bills runs once in ten nights,
and reads the usage and the credit balance, for which X's pricing page states no price; the nine
other tests skip there, and every test runs on demand.
Its pytest step alone is handed XIPPIOS_LIVE_TESTS and, each from the secret of the same
name, X_API_KEY, so the checkout, setup-uv and uv sync see none.
A variable WORKFLOW_LIVE of off, the repository's over the organization's, switches it off.
conventions.yml calls the organization's review of a pull request against the documents
listed under Documents below, the check conventions / conventions, when a pull request
opens, is pushed to, reopens or is edited, and on a push to main or a dispatch the review
of the range of commits, range / range. It hands the review the organization's
secret of the model's key, by name. A variable WORKFLOW_CONVENTIONS of off, the
repository's over the organization's, switches both off.
adr-index.yml calls the organization's check of the ADR index, adr-index / adr-index,
which runs scripts/adr_index.py --check, when a pull request opens, is pushed to or
reopens. It hands over nothing, and the called workflow reads its switch itself: a variable
WORKFLOW_ADR_INDEX of off, the repository's over the organization's, skips the check.
Documents
sdk-core: docs/conventions.md — the conventions every xippios source package follows: its layout, names, results, tests and releases.
sdk-core: docs/adr.md — the index of the family's architecture decisions, which the conventions cite.
sdk-core: docs/definition-of-done.md — what a change satisfies before its pull request is opened.
sdk-core: docs/review-checklist.md — what the review of a pull request checks, in order.
sdk-x: docs/adr.md — the index of this package's own decisions, generated from the records in
docs/adr/.sdk-x: docs/upstream/FETCHED.md — the snapshot of the upstream documentation, the reference for names, parameters and semantics.
sdk-x: docs/upstream/OBSERVED.md — what X does but never documents, each note with its request and its date.
Licence
Apache-2.0. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only public X (Twitter) data: profiles, tweets, threads, followers, search. Pay per result.
Hosted TwitterAPI.io MCP: read-only Twitter/X search, users, followers, replies, quotes, trends.
Official MCP server for twitterapis.com. Twitter/X search, users, DMs, Grok, monitoring and writes.
Official twitterapi.io hosted MCP: Twitter/X tweets, users, followers, trends. OAuth or API key.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA read-only X/Twitter MCP server that enables data retrieval for user profiles, tweets, and social graphs using OAuth 2.0 Bearer Token authentication. It supports searching recent tweets, viewing timelines, and tracking engagement metrics like followers, likes, and retweets.3MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to interact with the X (Twitter) API v2 through 41 typed tools for reading, searching, engaging, publishing, and managing content, with policy-based access control and session credit budgets to prevent overspending.4151 npm1MIT
- AlicenseBqualityDmaintenanceEnables access to the X API v2 through MCP, covering 175 of 190 published operations with tools for browsing, calling, posting, searching, and managing posts.711 npmMIT
- AlicenseAqualityBmaintenanceEnables read-only access to X API v2 data through official xurl OAuth credentials, with structured tools for posts, users, timelines, search, conversations, media metadata, and account credit status. It returns consistent JSON envelopes with pagination and classified errors while excluding write actions and secondary token storage.7MIT