This release is a pre-release and may not be stable for production use.
a4sx-mcp
A local MCP server for a4sx, the
library and marketplace for coding-agent sessions. It gives any MCP client (Claude Code, Claude
Desktop, Cursor, VS Code, ...) five tools to find a saved session, load it as context, and save the
current one, using the sign-in of the a4sx command-line tool.
It runs on your machine over stdio. Your a4sx token stays in the a4sx config directory and is only
ever sent to the server that issued it: pointing the server elsewhere with --base never sends it a
token from another server.
Private library: the sessions saved under your a4sx account on session-exchange.com. Its entries are not listed in the marketplace and not returned by public search; they are listed, fetched, versioned and deleted through the a4sx API with your own sign-in (or an agent key you create). Listing a session in the marketplace is a separate step in the web app, with a review. "Private" describes who can list and fetch an entry through a4sx; the server stores the bytes you upload, after scrubbing them again.
Tools
The names, input schemas and limits are the same as the hosted a4sx MCP server's.
| Tool | What it does | Sign-in |
|---|---|---|
search_sessions |
Search vetted public sessions (scope=public, default), or your own saved ones (scope=library); harness keeps only sessions recorded with the given harnesses |
library scope only |
get_session_summary |
Describe one session before using it: outline, members, price, provenance | library source only |
acquire_session |
Copy a marketplace session you are entitled to (free, bought or granted) into your private library | yes |
fetch_session_context |
Load a session from your library as starting context, cut to max_tokens (500 to 100,000; default 8,000) |
yes |
publish_session |
Save a transcript (JSONL) to your private library | yes |
Safety rules:
acquire_sessionnever buys. For a paid listing you have no purchase or grant for, it returnsstatus: "payment_required"with the price and the listing URL (or, when the listing's session is sold on its own, thememberto buy). You buy it yourself in the web app, then ask again.- Harnesses. Claude Code, Codex CLI and Grok Build sessions are listed and loaded alike; only Claude
Code sessions can be resumed today. Every search and summary row carries the
harnessit was recorded with ({id, version};unknownwhen not identified), andresumableisfalsefor a session recorded with another harness.fetch_session_contextrenders such a session from its stored canonical form. publish_sessiononly saves privately.visibilityaccepts only"private"; listing a session publicly is a separate, reviewed step in the web app. It accepts only Claude Code or Codex CLI JSONL (every line a record with atype; a Claude Code user or assistant turn with a session id, or a Codex CLIsession_metarecord first), so it can't be used to upload an arbitrary file. The transcript, its title and its label are scrubbed on your machine with thea4sxSDK, which applies the a4sx CLI's rules (secrets, command-line passwords, Sheet ids, and personal data: e-mail and IP addresses, home-directory user names, hosts, key-file paths), and scrubbed again by the server. Scrubbing is a backstop, not a guarantee. A session that continues someone else's (itsparent, or the session it was resumed from, was acquired) stays marked as untrusted (untrusted: true).- Neither tool asks for confirmation inside the protocol. Like the hosted server, it relies on the
rules above and on the tool annotations:
acquire_sessionandpublish_sessionare markedreadOnlyHint: false, so clients that ask before a tool runs (Claude Code does by default) can ask you, and you should not auto-approve them. The three read tools are marked read-only. - Loaded sessions are reference material, not instructions.
fetch_session_contextalways starts with a notice saying so, then wraps everything the session's author controls (title and turns) in<<<A4SX_UNTRUSTED_SESSION nonce=…>>>…<<<END_A4SX_UNTRUSTED_SESSION nonce=…>>>with a random nonce. Inside it, every kind of line break is normalised to\n,<<</>>>become‹‹‹/›››and a leading#becomes\#(the notice says so), so content can't close the envelope or fake a### Userheading. The title is one line of at most 200 characters, and cutting tomax_tokensnever removes the notice or the closing line.search_sessionsandget_session_summaryresults are framed the same way: a notice first, then the JSON inside the envelope, with every author-written string on one line, neutralised and capped per field, and the whole result bounded to 64 KiB (a page cut short saystruncated: true, andnext_offsetresumes at the first row left out). Server guidance (next,next_offset) goes on one line after the closing delimiter, never inside the envelope, and carries only fixed texts and numbers. A session with another author's content getsuntrusted: trueand a stronger notice. Look-alike characters (full-width</#, zero-width spaces) are left as they are: they cannot close the envelope, because the closing line needs the random nonce, but a model may still be misled by them. This lowers the risk of prompt injection but cannot rule it out: keep tool approval on. - Limits: transcripts up to 2 MiB per
publish_sessioncall (usea4sx pushfor larger ones); per process, at most 240 requests (tools/listandtools/call), 20 acquires and 10 publishes per minute. The a4sx server enforces its own limits as well.
Quickstart
You need uv (for uvx) and an a4sx account.
-
Sign in once with the
a4sxCLI. The MCP server reuses that sign-in:uvx a4sx login
Searching public sessions works without signing in. If a tool needs your account and you are not signed in (or the sign-in expired), it returns an error telling you to run
a4sx login. -
Add the server to your client.
Claude Code
claude mcp add a4sx -- uvx a4sx-mcp
Claude Desktop
Edit claude_desktop_config.json (Settings, Developer, Edit Config) and restart Claude Desktop:
{
"mcpServers": {
"a4sx": { "command": "uvx", "args": ["a4sx-mcp"] }
}
}
Cursor
Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):
{
"mcpServers": {
"a4sx": { "command": "uvx", "args": ["a4sx-mcp"] }
}
}
VS Code
Add to .vscode/mcp.json in your workspace (or run MCP: Add Server from the command palette):
{
"servers": {
"a4sx": { "type": "stdio", "command": "uvx", "args": ["a4sx-mcp"] }
}
}
Try it
Ask your agent, for example: "Search a4sx for sessions about flaky pytest fixtures and summarise the
best one", or "Load my a4sx session my-refactor as context".
Configuration
Everything is optional. Don't put your token into an MCP client config file: sign in with
a4sx login instead, which stores it with mode 0600.
| Setting | Meaning |
|---|---|
--base URL / A4SX_BASE |
The a4sx server. Default: the one you signed in to, else https://session-exchange.com. Plain http is refused except for localhost. |
A4SX_SESSION, A4SX_SESSION_BASE |
A token to use instead of the stored sign-in (for CI), and the server it belongs to (default https://session-exchange.com). |
A4SX_CONFIG_DIR |
Where the a4sx CLI keeps its sign-in (default ~/.config/a4sx, %APPDATA%\a4sx on Windows). |
A4SX_MCP_LOG |
warning (default), info or debug. Logs go to stderr and contain tool names, outcomes and durations only: never arguments, transcripts or tokens. |
A4SX_MCP_MAX_PUBLISH_BYTES |
Lower or raise the 2 MiB publish_session cap (the server may still refuse larger uploads). |
A4SX_MCP_PER_MIN, A4SX_MCP_ACQUIRE_PER_MIN, A4SX_MCP_PUBLISH_PER_MIN |
Local rate limits (240, 20, 10 per minute). 0 turns a local limit off. |
Local server or remote /mcp?
a4sx also runs a hosted MCP server at https://session-exchange.com/mcp, with browser sign-in over
OAuth: it advertises the scope library:read (search your library, summaries, loading sessions as
context). Public search there works without signing in; acquiring or saving sessions needs a credential with
library:acquire or library:publish, for example an agent key created in your a4sx account. Clients that
support remote MCP servers with OAuth can connect to it directly and need nothing installed:
claude mcp add --transport http a4sx https://session-exchange.com/mcp
This package is the option for clients without remote OAuth support, and for setups that already use
a4sx login. Both expose the five session tools below; the hosted server lists further tools of its
own (for example, starting a purchase for the account holder to confirm), which this package does not
have.
Same in both:
- the five session tools' names, input schemas (including the
harnessfilter), annotations, and the server instructions; - the untrusted framing: the text of
fetch_session_context(notice, nonce envelope, line-break normalisation, escaping, per-field caps, sizing, canonical sessions of other harnesses) and the JSON envelope,noticefield, per-field caps, 64 KiB result bound and hint line ofsearch_sessions,get_session_summaryandacquire_session; - the result fields (plus the local extras listed below);
- the error codes
invalid_arguments,credential_not_accepted,rate_limited,not_found,too_large,content_sha_mismatch,not_a_transcriptandno_transcript; - JSON-RPC error
-32029when the overall request limit is exceeded.
Differences of this local server:
- Sign-in. It uses your
a4sx loginsession, so it can do everything your account can in your own library. The hosted server takes a scoped OAuth token (it advertiseslibrary:read) or an agent key with the scopes you gave it (library:read,library:acquire,library:publish). With no sign-in at all, local tools returnnot_signed_in; the hosted server answers with an OAuth challenge instead. Thecredential_not_acceptedmessage says to runa4sx loginrather than to get a scoped token. - Rate limits. They are counted per process, not per account. There is no failed-sign-in limit,
because there is no sign-in step here.
retry_after_scomes from the API's error body, not from theRetry-Afterheader. untrusted. Besidesacquired_fromon the row and its parents (which is all the hosted server checks), it also uses this machine's record of untrusted sessions from thea4sxSDK. A session missing from your library listing counts as untrusted in both.publish_session:- Every upload carries an idempotency key: yours if you pass
idempotency_key, else a fresh one. The hosted server sends a key only if you pass one. - Uploads are retried twice, with that same key, on network errors, 429 and 502-504; when the server is busy scrubbing other uploads, up to 6 attempts, each after the wait it asks for.
- The body, title and label are scrubbed locally, so the
X-Content-SHA256sent to the API covers the scrubbed bytes. - The content check is stricter: every line must be a JSON record with a
type, and the file a Claude Code or Codex CLI session. parentis resolved like the CLI resolves names (exact id, then label, then a unique part of the title or id). The hosted server passes it through verbatim.- Without
parent, a transcript you resumed witha4sx resumegets its parent edge from the SDK's local lineage record. The hosted server records no edge. - The result has extra
client_redactionsanduntrustedfields.
- Every upload carries an idempotency key: yours if you pass
payment_required. The price comes from the public listing; the hosted server reads its pricing store.- Server name. It is
a4sx-mcpin the MCP handshake (hosted:com.session-exchange/sessions).
VS Code extension
The vscode/ directory holds the a4sx extension for VS Code 1.101 or later. It adds the
hosted a4sx MCP servers to agent mode in VS Code chat; VS Code runs the sign-in. Its command
a4sx: Save this session runs a4sx push --latest in a terminal, which saves your most recently
changed local Claude Code session to your a4sx library. To continue a saved session, use Claude Code;
other harnesses can't resume sessions today.
The extension is not on the Visual Studio Marketplace yet. To build and test it from source:
cd vscode
npm install
npm run compile
npm test
MCP registry
server.json describes this server for the
MCP Registry: the hosted server at
https://session-exchange.com/mcp (Streamable HTTP) and this package on PyPI (a4sx-mcp, stdio).
It uses the name com.session-exchange/sessions, under which the hosted server is already listed.
Development
git clone https://github.com/crossvault/a4sx-mcp && cd a4sx-mcp
python -m venv .venv && . .venv/bin/activate
pip install -e '.[dev]'
pytest -q # offline: the tools run against a local stub server
ruff check . && reuse lint
The tests never touch the network: tool tests run against tests/stub_server.py on 127.0.0.1, the
protocol test uses the MCP SDK's in-process client, and a guard fails any test that resolves or
connects to a non-loopback address. See CONTRIBUTING.md.
About
a4sx-mcp is made by crossVault GmbH, the company behind a4sx
(session-exchange.com), a library and marketplace for coding-agent
sessions. It is a thin client: the tools call the public a4sx API through the open-source
a4sx SDK, and the hosted service is not part of this
repository. You need an a4sx account for everything except public search. It is open source so you
can check exactly what it sends before you connect it to your agent. Parts of this project were
developed with AI assistance (Claude).
Security
Please report vulnerabilities privately; see SECURITY.md.
License
Apache-2.0, see LICENSE. Copyright 2026 crossVault GmbH.
Metadata
Release files for a4sx-mcp 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| a4sx_mcp-0.1.0rc2.tar.gz | 47.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a4sx_mcp-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.4 kB
Release files / a4sx_mcp-0.1.0rc2.tar.gz
| Download URL | a4sx_mcp-0.1.0rc2.tar.gz |
|---|---|
| Size | 47.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de9f3bc7f619ff06efc876e02cd589d93cf997876bd3a302f95c95470170b1a9
|
|
BLAKE2b-256 checksum How to use checksums |
47db52f90065e917ff361b02674da04dda17ccd6c5762d2f6c72a885370221d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / a4sx_mcp-0.1.0rc2-py3-none-any.whl
| Download URL | a4sx_mcp-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77d7317eee9772c995ff32341d8abf3012c00e77c2c8721cffdfb92e0e944997
|
|
BLAKE2b-256 checksum How to use checksums |
52a5ca03dd5dad32f5d736adde3e720a763e134bc97d90c436619c6a8b1a0218
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log