@one-source/mcp 4.0.3 → 5.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.
@@ -9,7 +9,7 @@ description: >-
9
9
 
10
10
  # OneSource MCP Setup Guide
11
11
 
12
- OneSource MCP provides 33 tools for blockchain data, live chain queries, and API documentation. Documentation tools are free. Blockchain API tools require x402 micropayments in USDC on the Base network.
12
+ OneSource MCP provides 24 tools for blockchain data and live chain queries. Blockchain API tools require authentication either an API key (`ONESOURCE_API_KEY`) or x402 micropayments in USDC on the Base network (`X402_PRIVATE_KEY`).
13
13
 
14
14
  ## Before You Start
15
15
 
@@ -72,7 +72,7 @@ To update, reinstall with `@latest` or clear the npx cache: `npx -y @one-source/
72
72
 
73
73
  ## Step 3: Get an EVM Private Key
74
74
 
75
- The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It must be a hex string starting with `0x`.
75
+ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It is a 64-character hex string. The `0x` prefix is optional — both formats are accepted.
76
76
 
77
77
  ### Option A: Export from MetaMask
78
78
 
@@ -80,7 +80,7 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
80
80
  2. Click the three dots next to the account name
81
81
  3. Go to **Account details** > **Show private key**
82
82
  4. Enter your MetaMask password
83
- 5. Copy the key (starts with `0x`)
83
+ 5. Copy the key
84
84
 
85
85
  ### Option B: Export from Coinbase Wallet
86
86
 
@@ -90,26 +90,21 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
90
90
  ### Option C: Generate a New Wallet
91
91
 
92
92
  ```bash
93
- # Using OpenSSL
94
- echo "0x$(openssl rand -hex 32)"
93
+ # Using OpenSSL (macOS/Linux, or Git Bash on Windows)
94
+ openssl rand -hex 32
95
95
 
96
96
  # Using Foundry (if installed)
97
97
  cast wallet new
98
98
  ```
99
99
 
100
- **Important:** Use a dedicated wallet for MCP payments — do not use your primary wallet with large holdings. Transfer only what you need.
101
-
102
- ## Step 4: Fund the Wallet with USDC on Base
103
-
104
- The wallet must hold **USDC on the Base network** (not Ethereum mainnet, not other tokens).
105
-
106
- 1. Get the wallet address — set the key (Step 5) and call `1s_setup_check` to see the address, or import the key into MetaMask to see it.
107
- 2. Send USDC to that address **on the Base network**.
108
- 3. A few dollars ($1–5 USDC) is enough for hundreds of API calls.
100
+ ```powershell
101
+ # PowerShell (Windows)
102
+ -join ((1..32) | ForEach-Object { "{0:x2}" -f (Get-Random -Max 256) })
103
+ ```
109
104
 
110
- If you have USDC on Ethereum mainnet, bridge it to Base using the [Base Bridge](https://bridge.base.org) or any cross-chain bridge that supports Base.
105
+ **Important:** Use a dedicated wallet for MCP payments do not use your primary wallet with large holdings. Transfer only what you need.
111
106
 
112
- ## Step 5: Set the Private Key
107
+ ## Step 4: Set the Private Key
113
108
 
114
109
  ### Claude Code
115
110
 
@@ -118,6 +113,8 @@ claude mcp remove onesource
118
113
  claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
119
114
  ```
120
115
 
116
+ > **Scope tip:** Claude Code stores MCP configs at three levels — `user`, `project`, and `local`. Use `local` scope (the default for `claude mcp add`) for faster debugging and testing. You can check which scope your config is in by looking at `.claude/settings.local.json` (local), `.claude/settings.json` (project), or `~/.claude/settings.json` (user).
117
+
121
118
  ### Claude Desktop / Cursor
122
119
 
123
120
  Add the `env` block to your MCP config:
@@ -142,28 +139,114 @@ Add the `env` block to your MCP config:
142
139
  X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
143
140
  ```
144
141
 
142
+ ### Manual Setup (Editing the Config File Directly)
143
+
144
+ The CLI commands above write to a JSON config file. You can also edit this file directly — this is useful for debugging or if you want to understand what the setup actually does.
145
+
146
+ **Claude Code** — Find which file your config is in by running `claude mcp get onesource`. Depending on the scope:
147
+ - **Local:** `.claude/settings.local.json` in your project directory
148
+ - **Project:** `.claude/settings.json` in your project directory
149
+ - **User:** `~/.claude/settings.json` (macOS/Linux) or `%USERPROFILE%\.claude\settings.json` (Windows)
150
+
151
+ **Claude Desktop:**
152
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
153
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
154
+
155
+ **Cursor:**
156
+ - **macOS:** `~/.cursor/mcp.json`
157
+ - **Windows:** `%USERPROFILE%\.cursor\mcp.json`
158
+
159
+ Open the config file and add (or update) the `onesource` entry inside `"mcpServers"`:
160
+
161
+ ```json
162
+ {
163
+ "mcpServers": {
164
+ "onesource": {
165
+ "command": "npx",
166
+ "args": ["-y", "@one-source/mcp@latest"],
167
+ "env": {
168
+ "X402_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY_HERE"
169
+ }
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ Save the file, then reload (see below).
176
+
177
+ ### Important: Reload After Config Changes
178
+
179
+ Changing the config file (via `claude mcp add` or manual edit) does **not** automatically restart the running MCP server. You must reload:
180
+
181
+ - **Claude Code:** Run `/reload-plugins` (preferred — no restart needed), or restart Claude Code entirely.
182
+ - **Claude Desktop / Cursor:** Restart the app — close it completely and reopen.
183
+
184
+ Without reloading, the old server process keeps running with the old config, and `1s_setup_check` will still show "Not configured" even though the key is in the file.
185
+
186
+ ### Alternative: Set the Key as an Environment Variable
187
+
188
+ If the `env` block in the config isn't reaching the server after reloading, you can set the key as an environment variable directly instead:
189
+
190
+ **bash / zsh (macOS / Linux):**
191
+
192
+ ```bash
193
+ export X402_PRIVATE_KEY=0x...
194
+ ```
195
+
196
+ To make it persistent, add the line to your `~/.bashrc`, `~/.zshrc`, or `~/.profile`.
197
+
198
+ **PowerShell (Windows):**
199
+
200
+ ```powershell
201
+ $env:X402_PRIVATE_KEY = "0x..."
202
+ ```
203
+
204
+ This only lasts for the current session. To make it persistent, either:
205
+ - Add it to your PowerShell profile (`notepad $PROFILE`, add the line, restart PowerShell)
206
+ - Or set it as a system environment variable: **Settings > System > About > Advanced system settings > Environment Variables > User variables > New** — name: `X402_PRIVATE_KEY`, value: `0x...`
207
+
208
+ After setting the variable, restart your MCP client and run `1s_setup_check` to confirm.
209
+
210
+ > **Windows note:** Claude Code's `/doctor` command may warn that Windows requires a `cmd /c` wrapper to execute `npx`. If you encounter issues, update the config to use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@one-source/mcp@latest"]`.
211
+
145
212
  ### Security
146
213
 
147
214
  - **Never** commit your private key to source control.
148
215
  - Use environment variables, a `.env` file (excluded from git), or a secrets manager.
149
216
  - Use a dedicated wallet with minimal funds — only what you need for API calls.
150
217
 
218
+ ## Step 5: Fund the Wallet with USDC on Base
219
+
220
+ The wallet must hold **USDC on the Base network** (not Ethereum mainnet, not other tokens).
221
+
222
+ 1. Get the wallet address — call `1s_setup_check` (it shows the address after you set the key), or import the key into MetaMask to see it.
223
+ 2. Send USDC to that address **on the Base network**.
224
+ 3. A few dollars ($1–5 USDC) is enough for hundreds of API calls.
225
+
226
+ If you have USDC on Ethereum mainnet, bridge it to Base using the [Base Bridge](https://bridge.base.org) or any cross-chain bridge that supports Base.
227
+
151
228
  ## Step 6: Verify
152
229
 
153
- After setting the key and restarting the MCP server, call `1s_setup_check` again. You should see:
230
+ After setting the key, reload and verify:
154
231
 
155
- - **x402 status:** Configured
156
- - **Wallet address:** Your wallet address
157
- - **API backend:** Reachable
232
+ 1. **Reload the MCP server** — In Claude Code, run `/reload-plugins` to pick up config changes without restarting the session.
233
+ 2. **Check MCP connection** Run `/mcp` to confirm the `onesource` server is connected.
234
+ 3. **Run `1s_setup_check`** — You should see:
235
+ - **x402 status:** Configured
236
+ - **Wallet address:** Your wallet address
237
+ - **API backend:** Reachable
238
+ 4. **Test a paid tool** — Try `1s_network_info` to confirm payments work end-to-end.
158
239
 
159
- Then try a paid tool like `1s_network_info` to confirm payments work end-to-end.
240
+ > **Tip:** If you edited the config file manually (instead of using `claude mcp add`), you must run `/reload-plugins` for changes to take effect. Restarting Claude Code also works.
160
241
 
161
242
  ## Troubleshooting
162
243
 
163
244
  | Problem | Solution |
164
245
  |---------|----------|
165
- | `1s_setup_check` shows "Not configured" | The `X402_PRIVATE_KEY` env var is not reaching the server. Check your MCP client config and restart. |
246
+ | `1s_setup_check` shows "Not configured" | Most common cause: config was changed but the MCP server wasn't reloaded. Run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor. If the key still isn't reaching the server, try setting it as an environment variable directly — see **Alternative: Set the Key as an Environment Variable** above. |
247
+ | "MCP server onesource already exists" error | Run `claude mcp remove onesource` first, then re-add it with your updated config. |
248
+ | Config changed but nothing happened | Run `/reload-plugins` in Claude Code to reload MCP servers, then `/mcp` to check connection status. |
166
249
  | Tool returns HTTP 402 error | x402 is not configured, or the wallet has insufficient USDC on Base. |
167
- | "x402 setup failed" in server logs | The private key format is wrong. It must be a 64-character hex string prefixed with `0x`. |
250
+ | "x402 setup failed" in server logs | The private key format is wrong. It must be a 64-character hex string (with or without `0x` prefix). |
168
251
  | Key is set but wallet shows 0 USDC | Make sure USDC is on the **Base** network, not Ethereum mainnet or another chain. |
169
252
  | Tools work but results seem stale | Check `1s_setup_check` for version — you may need to update to the latest. |