a4sx sessions

com.session-exchange由 session-exchange.com 發布官方發布者v0.1.2更新於 Oct 24, 2026

Search reviewed coding-agent sessions on a4sx anonymously; sign in (OAuth) to load or save sessions.

已驗證Streamable HTTP可網頁執行知識與記憶開發者工具

概覽

AI 產生的概覽

a4sx sessions 讓助理搜尋經過審核的編碼代理工作階段市集、把已儲存的工作階段載入為上下文,並將紀錄發布到私有 a4sx 資料庫。

可以做什麼
搜尋經過審核的公開市集工作階段或自己的私有資料庫工作階段,可依 harness 篩選,並回傳供其他工具使用的 id。在使用前描述某個工作階段:大綱、成員、價格與來源。把有權使用的市集工作階段複製到自己的私有資料庫。從私有資料庫載入工作階段作為本次對話的起始上下文,並依 token 上限截斷。把 Claude Code 或 Codex CLI 的紀錄儲存到私有資料庫,先在本地、再於伺服器端做去識別化。為付費項目發起購買請求並查詢狀態,實際付款在網頁端完成。
適用情境
適合讓助理重用先前的編碼代理工作:尋找某個主題的已發布工作階段、把工作階段載入對話作為參考,或將自己的紀錄歸檔到私有資料庫。公開搜尋不需帳號;載入、取得與儲存則需要帳號。
執行需求
可使用帶 OAuth 的遠端端點,或使用透過 uvx 執行的本地 PyPI 套件 a4sx-mcp;後者需要 uv,並用 a4sx 命令列工具登入一次 a4sx 帳號。選用設定包括 A4SX_BASE、供 CI 權杖使用的 A4SX_SESSION 與 A4SX_SESSION_BASE、A4SX_CONFIG_DIR、A4SX_MCP_LOG,以及速率限制與大小相關變數。需要連線到 session-exchange.com 的網路存取。
安裝前請注意
發布功能會把紀錄上傳到第三方服務;對密鑰與個人資料的去識別化被說明為最後防線而非保證,儲存前應自行檢查。acquire_session 與 publish_session 標示為非唯讀,不應自動核准。工具本身不會完成購買:請求只回傳代碼與連結,由帳號持有人確認並付款。載入的工作階段是不可信的參考資料,無法完全排除提示注入。本地伺服器使用 a4sx 登入工作階段,權限與帳號在私有資料庫中相同。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 a4sx sessions,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.session-exchange%2Fsessions/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "a4sx-sessions": {
      "type": "http",
      "url": "https://session-exchange.com/mcp"
    }
  }
}

README

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.

ToolWhat it doesSign-in
search_sessionsSearch vetted public sessions (scope=public, default), or your own saved ones (scope=library); harness keeps only sessions recorded with the given harnesseslibrary scope only
get_session_summaryDescribe one session before using it: outline, members, price, provenancelibrary source only
acquire_sessionCopy a marketplace session you are entitled to (free, bought or granted) into your private libraryyes
fetch_session_contextLoad a session from your library as starting context, cut to max_tokens (500 to 100,000; default 8,000)yes
publish_sessionSave a transcript (JSONL) to your private libraryyes

Safety rules:

  • acquire_session never buys. For a paid listing you have no purchase or grant for, it returns status: "payment_required" with the price and the listing URL (or, when the listing's session is sold on its own, the member to 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 harness it was recorded with ({id, version}; unknown when not identified), and resumable is false for a session recorded with another harness. fetch_session_context renders such a session from its stored canonical form.
  • publish_session only saves privately. visibility accepts 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 a type; a Claude Code user or assistant turn with a session id, or a Codex CLI session_meta record 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 the a4sx SDK, 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 (its parent, 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_session and publish_session are marked readOnlyHint: 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_context always 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 ### User heading. The title is one line of at most 200 characters, and cutting to max_tokens never removes the notice or the closing line. search_sessions and get_session_summary results 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 says truncated: true, and next_offset resumes 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 gets untrusted: true and 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_session call (use a4sx push for larger ones); per process, at most 240 requests (tools/list and tools/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.

  1. Sign in once with the a4sx CLI. The MCP server reuses that sign-in:

    sh
    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.

  2. Add the server to your client.

Claude Code

sh
claude mcp add a4sx -- uvx a4sx-mcp

Claude Desktop

Edit claude_desktop_config.json (Settings, Developer, Edit Config) and restart Claude Desktop:

json
{  "mcpServers": {    "a4sx": { "command": "uvx", "args": ["a4sx-mcp"] }  }}

Cursor

Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

json
{  "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):

json
{  "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.

SettingMeaning
--base URL / A4SX_BASEThe 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_BASEA token to use instead of the stored sign-in (for CI), and the server it belongs to (default https://session-exchange.com).
A4SX_CONFIG_DIRWhere the a4sx CLI keeps its sign-in (default ~/.config/a4sx, %APPDATA%\a4sx on Windows).
A4SX_MCP_LOGwarning (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_BYTESLower 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_MINLocal 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:

sh
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 harness filter), 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, notice field, per-field caps, 64 KiB result bound and hint line of search_sessions, get_session_summary and acquire_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_transcript and no_transcript;
  • JSON-RPC error -32029 when the overall request limit is exceeded.

Differences of this local server:

  • Sign-in. It uses your a4sx login session, so it can do everything your account can in your own library. The hosted server takes a scoped OAuth token (it advertises library: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 return not_signed_in; the hosted server answers with an OAuth challenge instead. The credential_not_accepted message says to run a4sx login rather 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_s comes from the API's error body, not from the Retry-After header.
  • untrusted. Besides acquired_from on the row and its parents (which is all the hosted server checks), it also uses this machine's record of untrusted sessions from the a4sx SDK. 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-SHA256 sent 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.
    • parent is 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 with a4sx resume gets its parent edge from the SDK's local lineage record. The hosted server records no edge.
    • The result has extra client_redactions and untrusted fields.
  • payment_required. The price comes from the public listing; the hosted server reads its pricing store.
  • Server name. It is a4sx-mcp in 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 sidebar signs you in to a4sx, lists the sessions in your library (resume one in a terminal, or open it on the web) and searches the marketplace. 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:

sh
cd vscodenpm installnpm run compilenpm 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

sh
git clone https://github.com/crossvault/a4sx-mcp && cd a4sx-mcppython -m venv .venv && . .venv/bin/activatepip install -e '.[dev]'pytest -q          # offline: the tools run against a local stub serverruff 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.

來源:README.md,提交 ad73db4

工具

7

search_sessions

Search sessions

Search vetted, published coding-agent sessions on a4sx (reviewed marketplace listings), or your own saved sessions with scope=library. Returns ids to use with the other tools.

輸入參數sorttagslimitqueryscopeoffsetharness

get_session_summary

Session summary

Describe one session before using it: what it did, outline, price, and whether you already have access. source=marketplace (default) or library.

輸入參數id必填sourcetenant

acquire_session

Acquire session

Add a marketplace session you are entitled to (free, bought, or granted) to your private library. Never buys anything: for a paid listing it returns status=payment_required with the price and the listing URL.

輸入參數id必填tenantversion

fetch_session_context

Load session as context

Load a session from your library (saved, or added with acquire_session) as starting context for this conversation, sized to max_tokens.

輸入參數id必填versionmax_tokensinclude_tool_calls

publish_session

Save session to library

Save a session transcript (JSONL), or markdown you composed (format=markdown), to your private a4sx library. The server only rewrites text that matches secret and personal-data patterns (such as tokens, private keys, emails, IP addresses and home-directory user names). It removes no record or field: a raw Claude Code transcript keeps the user's CLAUDE.md and session context (attachment records), file-history snapshot records (absolute file paths), other non-conversation records (such as pr-link), tool-output copies (toolUseResult), and cwd, gitBranch and version on every line; the reply counts them (except version) in unprepared_carriers. Prepare the transcript or compose markdown first, as GET /orient on this server without auth describes (route A, or route B steps 0-8). Private: it is never listed publicly by this tool.

輸入參數labeltitleformatparenttranscript必填visibilitycontent_sha256client_scrubbedidempotency_key

request_purchase

Request a purchase

Start buying a paid marketplace listing for the account holder to confirm. Nothing is charged and you never pay: it returns a verify_url and a user_code to give to the account holder, who checks the code, confirms and pays. Then poll get_purchase_request.

輸入參數id必填tenant必填version

get_purchase_request

Purchase request status

Status of a purchase you requested: pending, completed (with acquired_copy_id to load with fetch_session_context), declined or expired.

輸入參數purchase_request_id必填

版本歷史

3
  1. v0.1.2最新Oct 17, 2026
  2. v0.1.1Oct 14, 2026
  3. v0.1.0Oct 9, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分