Repository navigation
Mantle JS v0.3.0 — MCP code mode, Mantle UI, mantlejs.com, audit + embeddings go stable
Highlights
MCP code mode (@mantlejs/mcp-code, experimental) — instead of one MCP tool per service method, an agent gets
a typed API (search_api + the mantle://code/api.d.ts resource) and an execute tool that runs a short script
in a QuickJS sandbox. Many service calls happen in one round trip, and intermediate results stay out of the model's
context. Every call the script makes still runs the full hook pipeline (auth, validation, agent scopes, audit) with
provider: "mcp". Plug it in with mcp({ …, codeMode: codeMode() }); @mantlejs/mcp itself gains the mode
option and the McpCodeModeProvider extension point, with no sandbox dependency. Ships as
0.3.0-experimental — see the separate release.
@mantlejs/audit and @mantlejs/embeddings promoted to stable — both now ship under latest. Each cleared the
same bar as earlier promotions: 100% statement and branch coverage, and a README-vs-code review.
Mantle UI — React Aria blocks for Mantle apps, installed with the shadcn CLI from a @mantle registry:
auth-provider, login-form, signup-form, oauth-buttons, upload-dropzone, realtime-list, data-table,
mantle-pagination, search-combobox, and mantle-errors. Blocks pin @mantlejs/client/@mantlejs/react
^0.3.0.
mantlejs.com — guides, every package README, the generated API reference, llms.txt, live block demos, and
the Mantle UI registry at /r/.
Client SDK
service.upload(file, { id?, field?, fields?, onProgress?, signal? })—multipart/form-datauploads to a
@mantlejs/storageservice, through the client's auth and one refresh-and-retry on 401, with progress via XHR
where available.client.urlexposes the configured base URL.@mantlejs/react'suseFindgainsrealtime: { mode: "patch" }: events are written into that query's cache in
place, with no refetch, and a paginatedtotalstays in step.
Compatibility notes
@mantlejs/clientauthenticate()now throws aGeneralErrorwhen a 200 response carries noaccessToken,
instead of storing an empty session. The same case in the 401-refresh path counts as a failed rotation, and
setTokens()rejects an empty token.@mantlejs/mcpstring tool results are sent as plain text instead of JSON-quoted. Non-string results are
still JSON. If you parse the text of a tool that returns a string withJSON.parse, read it directly instead.
Known issue
Configuring mcp() twice on one app works over HTTP, but startMcp() over stdio serves whichever mcp() was
configured last. Workaround: build a separate app for the stdio entry point with a single mcp() call.
Install
npm create mantlejs my-app
# or add packages individually
npm install @mantlejs/mantle @mantlejs/express @mantlejs/audit @mantlejs/embeddings