@one-source/mcp 5.0.4 → 5.1.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 +190 -190
- package/README.md +227 -220
- package/README.npm.md +227 -220
- package/README.repo.md +365 -356
- package/dist/cli.js +1 -1
- package/dist/create-server.d.ts +2 -2
- package/dist/create-server.js +2 -2
- package/dist/register-api-tools.d.ts +1 -1
- package/dist/register-api-tools.d.ts.map +1 -1
- package/dist/register-api-tools.js +10 -2
- package/dist/register-api-tools.js.map +1 -1
- package/dist/register-docs-tools.d.ts.map +1 -1
- package/dist/register-docs-tools.js +7 -0
- package/dist/register-docs-tools.js.map +1 -1
- package/package.json +60 -60
- package/skills/onesource-mcp-setup/SKILL.md +308 -308
|
@@ -1,308 +1,308 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: onesource-mcp-setup
|
|
3
|
-
description: >-
|
|
4
|
-
Guide for installing and configuring the OneSource MCP server. Covers both
|
|
5
|
-
authentication options (API key and x402 micropayments), wallet setup, USDC
|
|
6
|
-
funding on Base, and verification. Use when a user needs help setting up
|
|
7
|
-
OneSource MCP or configuring either auth method.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# OneSource MCP Setup Guide
|
|
11
|
-
|
|
12
|
-
OneSource MCP provides
|
|
13
|
-
|
|
14
|
-
## Before You Start
|
|
15
|
-
|
|
16
|
-
**Always call `1s_setup_check` before using any other OneSource tools.** This checks the installed version against the latest release and reports authentication status.
|
|
17
|
-
|
|
18
|
-
- **If an update is available:** Tell the user and help them update before proceeding. Run `npx -y @one-source/mcp@latest` to get the latest version. The update takes effect on the next session — the user will need to restart their MCP client.
|
|
19
|
-
- **If `1s_setup_check` is not available:** The MCP is either not installed or running a version before this tool existed. Help the user install or update using the instructions in Step 2 below.
|
|
20
|
-
- **If auth is not configured:** The tool will include setup instructions. Walk the user through them before attempting API calls.
|
|
21
|
-
|
|
22
|
-
Do not skip this step — outdated versions may be missing tools, fixes, or protocol changes.
|
|
23
|
-
|
|
24
|
-
## Step 1: Check Current Installation
|
|
25
|
-
|
|
26
|
-
Call the `1s_setup_check` tool. It reports:
|
|
27
|
-
- Server version (current vs latest)
|
|
28
|
-
- Which auth method is active (API key, x402), or whether auth is not yet configured
|
|
29
|
-
- Wallet address (if x402 is configured)
|
|
30
|
-
- API backend connectivity
|
|
31
|
-
|
|
32
|
-
If the tool is not available, the MCP is not installed — go to Step 2.
|
|
33
|
-
|
|
34
|
-
## Step 2: Install or Update
|
|
35
|
-
|
|
36
|
-
### Claude Code
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
claude mcp add onesource -- npx -y @one-source/mcp@latest
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Claude Desktop / Cursor
|
|
43
|
-
|
|
44
|
-
Add to your MCP configuration file:
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"mcpServers": {
|
|
49
|
-
"onesource": {
|
|
50
|
-
"command": "npx",
|
|
51
|
-
"args": ["-y", "@one-source/mcp@latest"]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Any MCP Client (stdio)
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npx -y @one-source/mcp@latest
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Check for Updates
|
|
64
|
-
|
|
65
|
-
Compare the installed version (shown in `1s_setup_check` output) against the latest:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npm view @one-source/mcp version
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
To update, reinstall with `@latest` or clear the npx cache: `npx -y @one-source/mcp@latest`.
|
|
72
|
-
|
|
73
|
-
## Step 3: Configure Authentication
|
|
74
|
-
|
|
75
|
-
Choose one option. If both are set, API key takes priority.
|
|
76
|
-
|
|
77
|
-
### Option A: API Key
|
|
78
|
-
|
|
79
|
-
1. Go to [app.onesource.io](https://app.onesource.io) and create an account.
|
|
80
|
-
2. Subscribe to a developer plan (Stripe checkout).
|
|
81
|
-
3. Navigate to **API Keys** and generate a key.
|
|
82
|
-
4. Copy the key — it starts with `sk_`.
|
|
83
|
-
|
|
84
|
-
#### Claude Code
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
claude mcp remove onesource
|
|
88
|
-
claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### Claude Desktop / Cursor
|
|
92
|
-
|
|
93
|
-
Add the `env` block to your MCP config:
|
|
94
|
-
|
|
95
|
-
```json
|
|
96
|
-
{
|
|
97
|
-
"mcpServers": {
|
|
98
|
-
"onesource": {
|
|
99
|
-
"command": "npx",
|
|
100
|
-
"args": ["-y", "@one-source/mcp@latest"],
|
|
101
|
-
"env": {
|
|
102
|
-
"ONESOURCE_API_KEY": "<key>"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### Any MCP Client (stdio)
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
After adding the key, reload the MCP server (run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor), then call `1s_setup_check`. It should show `Status: Configured (API key)`. You're done — skip to Step 7 to verify a live tool call.
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
### Option B: x402 Micropayments
|
|
120
|
-
|
|
121
|
-
Pay-per-call using USDC on Base. No account required — just an EVM wallet funded with USDC. The server handles payments transparently. Continue with Steps 3B through 6 below.
|
|
122
|
-
|
|
123
|
-
## Step 3B: Get an EVM Private Key
|
|
124
|
-
|
|
125
|
-
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.
|
|
126
|
-
|
|
127
|
-
### Option A: Export from MetaMask
|
|
128
|
-
|
|
129
|
-
1. Open MetaMask
|
|
130
|
-
2. Click the three dots next to the account name
|
|
131
|
-
3. Go to **Account details** > **Show private key**
|
|
132
|
-
4. Enter your MetaMask password
|
|
133
|
-
5. Copy the key
|
|
134
|
-
|
|
135
|
-
### Option B: Export from Coinbase Wallet
|
|
136
|
-
|
|
137
|
-
1. Open Coinbase Wallet > Settings > Developer settings
|
|
138
|
-
2. Export your private key
|
|
139
|
-
|
|
140
|
-
### Option C: Generate a New Wallet
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
# Using OpenSSL (macOS/Linux, or Git Bash on Windows)
|
|
144
|
-
openssl rand -hex 32
|
|
145
|
-
|
|
146
|
-
# Using Foundry (if installed)
|
|
147
|
-
cast wallet new
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
```powershell
|
|
151
|
-
# PowerShell (Windows)
|
|
152
|
-
-join ((1..32) | ForEach-Object { "{0:x2}" -f (Get-Random -Max 256) })
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
**Important:** Use a dedicated wallet for MCP payments — do not use your primary wallet with large holdings. Transfer only what you need.
|
|
156
|
-
|
|
157
|
-
## Step 4: Set the Private Key (x402)
|
|
158
|
-
|
|
159
|
-
### Claude Code
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
claude mcp remove onesource
|
|
163
|
-
claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
> **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).
|
|
167
|
-
|
|
168
|
-
### Claude Desktop / Cursor
|
|
169
|
-
|
|
170
|
-
Add the `env` block to your MCP config:
|
|
171
|
-
|
|
172
|
-
```json
|
|
173
|
-
{
|
|
174
|
-
"mcpServers": {
|
|
175
|
-
"onesource": {
|
|
176
|
-
"command": "npx",
|
|
177
|
-
"args": ["-y", "@one-source/mcp@latest"],
|
|
178
|
-
"env": {
|
|
179
|
-
"X402_PRIVATE_KEY": "0x..."
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Any MCP Client (stdio)
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Manual Setup (Editing the Config File Directly)
|
|
193
|
-
|
|
194
|
-
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.
|
|
195
|
-
|
|
196
|
-
**Claude Code** — Find which file your config is in by running `claude mcp get onesource`. Depending on the scope:
|
|
197
|
-
- **Local:** `.claude/settings.local.json` in your project directory
|
|
198
|
-
- **Project:** `.claude/settings.json` in your project directory
|
|
199
|
-
- **User:** `~/.claude/settings.json` (macOS/Linux) or `%USERPROFILE%\.claude\settings.json` (Windows)
|
|
200
|
-
|
|
201
|
-
**Claude Desktop:**
|
|
202
|
-
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
203
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
204
|
-
|
|
205
|
-
**Cursor:**
|
|
206
|
-
- **macOS:** `~/.cursor/mcp.json`
|
|
207
|
-
- **Windows:** `%USERPROFILE%\.cursor\mcp.json`
|
|
208
|
-
|
|
209
|
-
Open the config file and add (or update) the `onesource` entry inside `"mcpServers"`:
|
|
210
|
-
|
|
211
|
-
```json
|
|
212
|
-
{
|
|
213
|
-
"mcpServers": {
|
|
214
|
-
"onesource": {
|
|
215
|
-
"command": "npx",
|
|
216
|
-
"args": ["-y", "@one-source/mcp@latest"],
|
|
217
|
-
"env": {
|
|
218
|
-
"X402_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY_HERE"
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Save the file, then reload (see below).
|
|
226
|
-
|
|
227
|
-
### Important: Reload After Config Changes
|
|
228
|
-
|
|
229
|
-
Changing the config file (via `claude mcp add` or manual edit) does **not** automatically restart the running MCP server. You must reload:
|
|
230
|
-
|
|
231
|
-
- **Claude Code:** Run `/reload-plugins` (preferred — no restart needed), or restart Claude Code entirely.
|
|
232
|
-
- **Claude Desktop / Cursor:** Restart the app — close it completely and reopen.
|
|
233
|
-
|
|
234
|
-
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.
|
|
235
|
-
|
|
236
|
-
### Alternative: Set the Key as an Environment Variable
|
|
237
|
-
|
|
238
|
-
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:
|
|
239
|
-
|
|
240
|
-
**bash / zsh (macOS / Linux):**
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
export X402_PRIVATE_KEY=0x...
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
To make it persistent, add the line to your `~/.bashrc`, `~/.zshrc`, or `~/.profile`.
|
|
247
|
-
|
|
248
|
-
**PowerShell (Windows):**
|
|
249
|
-
|
|
250
|
-
```powershell
|
|
251
|
-
$env:X402_PRIVATE_KEY = "0x..."
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
This only lasts for the current session. To make it persistent, either:
|
|
255
|
-
- Add it to your PowerShell profile (`notepad $PROFILE`, add the line, restart PowerShell)
|
|
256
|
-
- 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...`
|
|
257
|
-
|
|
258
|
-
After setting the variable, restart your MCP client and run `1s_setup_check` to confirm.
|
|
259
|
-
|
|
260
|
-
> **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"]`.
|
|
261
|
-
|
|
262
|
-
### Security
|
|
263
|
-
|
|
264
|
-
- **Never** commit your private key to source control.
|
|
265
|
-
- Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
266
|
-
- Use a dedicated wallet with minimal funds — only what you need for API calls.
|
|
267
|
-
|
|
268
|
-
## Step 5: Find Your Wallet Address (x402)
|
|
269
|
-
|
|
270
|
-
After setting the key and reloading the MCP server:
|
|
271
|
-
|
|
272
|
-
1. Call `1s_setup_check` — it shows the wallet address derived from your key under "Wallet address". This is the address you need to fund.
|
|
273
|
-
2. Alternatively, import the key into MetaMask to see the address.
|
|
274
|
-
|
|
275
|
-
## Step 6: Fund the Wallet with USDC on Base (x402)
|
|
276
|
-
|
|
277
|
-
The wallet must hold **USDC on the Base network** (not Ethereum mainnet, not other tokens).
|
|
278
|
-
|
|
279
|
-
1. Send USDC to the wallet address from Step 5 **on the Base network**.
|
|
280
|
-
2. A few dollars ($1–5 USDC) is enough for hundreds of API calls.
|
|
281
|
-
|
|
282
|
-
If your USDC is on Ethereum mainnet, bridge it to Base using the [Base Bridge](https://bridge.base.org) or any cross-chain bridge that supports Base.
|
|
283
|
-
|
|
284
|
-
## Step 7: Verify
|
|
285
|
-
|
|
286
|
-
After setting your auth (either option) and reloading:
|
|
287
|
-
|
|
288
|
-
1. **Check MCP connection** — Run `/mcp` to confirm the `onesource` server is connected.
|
|
289
|
-
2. **Run `1s_setup_check`** — You should see:
|
|
290
|
-
- **Authentication:** `Configured (API key)` or `Configured (x402)` — not "Not configured"
|
|
291
|
-
- **Wallet address:** Your wallet address (x402 only)
|
|
292
|
-
- **API backend:** Reachable
|
|
293
|
-
3. **Test a live tool** — Call `1s_network_info` for ethereum. If it returns a block number and gas price, auth is working end-to-end.
|
|
294
|
-
|
|
295
|
-
> **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.
|
|
296
|
-
|
|
297
|
-
## Troubleshooting
|
|
298
|
-
|
|
299
|
-
| Problem | Solution |
|
|
300
|
-
|---------|----------|
|
|
301
|
-
| `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. |
|
|
302
|
-
| `1s_setup_check` shows API key configured but tools return 402 | The key may be invalid or the account may not have a developer plan. Verify the key at app.onesource.io. |
|
|
303
|
-
| "MCP server onesource already exists" error | Run `claude mcp remove onesource` first, then re-add it with your updated config. |
|
|
304
|
-
| Config changed but nothing happened | Run `/reload-plugins` in Claude Code to reload MCP servers, then `/mcp` to check connection status. |
|
|
305
|
-
| Tool returns HTTP 402 error (x402 path) | x402 is not configured, or the wallet has insufficient USDC on Base. Check `1s_setup_check` for wallet address and balance. |
|
|
306
|
-
| "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). |
|
|
307
|
-
| Key is set but wallet shows 0 USDC | Make sure USDC is on the **Base** network, not Ethereum mainnet or another chain. |
|
|
308
|
-
| Tools work but results seem stale | Check `1s_setup_check` for version — you may need to update to the latest. |
|
|
1
|
+
---
|
|
2
|
+
name: onesource-mcp-setup
|
|
3
|
+
description: >-
|
|
4
|
+
Guide for installing and configuring the OneSource MCP server. Covers both
|
|
5
|
+
authentication options (API key and x402 micropayments), wallet setup, USDC
|
|
6
|
+
funding on Base, and verification. Use when a user needs help setting up
|
|
7
|
+
OneSource MCP or configuring either auth method.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# OneSource MCP Setup Guide
|
|
11
|
+
|
|
12
|
+
OneSource MCP provides 27 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`). If both are set, API key takes priority.
|
|
13
|
+
|
|
14
|
+
## Before You Start
|
|
15
|
+
|
|
16
|
+
**Always call `1s_setup_check` before using any other OneSource tools.** This checks the installed version against the latest release and reports authentication status.
|
|
17
|
+
|
|
18
|
+
- **If an update is available:** Tell the user and help them update before proceeding. Run `npx -y @one-source/mcp@latest` to get the latest version. The update takes effect on the next session — the user will need to restart their MCP client.
|
|
19
|
+
- **If `1s_setup_check` is not available:** The MCP is either not installed or running a version before this tool existed. Help the user install or update using the instructions in Step 2 below.
|
|
20
|
+
- **If auth is not configured:** The tool will include setup instructions. Walk the user through them before attempting API calls.
|
|
21
|
+
|
|
22
|
+
Do not skip this step — outdated versions may be missing tools, fixes, or protocol changes.
|
|
23
|
+
|
|
24
|
+
## Step 1: Check Current Installation
|
|
25
|
+
|
|
26
|
+
Call the `1s_setup_check` tool. It reports:
|
|
27
|
+
- Server version (current vs latest)
|
|
28
|
+
- Which auth method is active (API key, x402), or whether auth is not yet configured
|
|
29
|
+
- Wallet address (if x402 is configured)
|
|
30
|
+
- API backend connectivity
|
|
31
|
+
|
|
32
|
+
If the tool is not available, the MCP is not installed — go to Step 2.
|
|
33
|
+
|
|
34
|
+
## Step 2: Install or Update
|
|
35
|
+
|
|
36
|
+
### Claude Code
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
claude mcp add onesource -- npx -y @one-source/mcp@latest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Claude Desktop / Cursor
|
|
43
|
+
|
|
44
|
+
Add to your MCP configuration file:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"onesource": {
|
|
50
|
+
"command": "npx",
|
|
51
|
+
"args": ["-y", "@one-source/mcp@latest"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Any MCP Client (stdio)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx -y @one-source/mcp@latest
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Check for Updates
|
|
64
|
+
|
|
65
|
+
Compare the installed version (shown in `1s_setup_check` output) against the latest:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm view @one-source/mcp version
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
To update, reinstall with `@latest` or clear the npx cache: `npx -y @one-source/mcp@latest`.
|
|
72
|
+
|
|
73
|
+
## Step 3: Configure Authentication
|
|
74
|
+
|
|
75
|
+
Choose one option. If both are set, API key takes priority.
|
|
76
|
+
|
|
77
|
+
### Option A: API Key
|
|
78
|
+
|
|
79
|
+
1. Go to [app.onesource.io](https://app.onesource.io) and create an account.
|
|
80
|
+
2. Subscribe to a developer plan (Stripe checkout).
|
|
81
|
+
3. Navigate to **API Keys** and generate a key.
|
|
82
|
+
4. Copy the key — it starts with `sk_`.
|
|
83
|
+
|
|
84
|
+
#### Claude Code
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
claude mcp remove onesource
|
|
88
|
+
claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Claude Desktop / Cursor
|
|
92
|
+
|
|
93
|
+
Add the `env` block to your MCP config:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"onesource": {
|
|
99
|
+
"command": "npx",
|
|
100
|
+
"args": ["-y", "@one-source/mcp@latest"],
|
|
101
|
+
"env": {
|
|
102
|
+
"ONESOURCE_API_KEY": "<key>"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Any MCP Client (stdio)
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
After adding the key, reload the MCP server (run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor), then call `1s_setup_check`. It should show `Status: Configured (API key)`. You're done — skip to Step 7 to verify a live tool call.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### Option B: x402 Micropayments
|
|
120
|
+
|
|
121
|
+
Pay-per-call using USDC on Base. No account required — just an EVM wallet funded with USDC. The server handles payments transparently. Continue with Steps 3B through 6 below.
|
|
122
|
+
|
|
123
|
+
## Step 3B: Get an EVM Private Key
|
|
124
|
+
|
|
125
|
+
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.
|
|
126
|
+
|
|
127
|
+
### Option A: Export from MetaMask
|
|
128
|
+
|
|
129
|
+
1. Open MetaMask
|
|
130
|
+
2. Click the three dots next to the account name
|
|
131
|
+
3. Go to **Account details** > **Show private key**
|
|
132
|
+
4. Enter your MetaMask password
|
|
133
|
+
5. Copy the key
|
|
134
|
+
|
|
135
|
+
### Option B: Export from Coinbase Wallet
|
|
136
|
+
|
|
137
|
+
1. Open Coinbase Wallet > Settings > Developer settings
|
|
138
|
+
2. Export your private key
|
|
139
|
+
|
|
140
|
+
### Option C: Generate a New Wallet
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Using OpenSSL (macOS/Linux, or Git Bash on Windows)
|
|
144
|
+
openssl rand -hex 32
|
|
145
|
+
|
|
146
|
+
# Using Foundry (if installed)
|
|
147
|
+
cast wallet new
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```powershell
|
|
151
|
+
# PowerShell (Windows)
|
|
152
|
+
-join ((1..32) | ForEach-Object { "{0:x2}" -f (Get-Random -Max 256) })
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Important:** Use a dedicated wallet for MCP payments — do not use your primary wallet with large holdings. Transfer only what you need.
|
|
156
|
+
|
|
157
|
+
## Step 4: Set the Private Key (x402)
|
|
158
|
+
|
|
159
|
+
### Claude Code
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
claude mcp remove onesource
|
|
163
|
+
claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
> **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).
|
|
167
|
+
|
|
168
|
+
### Claude Desktop / Cursor
|
|
169
|
+
|
|
170
|
+
Add the `env` block to your MCP config:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"mcpServers": {
|
|
175
|
+
"onesource": {
|
|
176
|
+
"command": "npx",
|
|
177
|
+
"args": ["-y", "@one-source/mcp@latest"],
|
|
178
|
+
"env": {
|
|
179
|
+
"X402_PRIVATE_KEY": "0x..."
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Any MCP Client (stdio)
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Manual Setup (Editing the Config File Directly)
|
|
193
|
+
|
|
194
|
+
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.
|
|
195
|
+
|
|
196
|
+
**Claude Code** — Find which file your config is in by running `claude mcp get onesource`. Depending on the scope:
|
|
197
|
+
- **Local:** `.claude/settings.local.json` in your project directory
|
|
198
|
+
- **Project:** `.claude/settings.json` in your project directory
|
|
199
|
+
- **User:** `~/.claude/settings.json` (macOS/Linux) or `%USERPROFILE%\.claude\settings.json` (Windows)
|
|
200
|
+
|
|
201
|
+
**Claude Desktop:**
|
|
202
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
203
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
204
|
+
|
|
205
|
+
**Cursor:**
|
|
206
|
+
- **macOS:** `~/.cursor/mcp.json`
|
|
207
|
+
- **Windows:** `%USERPROFILE%\.cursor\mcp.json`
|
|
208
|
+
|
|
209
|
+
Open the config file and add (or update) the `onesource` entry inside `"mcpServers"`:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"mcpServers": {
|
|
214
|
+
"onesource": {
|
|
215
|
+
"command": "npx",
|
|
216
|
+
"args": ["-y", "@one-source/mcp@latest"],
|
|
217
|
+
"env": {
|
|
218
|
+
"X402_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY_HERE"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Save the file, then reload (see below).
|
|
226
|
+
|
|
227
|
+
### Important: Reload After Config Changes
|
|
228
|
+
|
|
229
|
+
Changing the config file (via `claude mcp add` or manual edit) does **not** automatically restart the running MCP server. You must reload:
|
|
230
|
+
|
|
231
|
+
- **Claude Code:** Run `/reload-plugins` (preferred — no restart needed), or restart Claude Code entirely.
|
|
232
|
+
- **Claude Desktop / Cursor:** Restart the app — close it completely and reopen.
|
|
233
|
+
|
|
234
|
+
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.
|
|
235
|
+
|
|
236
|
+
### Alternative: Set the Key as an Environment Variable
|
|
237
|
+
|
|
238
|
+
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:
|
|
239
|
+
|
|
240
|
+
**bash / zsh (macOS / Linux):**
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
export X402_PRIVATE_KEY=0x...
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
To make it persistent, add the line to your `~/.bashrc`, `~/.zshrc`, or `~/.profile`.
|
|
247
|
+
|
|
248
|
+
**PowerShell (Windows):**
|
|
249
|
+
|
|
250
|
+
```powershell
|
|
251
|
+
$env:X402_PRIVATE_KEY = "0x..."
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
This only lasts for the current session. To make it persistent, either:
|
|
255
|
+
- Add it to your PowerShell profile (`notepad $PROFILE`, add the line, restart PowerShell)
|
|
256
|
+
- 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...`
|
|
257
|
+
|
|
258
|
+
After setting the variable, restart your MCP client and run `1s_setup_check` to confirm.
|
|
259
|
+
|
|
260
|
+
> **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"]`.
|
|
261
|
+
|
|
262
|
+
### Security
|
|
263
|
+
|
|
264
|
+
- **Never** commit your private key to source control.
|
|
265
|
+
- Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
266
|
+
- Use a dedicated wallet with minimal funds — only what you need for API calls.
|
|
267
|
+
|
|
268
|
+
## Step 5: Find Your Wallet Address (x402)
|
|
269
|
+
|
|
270
|
+
After setting the key and reloading the MCP server:
|
|
271
|
+
|
|
272
|
+
1. Call `1s_setup_check` — it shows the wallet address derived from your key under "Wallet address". This is the address you need to fund.
|
|
273
|
+
2. Alternatively, import the key into MetaMask to see the address.
|
|
274
|
+
|
|
275
|
+
## Step 6: Fund the Wallet with USDC on Base (x402)
|
|
276
|
+
|
|
277
|
+
The wallet must hold **USDC on the Base network** (not Ethereum mainnet, not other tokens).
|
|
278
|
+
|
|
279
|
+
1. Send USDC to the wallet address from Step 5 **on the Base network**.
|
|
280
|
+
2. A few dollars ($1–5 USDC) is enough for hundreds of API calls.
|
|
281
|
+
|
|
282
|
+
If your USDC is on Ethereum mainnet, bridge it to Base using the [Base Bridge](https://bridge.base.org) or any cross-chain bridge that supports Base.
|
|
283
|
+
|
|
284
|
+
## Step 7: Verify
|
|
285
|
+
|
|
286
|
+
After setting your auth (either option) and reloading:
|
|
287
|
+
|
|
288
|
+
1. **Check MCP connection** — Run `/mcp` to confirm the `onesource` server is connected.
|
|
289
|
+
2. **Run `1s_setup_check`** — You should see:
|
|
290
|
+
- **Authentication:** `Configured (API key)` or `Configured (x402)` — not "Not configured"
|
|
291
|
+
- **Wallet address:** Your wallet address (x402 only)
|
|
292
|
+
- **API backend:** Reachable
|
|
293
|
+
3. **Test a live tool** — Call `1s_network_info` for ethereum. If it returns a block number and gas price, auth is working end-to-end.
|
|
294
|
+
|
|
295
|
+
> **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.
|
|
296
|
+
|
|
297
|
+
## Troubleshooting
|
|
298
|
+
|
|
299
|
+
| Problem | Solution |
|
|
300
|
+
|---------|----------|
|
|
301
|
+
| `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. |
|
|
302
|
+
| `1s_setup_check` shows API key configured but tools return 402 | The key may be invalid or the account may not have a developer plan. Verify the key at app.onesource.io. |
|
|
303
|
+
| "MCP server onesource already exists" error | Run `claude mcp remove onesource` first, then re-add it with your updated config. |
|
|
304
|
+
| Config changed but nothing happened | Run `/reload-plugins` in Claude Code to reload MCP servers, then `/mcp` to check connection status. |
|
|
305
|
+
| Tool returns HTTP 402 error (x402 path) | x402 is not configured, or the wallet has insufficient USDC on Base. Check `1s_setup_check` for wallet address and balance. |
|
|
306
|
+
| "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). |
|
|
307
|
+
| Key is set but wallet shows 0 USDC | Make sure USDC is on the **Base** network, not Ethereum mainnet or another chain. |
|
|
308
|
+
| Tools work but results seem stale | Check `1s_setup_check` for version — you may need to update to the latest. |
|