You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/payments.mdx
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,3 +137,19 @@ export const facilitator = new HTTPFacilitatorClient({
137
137
```
138
138
139
139
See the [BYO Facilitator template](/templates/advanced/with-custom-facilitator) for a working example.
140
+
141
+
## Payer Identity and Sessions
142
+
143
+
Every verified x402 payment identifies the payer by their wallet address. `SessionPlugin` (auto-registered by the build pipeline) gives each payer isolated key-value storage accessible via `getSession()`:
This works in both A2A agent handlers and MCP tool handlers. See [SessionPlugin](/api-reference/session-plugin) for the full API and custom store configuration.
Copy file name to clipboardExpand all lines: docs/protocols/mcp.mdx
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,20 @@ await server.withPlugin(
58
58
);
59
59
```
60
60
61
+
## Session Integration
62
+
63
+
Paid MCP tools automatically get session context. When a tool is invoked with x402 payment, `getSession()` returns the payer-scoped session inside the tool handler — no additional configuration needed.
See [SessionPlugin](/api-reference/session-plugin) for the full API.
74
+
61
75
## Payment-Gated Tools
62
76
63
77
Tools with `accepts.scheme === "exact"` require [x402 payment](/protocols/x402) via `@x402/mcp`. The payment wrapper is applied automatically when you provide an `accepts` configuration during registration.
0 commit comments