Frameworks and runtimes
Where to add signing, on the server, in the agent, or around a server you do not own.
Tool calls are signed at the tool boundary, on the side of the server. Pick the package that fits what you control.
| You control | Use | What it does |
|---|---|---|
| The MCP server | @atrib/mcp | Signs each tool call the server handles. See Quick start. |
| Neither, only the config | @atrib/mcp-wrap | Signs each call through a server you do not own. See below. |
| The agent's code | @atrib/agent | Carries context on outbound calls and signs fallback transaction records. See below. |
@atrib/agent runs beside one of the other two. It does not sign ordinary tool
calls itself: it sends the atrib context out with each call, reads the signed
record a server returns, marks a hop that returned none as a gap, and signs a
transaction record when a payment completes and the server signed none.
Agent frameworks
@atrib/agent has one interceptor and a helper for each framework. Make the
interceptor once. merchantDomain and serverUrls are optional: at session
start the interceptor fetches the merchant's and each tool server's attribution
policy from /.well-known/atrib-policy.json.
import { atrib } from '@atrib/agent'
const interceptor = atrib({
creatorKey: process.env.ATRIB_PRIVATE_KEY!,
merchantDomain: 'https://merchant.example.com',
serverUrls: ['https://search.example.com'],
})Then hand it to the helper for your framework:
| Framework | Helper |
|---|---|
| MCP TypeScript SDK client | wrapMcpClient(client, interceptor, { serverUrl }) |
| Claude Agent SDK, in-process tools | Wrap the McpServer with @atrib/mcp's atrib() |
| Claude Agent SDK, third-party MCP | createAtribProxy({ name, upstream, atrib }) from @atrib/mcp |
| Cloudflare Agents | attributeCloudflareAgentMcp(agent, { interceptor, serverUrls }) |
| Vercel AI SDK MCP | attributeVercelAiSdkMcp(mcpClient, { interceptor, serverUrl }) |
| LangChain JS MCP | attributeLangchainMcp(multiClient, { interceptor, serverUrls }) |
The two Claude Agent SDK rows sign on the server side with @atrib/mcp and take
no interceptor. @atrib/agent does not depend on any of these frameworks. Install the one you
use alongside it. Mastra has a working proof but no helper yet, and the OpenAI
Agents SDK is planned. Each helper has a runnable example in
packages/integration/examples.
Wrap a server you do not own
@atrib/mcp-wrap runs any MCP server behind a signing boundary. Write a config
file that names the upstream:
{
"name": "filesystem",
"upstream": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
"serverUrl": "mcp://filesystem.local"
}Then point your MCP host at atrib-wrap instead of the server's own command,
with the config file's absolute path as the argument. A relative path breaks
when the host starts the server from another folder.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@atrib/mcp-wrap", "/absolute/path/to/filesystem.json"],
"env": { "ATRIB_PRIVATE_KEY": "<your private key>" }
}
}
}The agent loop and the tool schemas stay the same, and the wrapper never changes
the upstream result. After each successful call it signs one record that commits
to the tool's name as a hash and to the arguments and result as salted hashes. A
tool set to injectReceiptId: true in the config's tools map gets a pair
instead, unless the config sets evidenceMode: 'minimal' or its own
disclosure: a request record signed before the call, whose receipt id is
passed to the upstream, and an outcome record linked to it.
The wrapper derives each record's content_id from <serverUrl>/<agent> and
the tool name. agent defaults to claude-code, so the example uses
mcp://filesystem.local/claude-code. The key comes from ATRIB_PRIVATE_KEY, a
key file, the macOS Keychain, 1Password or a signer socket, and the wrapper
refuses to start when none of them gives one, so a missing key shows up at once.
Agent runtimes
Claude Code, Codex, Cursor and other runtimes own more than tool calls:
sessions, hooks, approvals and subagents. For those, combine the pieces:
@atrib/mcp-wrap for MCP tools, atrib-attest-cli for hook events,
@atrib/openinference
for OpenInference spans, and
@atrib/runtime-log
for bounded windows of a run log.