@one-source/mcp 5.1.0 → 5.2.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/README.npm.md CHANGED
@@ -1,227 +1,233 @@
1
- # @one-source/mcp
2
-
3
- Unified MCP server for [OneSource](https://docs.onesource.io) — 27 tools for blockchain data and live chain queries in a single server.
4
-
5
- > **What is MCP?** The [Model Context Protocol](https://modelcontextprotocol.io) lets AI assistants call tools and access data sources. This server exposes both the OneSource blockchain API and its documentation as tools.
6
-
7
- ## Quick Start
8
-
9
- ### Claude Code
10
-
11
- ```bash
12
- claude mcp add onesource -- npx -y @one-source/mcp@latest
13
- ```
14
-
15
- ### Claude Desktop / Cursor
16
-
17
- Add to your MCP config:
18
-
19
- ```json
20
- {
21
- "mcpServers": {
22
- "onesource": {
23
- "command": "npx",
24
- "args": ["-y", "@one-source/mcp@latest"]
25
- }
26
- }
27
- }
28
- ```
29
-
30
- ### Any MCP Client (stdio)
31
-
32
- ```bash
33
- npx -y @one-source/mcp@latest
34
- ```
35
-
36
- ### HTTP Server (self-hosted)
37
-
38
- ```bash
39
- npx -y @one-source/mcp@latest --http
40
- npx -y @one-source/mcp@latest --http --port=8080
41
- ```
42
-
43
- Then connect your MCP client to `http://localhost:3000/`.
44
-
45
- Health check: `GET http://localhost:3000/health`
46
-
47
- ## Tools (27)
48
-
49
- ### Blockchain API — Live Chain (12 tools)
50
-
51
- | Tool | Description |
52
- |------|-------------|
53
- | `1s_allowance_live` | ERC20 allowance check |
54
- | `1s_contract_info_live` | Contract type detection via ERC165 |
55
- | `1s_erc1155_balance_live` | ERC1155 balance via RPC |
56
- | `1s_erc20_balance_live` | ERC20 balance via balanceOf |
57
- | `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
58
- | `1s_erc721_tokens_live` | ERC721 token enumeration |
59
- | `1s_events_live` | Event logs via eth_getLogs |
60
- | `1s_multi_balance_live` | ETH + multiple ERC20 balances |
61
- | `1s_nft_metadata_live` | NFT metadata via tokenURI |
62
- | `1s_nft_owner_live` | NFT owner via ownerOf |
63
- | `1s_total_supply_live` | Token total supply |
64
- | `1s_tx_details_live` | Transaction + receipt via RPC |
65
-
66
- ### Blockchain API — Chain Utilities (13 tools)
67
-
68
- RPC only.
69
-
70
- | Tool | Description |
71
- |------|-------------|
72
- | `1s_block_by_number` | Block details by number via RPC |
73
- | `1s_block_number` | Latest block number |
74
- | `1s_chain_id` | EIP-155 chain ID |
75
- | `1s_contract_code` | Contract bytecode |
76
- | `1s_ens_resolve` | ENS name/address resolution |
77
- | `1s_estimate_gas` | Gas estimation |
78
- | `1s_network_info` | Chain ID, block number, gas price |
79
- | `1s_nonce` | Transaction count |
80
- | `1s_pending_block` | Pending block from mempool |
81
- | `1s_proxy_detect` | Proxy contract detection |
82
- | `1s_simulate_call` | Simulate eth_call |
83
- | `1s_storage_read` | Read storage slot |
84
- | `1s_tx_receipt` | Transaction receipt |
85
-
86
- ### Setup & Ops (2 tools)
87
-
88
- No authentication required.
89
-
90
- | Tool | Purpose | When to use |
91
- |------|---------|-------------|
92
- | `1s_setup_check` | Server health, version, auth status, setup instructions | First thing to call — checks if everything is configured |
93
- | `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
94
-
95
- ## Networks
96
-
97
- All blockchain API tools accept an optional `network` parameter:
98
-
99
- | Network | Description |
100
- |---------|-------------|
101
- | `ethereum` | Ethereum mainnet (default) |
102
- | `sepolia` | Ethereum Sepolia testnet |
103
- | `avax` | Avalanche C-Chain |
104
-
105
- ## Authentication
106
-
107
- Blockchain API tools require authentication. Two options are available — if both are set, API key takes priority.
108
-
109
- | Method | Variable | Description |
110
- |--------|----------|-------------|
111
- | API key | `ONESOURCE_API_KEY` | Unlimited calls, no per-call cost |
112
- | x402 micropayments | `X402_PRIVATE_KEY` | Pay-per-call via USDC on Base, no account required |
113
-
114
- ### Option 1: API Key
115
-
116
- 1. Go to [app.onesource.io](https://app.onesource.io) and create an account.
117
- 2. Subscribe to a developer plan (Stripe checkout).
118
- 3. Navigate to **API Keys** and generate a key.
119
- 4. Copy the key — it starts with `sk_`.
120
-
121
- #### Claude Code
122
-
123
- ```bash
124
- claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
125
- ```
126
-
127
- #### Claude Desktop / Cursor
128
-
129
- ```json
130
- {
131
- "mcpServers": {
132
- "onesource": {
133
- "command": "npx",
134
- "args": ["-y", "@one-source/mcp@latest"],
135
- "env": {
136
- "ONESOURCE_API_KEY": "<key>"
137
- }
138
- }
139
- }
140
- }
141
- ```
142
-
143
- #### Any MCP Client (stdio)
144
-
145
- ```bash
146
- ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
147
- ```
148
-
149
- After adding, reload the MCP server and call `1s_setup_check` — it should show `Status: Configured (API key)`.
150
-
151
- ### Option 2: x402 Micropayments
152
-
153
- Pay-per-call via USDC on Base using [x402](https://github.com/coinbase/x402). No account required — just an EVM wallet funded with USDC. The server handles payments transparently.
154
-
155
- 1. **Get an EVM private key** — export from MetaMask, Coinbase Wallet, or generate a fresh one. The key is a 64-character hex string. The `0x` prefix is optional both formats are accepted.
156
- 2. **Pass the key to the server:**
157
-
158
- #### Claude Code
159
-
160
- ```bash
161
- claude mcp add onesource -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest
162
- ```
163
-
164
- #### Claude Desktop / Cursor
165
-
166
- ```json
167
- {
168
- "mcpServers": {
169
- "onesource": {
170
- "command": "npx",
171
- "args": ["-y", "@one-source/mcp@latest"],
172
- "env": {
173
- "X402_PRIVATE_KEY": "<key>"
174
- }
175
- }
176
- }
177
- }
178
- ```
179
-
180
- #### Any MCP Client (stdio)
181
-
182
- ```bash
183
- X402_PRIVATE_KEY=<key> npx -y @one-source/mcp@latest
184
- ```
185
-
186
- 3. **Reload and find your wallet address** — reload the MCP server, then call `1s_setup_check`. It will show the wallet address derived from your key under "Wallet address".
187
- 4. **Fund that address with USDC on Base** — send USDC to the address shown, on the [Base](https://base.org) network. A few dollars ($1–5 USDC) is enough for hundreds of calls. Bridge from Ethereum mainnet if needed using the [Base Bridge](https://bridge.base.org).
188
- 5. **Verify** — call `1s_network_info` for ethereum. If it returns chain data, payments are working.
189
-
190
- ### Security
191
-
192
- Never commit keys to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
193
-
194
- > **After any config change:** Run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor. The MCP server must be reloaded to pick up new environment variables.
195
-
196
- ## Environment Variables
197
-
198
- | Variable | Default | Description |
199
- |----------|---------|-------------|
200
- | `ONESOURCE_API_KEY` | | OneSource API key for Bearer token auth. Takes priority over x402. |
201
- | `X402_PRIVATE_KEY` | — | EVM private key (64-char hex, `0x` prefix optional) for automatic x402 USDC payments on Base |
202
-
203
- ## Troubleshooting
204
-
205
- **`1s_setup_check` shows "Not configured"** — Set either `ONESOURCE_API_KEY` or `X402_PRIVATE_KEY`. Reload the MCP server after setting either variable. If the key still isn't reaching the server, set it as a shell environment variable directly.
206
-
207
- **Getting 403 / wrong key active despite correct setup** — A key set in your shell profile (e.g. `~/.zshrc`, `~/.bash_profile`) is picked up by the MCP server process even if it isn't in your Claude MCP config. Run `echo $ONESOURCE_API_KEY` in your terminal to check. If it prints a value you didn't intend, unset it (`unset ONESOURCE_API_KEY`) or explicitly clear it when adding the server: `claude mcp add onesource -e ONESOURCE_API_KEY= -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest`. `1s_setup_check` shows the first 6 characters of whichever key is active so you can confirm which one the server is using.
208
-
209
- **Instructions show wrong auth method after reinstall** — `/reload-plugins` in Claude Code reconnects tools but may not refresh the system prompt the LLM sees. If you switch auth method (e.g. API key → x402), do a full Claude Code restart to ensure the instructions reflect the new auth.
210
-
211
- **"MCP server onesource already exists" error** Run `claude mcp remove onesource` first, then re-add.
212
-
213
- **Windows: `npx` requires `cmd /c` wrapper** — Update your MCP config to use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@one-source/mcp@latest"]`. Claude Code's `/doctor` command can diagnose this.
214
-
215
- **`npx` hangs with no output** — That's normal in stdio mode. Use `--http` for an HTTP server.
216
-
217
- **Port already in use** — Specify a different port: `npx -y @one-source/mcp@latest --http --port=8080`
218
-
219
- ## Links
220
-
221
- - [GitHub Repository](https://github.com/blockparty-global/1s-mcp)
222
- - [OneSource Documentation](https://docs.onesource.io)
223
- - [Report an Issue](https://github.com/blockparty-global/1s-mcp/issues)
224
-
225
- ## License
226
-
227
- Apache 2.0
1
+ # @one-source/mcp
2
+
3
+ Unified MCP server for [OneSource](https://docs.onesource.io) — 28 tools for blockchain data and live chain queries in a single server.
4
+
5
+ > **What is MCP?** The [Model Context Protocol](https://modelcontextprotocol.io) lets AI assistants call tools and access data sources. This server exposes both the OneSource blockchain API and its documentation as tools.
6
+
7
+ ## Quick Start
8
+
9
+ ### Claude Code
10
+
11
+ ```bash
12
+ claude mcp add onesource -- npx -y @one-source/mcp@latest
13
+ ```
14
+
15
+ ### Claude Desktop / Cursor
16
+
17
+ Add to your MCP config:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "onesource": {
23
+ "command": "npx",
24
+ "args": ["-y", "@one-source/mcp@latest"]
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ ### Any MCP Client (stdio)
31
+
32
+ ```bash
33
+ npx -y @one-source/mcp@latest
34
+ ```
35
+
36
+ ### HTTP Server (self-hosted)
37
+
38
+ ```bash
39
+ npx -y @one-source/mcp@latest --http
40
+ npx -y @one-source/mcp@latest --http --port=8080
41
+ ```
42
+
43
+ Then connect your MCP client to `http://localhost:3000/`.
44
+
45
+ Health check: `GET http://localhost:3000/health`
46
+
47
+ ## Tools (28)
48
+
49
+ ### Blockchain API — Live Chain (12 tools)
50
+
51
+ | Tool | Description |
52
+ |------|-------------|
53
+ | `1s_allowance_live` | ERC20 allowance check |
54
+ | `1s_contract_info_live` | Contract type detection via ERC165 |
55
+ | `1s_erc1155_balance_live` | ERC1155 balance via RPC |
56
+ | `1s_erc20_balance_live` | ERC20 balance via balanceOf |
57
+ | `1s_erc20_transfers_live` | ERC20 Transfer logs via eth_getLogs |
58
+ | `1s_erc721_tokens_live` | ERC721 token enumeration |
59
+ | `1s_events_live` | Event logs via eth_getLogs |
60
+ | `1s_multi_balance_live` | ETH + multiple ERC20 balances |
61
+ | `1s_nft_metadata_live` | NFT metadata via tokenURI |
62
+ | `1s_nft_owner_live` | NFT owner via ownerOf |
63
+ | `1s_total_supply_live` | Token total supply |
64
+ | `1s_tx_details_live` | Transaction + receipt via RPC |
65
+
66
+ ### Blockchain API — Chain Utilities (13 tools)
67
+
68
+ RPC only.
69
+
70
+ | Tool | Description |
71
+ |------|-------------|
72
+ | `1s_block_by_number` | Block details by number via RPC |
73
+ | `1s_block_number` | Latest block number |
74
+ | `1s_chain_id` | EIP-155 chain ID |
75
+ | `1s_contract_code` | Contract bytecode |
76
+ | `1s_ens_resolve` | ENS name/address resolution |
77
+ | `1s_estimate_gas` | Gas estimation |
78
+ | `1s_network_info` | Chain ID, block number, gas price |
79
+ | `1s_nonce` | Transaction count |
80
+ | `1s_pending_block` | Pending block from mempool |
81
+ | `1s_proxy_detect` | Proxy contract detection |
82
+ | `1s_simulate_call` | Simulate eth_call |
83
+ | `1s_storage_read` | Read storage slot |
84
+ | `1s_tx_receipt` | Transaction receipt |
85
+
86
+ ### Payments (1 tool)
87
+
88
+ | Tool | Description |
89
+ |------|-------------|
90
+ | `1s_payment_mode` | View or switch the x402 payment scheme — `exact` (per-call) vs `batch` (payment channel: one deposit funds many off-chain calls, settled with a single claim) |
91
+
92
+ ### Setup & Ops (2 tools)
93
+
94
+ No authentication required.
95
+
96
+ | Tool | Purpose | When to use |
97
+ |------|---------|-------------|
98
+ | `1s_setup_check` | Server health, version, auth status, setup instructions | First thing to call — checks if everything is configured |
99
+ | `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
100
+
101
+ ## Networks
102
+
103
+ All blockchain API tools accept an optional `network` parameter:
104
+
105
+ | Network | Description |
106
+ |---------|-------------|
107
+ | `ethereum` | Ethereum mainnet (default) |
108
+ | `sepolia` | Ethereum Sepolia testnet |
109
+ | `avax` | Avalanche C-Chain |
110
+
111
+ ## Authentication
112
+
113
+ Blockchain API tools require authentication. Two options are available — if both are set, API key takes priority.
114
+
115
+ | Method | Variable | Description |
116
+ |--------|----------|-------------|
117
+ | API key | `ONESOURCE_API_KEY` | Unlimited calls, no per-call cost |
118
+ | x402 micropayments | `X402_PRIVATE_KEY` | Pay-per-call via USDC on Base, no account required |
119
+
120
+ ### Option 1: API Key
121
+
122
+ 1. Go to [app.onesource.io](https://app.onesource.io) and create an account.
123
+ 2. Subscribe to a developer plan (Stripe checkout).
124
+ 3. Navigate to **API Keys** and generate a key.
125
+ 4. Copy the key — it starts with `sk_`.
126
+
127
+ #### Claude Code
128
+
129
+ ```bash
130
+ claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
131
+ ```
132
+
133
+ #### Claude Desktop / Cursor
134
+
135
+ ```json
136
+ {
137
+ "mcpServers": {
138
+ "onesource": {
139
+ "command": "npx",
140
+ "args": ["-y", "@one-source/mcp@latest"],
141
+ "env": {
142
+ "ONESOURCE_API_KEY": "<key>"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ #### Any MCP Client (stdio)
150
+
151
+ ```bash
152
+ ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
153
+ ```
154
+
155
+ After adding, reload the MCP server and call `1s_setup_check` it should show `Status: Configured (API key)`.
156
+
157
+ ### Option 2: x402 Micropayments
158
+
159
+ Pay-per-call via USDC on Base using [x402](https://github.com/coinbase/x402). No account required — just an EVM wallet funded with USDC. The server handles payments transparently.
160
+
161
+ 1. **Get an EVM private key** export from MetaMask, Coinbase Wallet, or generate a fresh one. The key is a 64-character hex string. The `0x` prefix is optional — both formats are accepted.
162
+ 2. **Pass the key to the server:**
163
+
164
+ #### Claude Code
165
+
166
+ ```bash
167
+ claude mcp add onesource -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest
168
+ ```
169
+
170
+ #### Claude Desktop / Cursor
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "onesource": {
176
+ "command": "npx",
177
+ "args": ["-y", "@one-source/mcp@latest"],
178
+ "env": {
179
+ "X402_PRIVATE_KEY": "<key>"
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ #### Any MCP Client (stdio)
187
+
188
+ ```bash
189
+ X402_PRIVATE_KEY=<key> npx -y @one-source/mcp@latest
190
+ ```
191
+
192
+ 3. **Reload and find your wallet address** reload the MCP server, then call `1s_setup_check`. It will show the wallet address derived from your key under "Wallet address".
193
+ 4. **Fund that address with USDC on Base** — send USDC to the address shown, on the [Base](https://base.org) network. A few dollars ($1–5 USDC) is enough for hundreds of calls. Bridge from Ethereum mainnet if needed using the [Base Bridge](https://bridge.base.org).
194
+ 5. **Verify** call `1s_network_info` for ethereum. If it returns chain data, payments are working.
195
+
196
+ ### Security
197
+
198
+ Never commit keys to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
199
+
200
+ > **After any config change:** Run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor. The MCP server must be reloaded to pick up new environment variables.
201
+
202
+ ## Environment Variables
203
+
204
+ | Variable | Default | Description |
205
+ |----------|---------|-------------|
206
+ | `ONESOURCE_API_KEY` | — | OneSource API key for Bearer token auth. Takes priority over x402. |
207
+ | `X402_PRIVATE_KEY` | | EVM private key (64-char hex, `0x` prefix optional) for automatic x402 USDC payments on Base |
208
+
209
+ ## Troubleshooting
210
+
211
+ **`1s_setup_check` shows "Not configured"** — Set either `ONESOURCE_API_KEY` or `X402_PRIVATE_KEY`. Reload the MCP server after setting either variable. If the key still isn't reaching the server, set it as a shell environment variable directly.
212
+
213
+ **Getting 403 / wrong key active despite correct setup** — A key set in your shell profile (e.g. `~/.zshrc`, `~/.bash_profile`) is picked up by the MCP server process even if it isn't in your Claude MCP config. Run `echo $ONESOURCE_API_KEY` in your terminal to check. If it prints a value you didn't intend, unset it (`unset ONESOURCE_API_KEY`) or explicitly clear it when adding the server: `claude mcp add onesource -e ONESOURCE_API_KEY= -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest`. `1s_setup_check` shows the first 6 characters of whichever key is active so you can confirm which one the server is using.
214
+
215
+ **Instructions show wrong auth method after reinstall** — `/reload-plugins` in Claude Code reconnects tools but may not refresh the system prompt the LLM sees. If you switch auth method (e.g. API key → x402), do a full Claude Code restart to ensure the instructions reflect the new auth.
216
+
217
+ **"MCP server onesource already exists" error** — Run `claude mcp remove onesource` first, then re-add.
218
+
219
+ **Windows: `npx` requires `cmd /c` wrapper** — Update your MCP config to use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@one-source/mcp@latest"]`. Claude Code's `/doctor` command can diagnose this.
220
+
221
+ **`npx` hangs with no output** — That's normal in stdio mode. Use `--http` for an HTTP server.
222
+
223
+ **Port already in use** — Specify a different port: `npx -y @one-source/mcp@latest --http --port=8080`
224
+
225
+ ## Links
226
+
227
+ - [GitHub Repository](https://github.com/blockparty-global/1s-mcp)
228
+ - [OneSource Documentation](https://docs.onesource.io)
229
+ - [Report an Issue](https://github.com/blockparty-global/1s-mcp/issues)
230
+
231
+ ## License
232
+
233
+ Apache 2.0