web3-tools-mcp 1.6.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +328 -234
  3. package/dist/anvil.d.ts +1 -1
  4. package/dist/anvil.d.ts.map +1 -1
  5. package/dist/anvil.js +11 -9
  6. package/dist/anvil.js.map +1 -1
  7. package/dist/chain-meta.d.ts.map +1 -1
  8. package/dist/chain-meta.js +7 -3
  9. package/dist/chain-meta.js.map +1 -1
  10. package/dist/chains.d.ts +960 -0
  11. package/dist/chains.d.ts.map +1 -0
  12. package/dist/chains.js +108 -0
  13. package/dist/chains.js.map +1 -0
  14. package/dist/client.d.ts +10 -1717
  15. package/dist/client.d.ts.map +1 -1
  16. package/dist/client.js +33 -218
  17. package/dist/client.js.map +1 -1
  18. package/dist/http-server.d.ts +6 -0
  19. package/dist/http-server.d.ts.map +1 -1
  20. package/dist/http-server.js +55 -40
  21. package/dist/http-server.js.map +1 -1
  22. package/dist/index.js +50 -29
  23. package/dist/index.js.map +1 -1
  24. package/dist/oauth.d.ts +31 -0
  25. package/dist/oauth.d.ts.map +1 -0
  26. package/dist/oauth.js +227 -0
  27. package/dist/oauth.js.map +1 -0
  28. package/dist/preview.d.ts.map +1 -1
  29. package/dist/preview.js +2 -2
  30. package/dist/preview.js.map +1 -1
  31. package/dist/tools/advanced.d.ts +4 -4
  32. package/dist/tools/advanced.d.ts.map +1 -1
  33. package/dist/tools/advanced.js +228 -247
  34. package/dist/tools/advanced.js.map +1 -1
  35. package/dist/tools/balance.d.ts +1 -1
  36. package/dist/tools/balance.d.ts.map +1 -1
  37. package/dist/tools/balance.js +97 -103
  38. package/dist/tools/balance.js.map +1 -1
  39. package/dist/tools/contract-info.d.ts +3 -3
  40. package/dist/tools/contract-info.d.ts.map +1 -1
  41. package/dist/tools/contract-info.js +150 -161
  42. package/dist/tools/contract-info.js.map +1 -1
  43. package/dist/tools/contract.d.ts +4 -4
  44. package/dist/tools/contract.d.ts.map +1 -1
  45. package/dist/tools/contract.js +91 -110
  46. package/dist/tools/contract.js.map +1 -1
  47. package/dist/tools/ens.d.ts +6 -6
  48. package/dist/tools/ens.d.ts.map +1 -1
  49. package/dist/tools/ens.js +239 -297
  50. package/dist/tools/ens.js.map +1 -1
  51. package/dist/tools/gas.d.ts +4 -4
  52. package/dist/tools/gas.d.ts.map +1 -1
  53. package/dist/tools/gas.js +90 -138
  54. package/dist/tools/gas.js.map +1 -1
  55. package/dist/tools/index.d.ts +1 -1
  56. package/dist/tools/index.d.ts.map +1 -1
  57. package/dist/tools/logs.d.ts +1 -1
  58. package/dist/tools/logs.d.ts.map +1 -1
  59. package/dist/tools/logs.js +36 -37
  60. package/dist/tools/logs.js.map +1 -1
  61. package/dist/tools/signatures.d.ts.map +1 -1
  62. package/dist/tools/signatures.js +67 -89
  63. package/dist/tools/signatures.js.map +1 -1
  64. package/dist/tools/transactions.d.ts +35 -5
  65. package/dist/tools/transactions.d.ts.map +1 -1
  66. package/dist/tools/transactions.js +148 -74
  67. package/dist/tools/transactions.js.map +1 -1
  68. package/dist/types.d.ts +1 -1
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/utils.d.ts +1 -1
  71. package/dist/utils.d.ts.map +1 -1
  72. package/dist/utils.js +35 -98
  73. package/dist/utils.js.map +1 -1
  74. package/dist/wallet-client.d.ts +11 -1
  75. package/dist/wallet-client.d.ts.map +1 -1
  76. package/dist/wallet-client.js +27 -9
  77. package/dist/wallet-client.js.map +1 -1
  78. package/dist/walletconnect.d.ts +22 -1
  79. package/dist/walletconnect.d.ts.map +1 -1
  80. package/dist/walletconnect.js +106 -8
  81. package/dist/walletconnect.js.map +1 -1
  82. package/package.json +17 -9
  83. package/src/anvil.ts +15 -18
  84. package/src/chain-meta.ts +8 -4
  85. package/src/chains.ts +145 -0
  86. package/src/client.ts +39 -254
  87. package/src/http-server.ts +67 -44
  88. package/src/index.ts +77 -53
  89. package/src/oauth.ts +270 -0
  90. package/src/preview.ts +3 -12
  91. package/src/tools/advanced.ts +195 -213
  92. package/src/tools/balance.ts +103 -108
  93. package/src/tools/contract-info.ts +163 -184
  94. package/src/tools/contract.ts +123 -144
  95. package/src/tools/ens.ts +290 -345
  96. package/src/tools/gas.ts +122 -170
  97. package/src/tools/index.ts +2 -2
  98. package/src/tools/logs.ts +45 -43
  99. package/src/tools/signatures.ts +68 -86
  100. package/src/tools/transactions.ts +194 -87
  101. package/src/types.ts +1 -15
  102. package/src/utils.ts +52 -110
  103. package/src/wallet-client.ts +31 -9
  104. package/src/walletconnect.ts +124 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,109 @@
1
+ # Changelog
2
+
3
+ Notable changes per release. Dates are release dates; unreleased work sits at the top.
4
+
5
+ ## [2.0.1] — 2026-09-22
6
+
7
+ ### Fixed
8
+
9
+ - **A phone signature could never come back.** Naming the agent in `pair_phone_wallet`
10
+ replaces the WalletConnect client, because its metadata is fixed at init — but the old
11
+ one was dropped without being closed. Two clients then shared one storage directory and
12
+ overwrote each other's subscription record, so the surviving session was left subscribed
13
+ to nothing: a request reached the wallet, you approved it, and the reply was published
14
+ where nobody was listening. The tool simply hung. The replaced client is closed now.
15
+
16
+ If you hit this, re-pair after upgrading — the stored session's subscription is what was
17
+ lost, and a fresh client rebuilds it.
18
+
19
+ ## [2.0.0] — 2026-09-21
20
+
21
+ The theme is signing: where a transaction can be signed, and what you are told before you
22
+ sign it.
23
+
24
+ ### Added
25
+
26
+ - **Sign from a phone over WalletConnect.** `pair_phone_wallet` once by QR, and the server
27
+ can request signatures from a wallet app with no browser and no local relay. Sessions
28
+ survive restarts; `disconnect_phone_wallet` clears them.
29
+ - **Host the server yourself.** MCP over Streamable HTTP, with one-click deploys for Render
30
+ and Fly. Pairings persist on a volume, or in Redis where the filesystem is ephemeral.
31
+ - **OAuth**, so clients that cannot send an `Authorization` header — claude.ai connectors,
32
+ and anything driving them — can connect. `MCP_TOKEN` stays the single credential; there
33
+ are no user accounts to manage.
34
+ - **Clear signing.** Transactions are described from the ERC-7730 registry (651 contracts,
35
+ 3253 selectors, bundled) instead of shown as raw calldata.
36
+ - **Preview before signing** — the transaction is decoded and simulated, so the amounts,
37
+ the protocol and the resulting asset changes are on screen before you approve.
38
+ - **Redesigned browser signing page**, with explorer links, contract labels and a persistent
39
+ wallet connection.
40
+ - `CUSTOM_RPC` as an environment alias for `--custom-rpc`, so a hosted deployment can set
41
+ per-chain RPCs.
42
+
43
+ ### Changed
44
+
45
+ - **Browser signing works on a hosted server.** The signing page is served from the same
46
+ port as `/mcp`, so a deployment offers both signers without a second service. Its relay
47
+ token is minted per boot rather than persisted: the pairing URL is fetched through
48
+ `wallet_status`, which already requires `MCP_TOKEN`, so nobody has to type it.
49
+ - **The relay checks the WebSocket `Origin`.** WebSockets ignore the same-origin policy and
50
+ the local port is predictable, so any page you had open could previously reach the relay
51
+ and either push a transaction at your wallet or register as a signer to intercept one.
52
+ A browser on any other origin is now refused before it can present a token at all;
53
+ non-browser clients send no `Origin` and are still gated by the token.
54
+ - **Signing tools now require `signWith`.** `send_native_token`, `send_erc20_token`,
55
+ `write_contract` and `sign_message` take `phone` or `browser`, with no default, so the
56
+ agent has to ask rather than silently preferring a paired phone. Asking for a signer that
57
+ is not available now fails with a message saying how to fix it, instead of falling back
58
+ to the other one.
59
+ - **Renamed two tools.** `call_contract_function` is now `read_contract`, and
60
+ `call_contract_write` is now `write_contract` — the old pair gave no hint which one
61
+ spent gas. The names now match viem's, and a saved prompt naming the old ones will need
62
+ updating.
63
+ - Every supported chain now lives in one table ([mcp/src/chains.ts](mcp/src/chains.ts)). Adding a
64
+ chain is a single entry; the tool schemas, RPC selection, explorer links, Hypersync
65
+ routing and `--help` all derive from it.
66
+ - Tool errors surface the underlying failure rather than a re-wrapped message that hid it.
67
+ - Biome formats and lints the repo; CI runs lint, typecheck and tests.
68
+ - `web3-wallet-relay` 1.2.0 moves to express 5, matching the server.
69
+
70
+ ### Fixed
71
+
72
+ - `get_logs` over Hypersync was broken three ways: indexed addresses were sent as 20-byte
73
+ topics and rejected outright, an unfiltered topic position was dropped rather than left
74
+ empty so later filters matched the wrong parameter, and matched logs came back with no
75
+ decoded arguments at all. The fallback now works without an RPC provider key.
76
+ - Explorer links are omitted on `localhost` instead of pointing at Etherscan.
77
+ - The public RPC fallback for Unichain pointed at Sepolia, not mainnet.
78
+ - A hosted server no longer advertises a browser relay it cannot reach.
79
+ - The wallet approval dialog names the agent requesting the signature, not the source repo.
80
+
81
+ ## [1.6.0] — 2026-09
82
+
83
+ - Wallet relay extracted to its own package, `web3-wallet-relay`, so the signing page can be
84
+ hosted separately.
85
+ - Token-paired relay replacing the old wallet server; focuses an open tab rather than
86
+ opening another.
87
+ - Report why a wallet refused a request, instead of a generic failure.
88
+ - Repair dead public RPC defaults.
89
+
90
+ ## [1.4.0] — 2026-08
91
+
92
+ - Anvil-backed `trace_transaction` and `debug_call`.
93
+ - Multicall support on Anvil.
94
+
95
+ ## [1.3.x] — 2025
96
+
97
+ - Transaction tools and wallet write functions.
98
+ - RPC connectivity test suite.
99
+ - Fix wallet server port conflicts ([#1](https://github.com/hajnalben/web3-tools-mcp/issues/1)).
100
+
101
+ ## [1.2.0] — 2025
102
+
103
+ - Support for 12 networks with per-provider RPC configuration.
104
+ - ENS tools with multi-chain support.
105
+
106
+ ## [1.0.0] — 2025
107
+
108
+ - Initial release: balances, contract reads, ABIs, logs, gas and block data over viem,
109
+ Etherscan and Hypersync.