From d95478d7c4ceaaf1b1fa8f43eb708fa450e14bf7 Mon Sep 17 00:00:00 2001 From: dwebxr Date: Tue, 22 Sep 2026 04:39:25 +0900 Subject: [PATCH] =?UTF-8?q?docs(x402-mcp):=20README=20=E3=81=AE=20x402=20p?= =?UTF-8?q?rofile=20=E8=A8=AD=E5=AE=9A=E4=BE=8B=E3=82=92=20keystore=20?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E3=81=B8=20(=E4=BB=AE=E3=81=AE=E7=A7=98?= =?UTF-8?q?=E5=AF=86=E9=8D=B5=E3=81=A7=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AB?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E3=81=99=E3=82=8B=E4=BE=8B=E3=82=92=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit x402 profile の Claude Desktop / Claude Code の例が env-key + BUYER_PRIVATE_KEY: "0x..." の ままで、コピーすると MCP が起動時に停止する。/agent・/guide/ai-pay・agent-templates と同じ keystore にそろえ、wallet_init の流れと「仮の鍵を書かない」を 1 段落で案内する。 env-key / steward の説明 (Signer Modes・Environment 表) と threat model は変更なし。 公開前の段取りメモ (SDK → MCP → Web の順に公開…) は公開済みで古いので 1 行に置き換え。 npm 上の README は次回 publish で反映される。 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc --- packages/x402-mcp/README.md | 18 ++++++++++-------- tests/packages/x402-mcp-wallet-docs.test.ts | 11 +++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) 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'); + } + }); });