web3-tools-mcp 1.6.0 → 2.0.0

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 +95 -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 +101 -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 +119 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,95 @@
1
+ # Changelog
2
+
3
+ Notable changes per release. Dates are release dates; unreleased work sits at the top.
4
+
5
+ ## [2.0.0] — 2026-09-21
6
+
7
+ The theme is signing: where a transaction can be signed, and what you are told before you
8
+ sign it.
9
+
10
+ ### Added
11
+
12
+ - **Sign from a phone over WalletConnect.** `pair_phone_wallet` once by QR, and the server
13
+ can request signatures from a wallet app with no browser and no local relay. Sessions
14
+ survive restarts; `disconnect_phone_wallet` clears them.
15
+ - **Host the server yourself.** MCP over Streamable HTTP, with one-click deploys for Render
16
+ and Fly. Pairings persist on a volume, or in Redis where the filesystem is ephemeral.
17
+ - **OAuth**, so clients that cannot send an `Authorization` header — claude.ai connectors,
18
+ and anything driving them — can connect. `MCP_TOKEN` stays the single credential; there
19
+ are no user accounts to manage.
20
+ - **Clear signing.** Transactions are described from the ERC-7730 registry (651 contracts,
21
+ 3253 selectors, bundled) instead of shown as raw calldata.
22
+ - **Preview before signing** — the transaction is decoded and simulated, so the amounts,
23
+ the protocol and the resulting asset changes are on screen before you approve.
24
+ - **Redesigned browser signing page**, with explorer links, contract labels and a persistent
25
+ wallet connection.
26
+ - `CUSTOM_RPC` as an environment alias for `--custom-rpc`, so a hosted deployment can set
27
+ per-chain RPCs.
28
+
29
+ ### Changed
30
+
31
+ - **Browser signing works on a hosted server.** The signing page is served from the same
32
+ port as `/mcp`, so a deployment offers both signers without a second service. Its relay
33
+ token is minted per boot rather than persisted: the pairing URL is fetched through
34
+ `wallet_status`, which already requires `MCP_TOKEN`, so nobody has to type it.
35
+ - **The relay checks the WebSocket `Origin`.** WebSockets ignore the same-origin policy and
36
+ the local port is predictable, so any page you had open could previously reach the relay
37
+ and either push a transaction at your wallet or register as a signer to intercept one.
38
+ A browser on any other origin is now refused before it can present a token at all;
39
+ non-browser clients send no `Origin` and are still gated by the token.
40
+ - **Signing tools now require `signWith`.** `send_native_token`, `send_erc20_token`,
41
+ `write_contract` and `sign_message` take `phone` or `browser`, with no default, so the
42
+ agent has to ask rather than silently preferring a paired phone. Asking for a signer that
43
+ is not available now fails with a message saying how to fix it, instead of falling back
44
+ to the other one.
45
+ - **Renamed two tools.** `call_contract_function` is now `read_contract`, and
46
+ `call_contract_write` is now `write_contract` — the old pair gave no hint which one
47
+ spent gas. The names now match viem's, and a saved prompt naming the old ones will need
48
+ updating.
49
+ - Every supported chain now lives in one table ([mcp/src/chains.ts](mcp/src/chains.ts)). Adding a
50
+ chain is a single entry; the tool schemas, RPC selection, explorer links, Hypersync
51
+ routing and `--help` all derive from it.
52
+ - Tool errors surface the underlying failure rather than a re-wrapped message that hid it.
53
+ - Biome formats and lints the repo; CI runs lint, typecheck and tests.
54
+ - `web3-wallet-relay` 1.2.0 moves to express 5, matching the server.
55
+
56
+ ### Fixed
57
+
58
+ - `get_logs` over Hypersync was broken three ways: indexed addresses were sent as 20-byte
59
+ topics and rejected outright, an unfiltered topic position was dropped rather than left
60
+ empty so later filters matched the wrong parameter, and matched logs came back with no
61
+ decoded arguments at all. The fallback now works without an RPC provider key.
62
+ - Explorer links are omitted on `localhost` instead of pointing at Etherscan.
63
+ - The public RPC fallback for Unichain pointed at Sepolia, not mainnet.
64
+ - A hosted server no longer advertises a browser relay it cannot reach.
65
+ - The wallet approval dialog names the agent requesting the signature, not the source repo.
66
+
67
+ ## [1.6.0] — 2026-09
68
+
69
+ - Wallet relay extracted to its own package, `web3-wallet-relay`, so the signing page can be
70
+ hosted separately.
71
+ - Token-paired relay replacing the old wallet server; focuses an open tab rather than
72
+ opening another.
73
+ - Report why a wallet refused a request, instead of a generic failure.
74
+ - Repair dead public RPC defaults.
75
+
76
+ ## [1.4.0] — 2026-08
77
+
78
+ - Anvil-backed `trace_transaction` and `debug_call`.
79
+ - Multicall support on Anvil.
80
+
81
+ ## [1.3.x] — 2025
82
+
83
+ - Transaction tools and wallet write functions.
84
+ - RPC connectivity test suite.
85
+ - Fix wallet server port conflicts ([#1](https://github.com/hajnalben/web3-tools-mcp/issues/1)).
86
+
87
+ ## [1.2.0] — 2025
88
+
89
+ - Support for 12 networks with per-provider RPC configuration.
90
+ - ENS tools with multi-chain support.
91
+
92
+ ## [1.0.0] — 2025
93
+
94
+ - Initial release: balances, contract reads, ABIs, logs, gas and block data over viem,
95
+ Etherscan and Hypersync.