@one-source/api-mcp 5.4.6 → 5.5.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BlockParty
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BlockParty
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,155 +1,170 @@
1
- # onesource-api-mcp
2
-
3
- MCP server for OneSource blockchain data. 27 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
4
-
5
- ```
6
- npx onesource-api-mcp
7
- ```
8
-
9
- ## Install
10
-
11
- ```sh
12
- # Claude Code
13
- claude mcp add onesource-api -- npx onesource-api-mcp
14
-
15
- # Claude Desktop / Cursor — add to MCP config:
16
- {
17
- "mcpServers": {
18
- "onesource-api": {
19
- "command": "npx",
20
- "args": ["-y", "onesource-api-mcp"]
21
- }
22
- }
23
- }
24
- ```
25
-
26
- ## Tools (27)
27
-
28
-
29
- ### Live Chain Data (12 tools)
30
-
31
- | Tool | Description |
32
- |------|-------------|
33
- | `1s_allowance_live` | ERC20 allowance check |
34
- | `1s_contract_info_live` | Contract type detection via ERC165 |
35
- | `1s_erc1155_balance_live` | ERC1155 balance via RPC |
36
- | `1s_erc20_balance_live` | ERC20 balance via balanceOf |
37
- | `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
38
- | `1s_erc721_tokens_live` | ERC721 token enumeration |
39
- | `1s_events_live` | Event logs via eth_getLogs |
40
- | `1s_multi_balance_live` | ETH + multiple ERC20 balances |
41
- | `1s_nft_metadata_live` | NFT metadata via tokenURI |
42
- | `1s_nft_owner_live` | NFT owner via ownerOf |
43
- | `1s_total_supply_live` | Token total supply |
44
- | `1s_tx_details_live` | Transaction + receipt via RPC |
45
-
46
-
47
- ### Chain Utilities (13 tools) - RPC Only
48
-
49
- | Tool | Description |
50
- |------|-------------|
51
- | `1s_block_by_number` | Block details by number |
52
- | `1s_block_number` | Latest block number |
53
- | `1s_chain_id` | EIP-155 chain ID |
54
- | `1s_contract_code` | Contract bytecode |
55
- | `1s_ens_resolve` | ENS name/address resolution |
56
- | `1s_estimate_gas` | Gas estimation |
57
- | `1s_network_info` | Chain ID, block number, gas price |
58
- | `1s_nonce` | Transaction count |
59
- | `1s_pending_block` | Pending block from mempool |
60
- | `1s_proxy_detect` | Proxy contract detection |
61
- | `1s_simulate_call` | Simulate eth_call |
62
- | `1s_storage_read` | Read storage slot |
63
- | `1s_tx_receipt` | Transaction receipt |
64
-
65
- ### Payments (2 tools)
66
-
67
- | Tool | Description |
68
- |------|-------------|
69
- | `1s_payment_mode` | View or switch the x402 payment scheme (`exact` per-call vs `batch` payment channel) |
70
- | `1s_refund` | Refund unused `batch` channel balance back to your wallet on demand |
71
-
72
-
73
- ## Networks
74
-
75
- All tools accept an optional `network` parameter:
76
-
77
- | Network | Description |
78
- |---------|-------------|
79
- | `ethereum` | Ethereum mainnet (default) |
80
- | `sepolia` | Ethereum Sepolia testnet |
81
-
82
-
83
- ## Authentication
84
-
85
- Two auth methods are supported. **API key takes priority** when both are configured.
86
-
87
- ### API Key (recommended)
88
-
89
- Set `ONESOURCE_API_KEY` to your OneSource API key. The server sends it as a Bearer token on every request.
90
-
91
- ```sh
92
- ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp
93
- ```
94
-
95
- Or in your MCP config:
96
- ```json
97
- {
98
- "mcpServers": {
99
- "onesource-api": {
100
- "command": "npx",
101
- "args": ["-y", "onesource-api-mcp"],
102
- "env": {
103
- "ONESOURCE_API_KEY": "your-key-here"
104
- }
105
- }
106
- }
107
- }
108
- ```
109
-
110
- ### x402 Micropayments
111
-
112
- Set `X402_PRIVATE_KEY` to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via [x402](https://github.com/coinbase/x402).
113
-
114
- ```sh
115
- X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
116
- ```
117
-
118
- Payments default to the **exact** scheme (one USDC payment per call). For a burst of calls you can switch to **batch** settlement — a payment channel that funds many off-chain calls from a single on-chain deposit, settled with one claim — by calling the `1s_payment_mode` tool with `{ "mode": "batch" }`, or by setting `X402_PAYMENT_MODE=batch`. Both modes use the same wallet.
119
-
120
- In batch mode the first paid call deposits `price × X402_DEPOSIT_MULTIPLIER` (default 10) up front, so a session typically over-funds the channel. Reclaim the unused balance whenever you're done with the `1s_refund` tool; idle channels are also auto-refunded by the receiver after a few hours. The deposit residual is always recoverable.
121
-
122
- ### No auth
123
-
124
- Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.
125
-
126
-
127
- ## Configuration
128
-
129
- Most users only set one of the two keys below. Everything else has a working default — including batch mode, which runs out of the box with no extra configuration.
130
-
131
- ### Required
132
-
133
- Set one to access paid endpoints. Without either, only free endpoints work. API key takes priority when both are set.
134
-
135
- | Variable | Default | Description |
136
- |----------|---------|-------------|
137
- | `ONESOURCE_API_KEY` | — | OneSource API key. Sent as `Authorization: Bearer <key>`. Takes priority over x402. |
138
- | `X402_PRIVATE_KEY` | — | EVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base. |
139
-
140
- ### Optional / Advanced
141
-
142
- All have sensible defaults — set these only to override an endpoint or tune how `batch` mode behaves. You can switch payment modes at runtime with the `1s_payment_mode` tool instead of setting any of these.
143
-
144
- | Variable | Default | Description |
145
- |----------|---------|-------------|
146
- | `ONESOURCE_BASE_URL` | `https://api.onesource.io` | API endpoint. |
147
- | `X402_PAYMENT_MODE` | `exact` | Initial x402 scheme: `exact` (per-call) or `batch` (payment channel). Switch in-session with the `1s_payment_mode` tool. |
148
- | `X402_RPC_URL` | Base default | Base RPC endpoint used to submit channel deposits in batch mode. |
149
- | `X402_CHANNEL_DIR` | — | Directory to persist batch channel state across restarts. Unset = in-memory (channel lost on restart). |
150
- | `X402_DEPOSIT_MULTIPLIER` | `10` | Batch mode: deposit = price × this multiplier, funding that many calls per channel. Unused balance is reclaimable via `1s_refund`. |
151
-
152
-
153
- ## License
154
-
155
- MIT
1
+ # onesource-api-mcp
2
+
3
+ MCP server for OneSource blockchain data. 27 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.
4
+
5
+ ```
6
+ npx onesource-api-mcp
7
+ ```
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ # Claude Code
13
+ claude mcp add onesource-api -- npx onesource-api-mcp
14
+
15
+ # Claude Desktop / Cursor — add to MCP config:
16
+ {
17
+ "mcpServers": {
18
+ "onesource-api": {
19
+ "command": "npx",
20
+ "args": ["-y", "onesource-api-mcp"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ ## Tools (27)
27
+
28
+
29
+ ### Live Chain Data (12 tools)
30
+
31
+ | Tool | Description |
32
+ |------|-------------|
33
+ | `1s_allowance_live` | ERC20 allowance check |
34
+ | `1s_contract_info_live` | Contract type detection via ERC165 |
35
+ | `1s_erc1155_balance_live` | ERC1155 balance via RPC |
36
+ | `1s_erc20_balance_live` | ERC20 balance via balanceOf |
37
+ | `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
38
+ | `1s_erc721_tokens_live` | ERC721 token enumeration |
39
+ | `1s_events_live` | Event logs via eth_getLogs |
40
+ | `1s_multi_balance_live` | ETH + multiple ERC20 balances |
41
+ | `1s_nft_metadata_live` | NFT metadata via tokenURI |
42
+ | `1s_nft_owner_live` | NFT owner via ownerOf |
43
+ | `1s_total_supply_live` | Token total supply |
44
+ | `1s_tx_details_live` | Transaction + receipt via RPC |
45
+
46
+
47
+ ### Chain Utilities (13 tools) - RPC Only
48
+
49
+ | Tool | Description |
50
+ |------|-------------|
51
+ | `1s_block_by_number` | Block details by number |
52
+ | `1s_block_number` | Latest block number |
53
+ | `1s_chain_id` | EIP-155 chain ID |
54
+ | `1s_contract_code` | Contract bytecode |
55
+ | `1s_ens_resolve` | ENS name/address resolution |
56
+ | `1s_estimate_gas` | Gas estimation |
57
+ | `1s_network_info` | Chain ID, block number, gas price |
58
+ | `1s_nonce` | Transaction count |
59
+ | `1s_pending_block` | Pending block from mempool |
60
+ | `1s_proxy_detect` | Proxy contract detection |
61
+ | `1s_simulate_call` | Simulate eth_call |
62
+ | `1s_storage_read` | Read storage slot |
63
+ | `1s_tx_receipt` | Transaction receipt |
64
+
65
+ ### Payments (2 tools)
66
+
67
+ | Tool | Description |
68
+ |------|-------------|
69
+ | `1s_payment_mode` | View or switch the payment rail + mode: `x402-exact` / `x402-batch` (USDC on Base) or `mpp-charge` / `mpp-session` (Tempo) |
70
+ | `1s_refund` | Refund unused x402 `batch` channel balance back to your wallet on demand |
71
+
72
+
73
+ ## Networks
74
+
75
+ All tools accept an optional `network` parameter:
76
+
77
+ | Network | Description |
78
+ |---------|-------------|
79
+ | `ethereum` | Ethereum mainnet (default) |
80
+ | `sepolia` | Ethereum Sepolia testnet |
81
+
82
+
83
+ ## Authentication
84
+
85
+ Two auth methods are supported. **API key takes priority** when both are configured.
86
+
87
+ ### API Key (recommended)
88
+
89
+ Set `ONESOURCE_API_KEY` to your OneSource API key. The server sends it as a Bearer token on every request.
90
+
91
+ ```sh
92
+ ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp
93
+ ```
94
+
95
+ Or in your MCP config:
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "onesource-api": {
100
+ "command": "npx",
101
+ "args": ["-y", "onesource-api-mcp"],
102
+ "env": {
103
+ "ONESOURCE_API_KEY": "your-key-here"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### x402 Micropayments
111
+
112
+ Set `X402_PRIVATE_KEY` to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via [x402](https://github.com/coinbase/x402).
113
+
114
+ ```sh
115
+ X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
116
+ ```
117
+
118
+ Payments default to the **exact** scheme (one USDC payment per call). For a burst of calls you can switch to **batch** settlement — a payment channel that funds many off-chain calls from a single on-chain deposit, settled with one claim — by calling the `1s_payment_mode` tool with `{ "mode": "batch" }`, or by setting `X402_PAYMENT_MODE=batch`. Both modes use the same wallet.
119
+
120
+ In batch mode the first paid call deposits `price × X402_DEPOSIT_MULTIPLIER` (default 10) up front, so a session typically over-funds the channel. Reclaim the unused balance whenever you're done with the `1s_refund` tool; idle channels are also auto-refunded by the receiver after a few hours. The deposit residual is always recoverable.
121
+
122
+ ### MPP Micropayments (Tempo)
123
+
124
+ Set `MPP_PRIVATE_KEY` to a funded [Tempo](https://mpp.dev) wallet key. The server automatically signs and settles Tempo payments (USDC.e / pathUSD) via the [`mppx`](https://github.com/wevm/mppx) SDK.
125
+
126
+ ```sh
127
+ MPP_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp
128
+ ```
129
+
130
+ MPP has two modes, switched with `1s_payment_mode`: **`mpp-charge`** (default — one payment per call) and **`mpp-session`** (a voucher channel — one on-chain deposit, capped by `MPP_MAX_DEPOSIT`, funds many off-chain calls; the unspent deposit is reclaimed automatically on clean shutdown). x402 and MPP are separate rails with separate wallets; if both keys are set, x402 is the initial rail and you switch between all four modes in-session.
131
+
132
+ ### No auth
133
+
134
+ Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.
135
+
136
+
137
+ ## Configuration
138
+
139
+ Most users only set one of the two keys below. Everything else has a working default — including batch mode, which runs out of the box with no extra configuration.
140
+
141
+ ### Required
142
+
143
+ Set one to access paid endpoints. Without either, only free endpoints work. API key takes priority when both are set.
144
+
145
+ | Variable | Default | Description |
146
+ |----------|---------|-------------|
147
+ | `ONESOURCE_API_KEY` | | OneSource API key. Sent as `Authorization: Bearer <key>`. Takes priority over a payment wallet. |
148
+ | `X402_PRIVATE_KEY` | | EVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base. |
149
+ | `MPP_PRIVATE_KEY` | — | EVM private key (hex, with or without 0x prefix) for automatic MPP payments on Tempo (USDC.e / pathUSD). |
150
+
151
+ ### Optional / Advanced
152
+
153
+ All have sensible defaults — set these only to override an endpoint or tune how channel modes behave. You can switch payment modes at runtime with the `1s_payment_mode` tool instead of setting any of these.
154
+
155
+ | Variable | Default | Description |
156
+ |----------|---------|-------------|
157
+ | `ONESOURCE_BASE_URL` | `https://api.onesource.io` | API endpoint. |
158
+ | `ONESOURCE_PAYMENT_MODE` | rail default | Initial rail+mode: `x402-exact`, `x402-batch`, `mpp-charge`, or `mpp-session`. Falls back to the enabled rail's own default. |
159
+ | `X402_PAYMENT_MODE` | `exact` | Initial x402 scheme: `exact` (per-call) or `batch` (payment channel). Switch in-session with the `1s_payment_mode` tool. |
160
+ | `X402_RPC_URL` | Base default | Base RPC endpoint used to submit channel deposits in batch mode. |
161
+ | `X402_CHANNEL_DIR` | — | Directory to persist batch channel state across restarts. Unset = in-memory (channel lost on restart). |
162
+ | `X402_DEPOSIT_MULTIPLIER` | `10` | Batch mode: deposit = price × this multiplier, funding that many calls per channel. Unused balance is reclaimable via `1s_refund`. |
163
+ | `MPP_PAYMENT_MODE` | `charge` | Initial MPP mode: `charge` (per-call) or `session` (voucher channel). Switch in-session with the `1s_payment_mode` tool. |
164
+ | `MPP_MAX_DEPOSIT` | `1` | `mpp-session`: max tokens reserved in the on-chain channel deposit. Bounds the worst-case locked balance on an unclean shutdown. |
165
+ | `MPP_RPC_URL` | Tempo default | Tempo RPC endpoint used to open/settle the session channel (`mpp-session` only). |
166
+
167
+
168
+ ## License
169
+
170
+ MIT