diff --git a/packages/x402-mcp/README.md b/packages/x402-mcp/README.md index 10afe0f1..faf4703d 100644 --- a/packages/x402-mcp/README.md +++ b/packages/x402-mcp/README.md @@ -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" @@ -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" @@ -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 @@ -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. diff --git a/tests/packages/x402-mcp-wallet-docs.test.ts b/tests/packages/x402-mcp-wallet-docs.test.ts index c29574e1..8d5a40c1 100644 --- a/tests/packages/x402-mcp-wallet-docs.test.ts +++ b/tests/packages/x402-mcp-wallet-docs.test.ts @@ -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'); + } + }); });