Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/x402-mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ npx openpay-x402-mcp@0.15.0
"command": "npx",
"args": ["openpay-x402-mcp@0.15.0"],
"env": {
"SIGNER_MODE": "env-key",
"BUYER_PRIVATE_KEY": "0x...",
"SIGNER_MODE": "keystore",
"MAX_PER_CALL_JPYC": "10",
"MAX_SESSION_JPYC": "100",
"ALLOWED_HOSTS": "open-pay.jp"
Expand All @@ -88,8 +87,7 @@ npx openpay-x402-mcp@0.15.0
"command": "npx",
"args": ["openpay-x402-mcp@0.15.0"],
"env": {
"SIGNER_MODE": "env-key",
"BUYER_PRIVATE_KEY": "0x...",
"SIGNER_MODE": "keystore",
"MAX_PER_CALL_JPYC": "10",
"MAX_SESSION_JPYC": "100",
"ALLOWED_HOSTS": "open-pay.jp"
Expand All @@ -99,6 +97,13 @@ npx openpay-x402-mcp@0.15.0
}
```

These examples use the local wallet (`SIGNER_MODE=keystore`): no private key goes
into the configuration. After the host restarts, call `wallet_init` to create the
wallet on this machine, then fund the returned address — see
[Local wallet](#local-wallet-signer_modekeystore). Do not put a placeholder such as
`"BUYER_PRIVATE_KEY": "0x..."` in the configuration: the server rejects it at startup.
`env-key` and `steward` are described under [Signer Modes](#signer-modes).

During local development from this repository:

```bash
Expand Down Expand Up @@ -252,10 +257,7 @@ Use this explicit mode to avoid pasting a private key into MCP configuration:
}
```

These examples target the coordinated SDK 0.9.0 / MCP 0.15.0 release. Publish
SDK first, then MCP, then update Web setup after a real-host smoke. Publication
requires explicit human review and a real-host `wallet_init → funding →
wallet_status → x402_pay` check. Keep the package version pinned.
Requires openpay-x402-mcp 0.15.0 or later (SDK 0.9.0). Keep the package version pinned.

1. Register the MCP server, restart the host, and call `wallet_status {}` to
confirm it starts. If startup fails, report the error verbatim.
Expand Down
11 changes: 11 additions & 0 deletions tests/packages/x402-mcp-wallet-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ describe('wallet release documentation', () => {
expect(changelog).toContain(text);
}
});

it('x402 profile の設定例は keystore で、コピーすると起動時に停止する仮の秘密鍵を含まない', async () => {
const readme = await readFile('packages/x402-mcp/README.md', 'utf8');
const profile = readme.slice(readme.indexOf('## x402 profile'), readme.indexOf('\n## Quickstart'));
const jsonBlocks = [...profile.matchAll(/```json\n([\s\S]*?)```/g)].map((m) => m[1]);
expect(jsonBlocks.length).toBeGreaterThanOrEqual(2);
for (const block of jsonBlocks) {
expect(block).toContain('"SIGNER_MODE": "keystore"');
expect(block).not.toContain('BUYER_PRIVATE_KEY');
}
});
});
Loading