@one-source/mcp 4.0.3 → 4.0.4
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.md +55 -4
- package/README.npm.md +55 -4
- package/README.repo.md +34 -4
- package/dist/analytics.d.ts +1 -1
- package/dist/analytics.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +12 -2
- package/dist/cli.js.map +1 -1
- package/dist/create-server.d.ts +4 -2
- package/dist/create-server.d.ts.map +1 -1
- package/dist/create-server.js +10 -3
- package/dist/create-server.js.map +1 -1
- package/dist/register-bug-report-tool.d.ts +21 -0
- package/dist/register-bug-report-tool.d.ts.map +1 -0
- package/dist/register-bug-report-tool.js +113 -0
- package/dist/register-bug-report-tool.js.map +1 -0
- package/dist/register-docs-tools.d.ts.map +1 -1
- package/dist/register-docs-tools.js +65 -55
- package/dist/register-docs-tools.js.map +1 -1
- package/package.json +2 -2
- package/skills/onesource-mcp-setup/SKILL.md +108 -21
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @one-source/mcp
|
|
2
2
|
|
|
3
|
-
Unified MCP server for [OneSource](https://docs.onesource.io) —
|
|
3
|
+
Unified MCP server for [OneSource](https://docs.onesource.io) — 34 tools for blockchain data, live chain queries, and API documentation in a single server.
|
|
4
4
|
|
|
5
5
|
Combines [`@one-source/api-mcp`](https://www.npmjs.com/package/@one-source/api-mcp) (22 tools) and [`@one-source/docs-mcp`](https://www.npmjs.com/package/@one-source/docs-mcp) (11 tools) so your AI assistant gets full access to OneSource with one MCP connection.
|
|
6
6
|
|
|
@@ -44,7 +44,9 @@ npx -y @one-source/mcp@latest --http --port=8080
|
|
|
44
44
|
|
|
45
45
|
Then connect your MCP client to `http://localhost:3000/`.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Health check: `GET http://localhost:3000/health`
|
|
48
|
+
|
|
49
|
+
## Tools (34)
|
|
48
50
|
|
|
49
51
|
### Blockchain API — Live Chain (12 tools)
|
|
50
52
|
|
|
@@ -65,6 +67,8 @@ Then connect your MCP client to `http://localhost:3000/`.
|
|
|
65
67
|
|
|
66
68
|
### Blockchain API — Chain Utilities (10 tools)
|
|
67
69
|
|
|
70
|
+
RPC only.
|
|
71
|
+
|
|
68
72
|
| Tool | Description |
|
|
69
73
|
|------|-------------|
|
|
70
74
|
| `1s_contract_code` | Contract bytecode |
|
|
@@ -78,13 +82,14 @@ Then connect your MCP client to `http://localhost:3000/`.
|
|
|
78
82
|
| `1s_storage_read` | Read storage slot |
|
|
79
83
|
| `1s_tx_receipt` | Transaction receipt |
|
|
80
84
|
|
|
81
|
-
### Documentation &
|
|
85
|
+
### Documentation, Setup & Ops (12 tools)
|
|
82
86
|
|
|
83
87
|
Read-only, no API key required.
|
|
84
88
|
|
|
85
89
|
| Tool | Purpose | When to use |
|
|
86
90
|
|------|---------|-------------|
|
|
87
91
|
| `1s_setup_check` | Server health, version, x402 status, setup instructions | First thing to call — checks if everything is configured |
|
|
92
|
+
| `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
|
|
88
93
|
| `search_docs` | Keyword search across all documentation | Finding guides, concepts, or API patterns |
|
|
89
94
|
| `get_query_reference` | Full reference for a root GraphQL query | Building a specific query with correct args/filters |
|
|
90
95
|
| `get_type_definition` | Schema definition for any type/enum/input | Understanding field shapes and return types |
|
|
@@ -114,7 +119,7 @@ Documentation tools are always free — no key or payment needed.
|
|
|
114
119
|
|
|
115
120
|
### Setup
|
|
116
121
|
|
|
117
|
-
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key
|
|
122
|
+
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key must start with `0x` followed by 64 hex characters (e.g. `0x4c08...7e3d`). Some wallets export the key without the `0x` prefix — if yours is just letters and numbers without `0x` at the start, add `0x` to the beginning yourself.
|
|
118
123
|
2. **Fund the wallet with USDC on Base** — the wallet address derived from the key must hold USDC on the [Base](https://base.org) network. Bridge or transfer USDC to it.
|
|
119
124
|
3. **Pass the key to the server** using one of the methods below.
|
|
120
125
|
|
|
@@ -148,10 +153,56 @@ Add the `env` block to your MCP config:
|
|
|
148
153
|
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
149
154
|
```
|
|
150
155
|
|
|
156
|
+
### Config File Locations
|
|
157
|
+
|
|
158
|
+
If you prefer editing the config file directly instead of using CLI commands:
|
|
159
|
+
|
|
160
|
+
| Client | Config file path |
|
|
161
|
+
|--------|-----------------|
|
|
162
|
+
| Claude Code | Run `claude mcp get onesource` to see the file path |
|
|
163
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
164
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
165
|
+
| Cursor (macOS) | `~/.cursor/mcp.json` |
|
|
166
|
+
| Cursor (Windows) | `%USERPROFILE%\.cursor\mcp.json` |
|
|
167
|
+
|
|
168
|
+
Add the `onesource` entry inside `"mcpServers"` using the JSON block shown above.
|
|
169
|
+
|
|
170
|
+
### Alternative: Set as an Environment Variable
|
|
171
|
+
|
|
172
|
+
Instead of the `env` config block, you can set `X402_PRIVATE_KEY` as a shell or system environment variable: `export X402_PRIVATE_KEY=0x...` (bash/zsh) or `$env:X402_PRIVATE_KEY = "0x..."` (PowerShell). Set it at the OS level for persistence across sessions.
|
|
173
|
+
|
|
151
174
|
### Security
|
|
152
175
|
|
|
153
176
|
Never commit your private key to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
154
177
|
|
|
178
|
+
> **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.
|
|
179
|
+
|
|
180
|
+
## Environment Variables
|
|
181
|
+
|
|
182
|
+
| Variable | Default | Description |
|
|
183
|
+
|----------|---------|-------------|
|
|
184
|
+
| `X402_PRIVATE_KEY` | — | EVM private key (hex, 0x-prefixed) for automatic x402 USDC payments on Base |
|
|
185
|
+
| `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | API base URL |
|
|
186
|
+
| `ONESOURCE_ANALYTICS` | — | Set to `false` to disable analytics |
|
|
187
|
+
|
|
188
|
+
## Troubleshooting
|
|
189
|
+
|
|
190
|
+
**`1s_setup_check` shows "Not configured"** — Reload the MCP server first (see note above). If the key still isn't reaching the server after reloading, set it as an environment variable directly.
|
|
191
|
+
|
|
192
|
+
**"MCP server onesource already exists" error** — Run `claude mcp remove onesource` first, then re-add.
|
|
193
|
+
|
|
194
|
+
**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.
|
|
195
|
+
|
|
196
|
+
**`npx` hangs with no output** — That's normal in stdio mode. Use `--http` for an HTTP server.
|
|
197
|
+
|
|
198
|
+
**Port already in use** — Specify a different port: `npx -y @one-source/mcp@latest --http --port=8080`
|
|
199
|
+
|
|
200
|
+
## Links
|
|
201
|
+
|
|
202
|
+
- [GitHub Repository](https://github.com/blockparty-global/1s-mcp)
|
|
203
|
+
- [OneSource Documentation](https://docs.onesource.io)
|
|
204
|
+
- [Report an Issue](https://github.com/blockparty-global/1s-mcp/issues)
|
|
205
|
+
|
|
155
206
|
## License
|
|
156
207
|
|
|
157
208
|
Apache 2.0
|
package/README.npm.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @one-source/mcp
|
|
2
2
|
|
|
3
|
-
Unified MCP server for [OneSource](https://docs.onesource.io) —
|
|
3
|
+
Unified MCP server for [OneSource](https://docs.onesource.io) — 34 tools for blockchain data, live chain queries, and API documentation in a single server.
|
|
4
4
|
|
|
5
5
|
Combines [`@one-source/api-mcp`](https://www.npmjs.com/package/@one-source/api-mcp) (22 tools) and [`@one-source/docs-mcp`](https://www.npmjs.com/package/@one-source/docs-mcp) (11 tools) so your AI assistant gets full access to OneSource with one MCP connection.
|
|
6
6
|
|
|
@@ -44,7 +44,9 @@ npx -y @one-source/mcp@latest --http --port=8080
|
|
|
44
44
|
|
|
45
45
|
Then connect your MCP client to `http://localhost:3000/`.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Health check: `GET http://localhost:3000/health`
|
|
48
|
+
|
|
49
|
+
## Tools (34)
|
|
48
50
|
|
|
49
51
|
### Blockchain API — Live Chain (12 tools)
|
|
50
52
|
|
|
@@ -65,6 +67,8 @@ Then connect your MCP client to `http://localhost:3000/`.
|
|
|
65
67
|
|
|
66
68
|
### Blockchain API — Chain Utilities (10 tools)
|
|
67
69
|
|
|
70
|
+
RPC only.
|
|
71
|
+
|
|
68
72
|
| Tool | Description |
|
|
69
73
|
|------|-------------|
|
|
70
74
|
| `1s_contract_code` | Contract bytecode |
|
|
@@ -78,13 +82,14 @@ Then connect your MCP client to `http://localhost:3000/`.
|
|
|
78
82
|
| `1s_storage_read` | Read storage slot |
|
|
79
83
|
| `1s_tx_receipt` | Transaction receipt |
|
|
80
84
|
|
|
81
|
-
### Documentation &
|
|
85
|
+
### Documentation, Setup & Ops (12 tools)
|
|
82
86
|
|
|
83
87
|
Read-only, no API key required.
|
|
84
88
|
|
|
85
89
|
| Tool | Purpose | When to use |
|
|
86
90
|
|------|---------|-------------|
|
|
87
91
|
| `1s_setup_check` | Server health, version, x402 status, setup instructions | First thing to call — checks if everything is configured |
|
|
92
|
+
| `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
|
|
88
93
|
| `search_docs` | Keyword search across all documentation | Finding guides, concepts, or API patterns |
|
|
89
94
|
| `get_query_reference` | Full reference for a root GraphQL query | Building a specific query with correct args/filters |
|
|
90
95
|
| `get_type_definition` | Schema definition for any type/enum/input | Understanding field shapes and return types |
|
|
@@ -114,7 +119,7 @@ Documentation tools are always free — no key or payment needed.
|
|
|
114
119
|
|
|
115
120
|
### Setup
|
|
116
121
|
|
|
117
|
-
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key
|
|
122
|
+
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key must start with `0x` followed by 64 hex characters (e.g. `0x4c08...7e3d`). Some wallets export the key without the `0x` prefix — if yours is just letters and numbers without `0x` at the start, add `0x` to the beginning yourself.
|
|
118
123
|
2. **Fund the wallet with USDC on Base** — the wallet address derived from the key must hold USDC on the [Base](https://base.org) network. Bridge or transfer USDC to it.
|
|
119
124
|
3. **Pass the key to the server** using one of the methods below.
|
|
120
125
|
|
|
@@ -148,10 +153,56 @@ Add the `env` block to your MCP config:
|
|
|
148
153
|
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
149
154
|
```
|
|
150
155
|
|
|
156
|
+
### Config File Locations
|
|
157
|
+
|
|
158
|
+
If you prefer editing the config file directly instead of using CLI commands:
|
|
159
|
+
|
|
160
|
+
| Client | Config file path |
|
|
161
|
+
|--------|-----------------|
|
|
162
|
+
| Claude Code | Run `claude mcp get onesource` to see the file path |
|
|
163
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
164
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
165
|
+
| Cursor (macOS) | `~/.cursor/mcp.json` |
|
|
166
|
+
| Cursor (Windows) | `%USERPROFILE%\.cursor\mcp.json` |
|
|
167
|
+
|
|
168
|
+
Add the `onesource` entry inside `"mcpServers"` using the JSON block shown above.
|
|
169
|
+
|
|
170
|
+
### Alternative: Set as an Environment Variable
|
|
171
|
+
|
|
172
|
+
Instead of the `env` config block, you can set `X402_PRIVATE_KEY` as a shell or system environment variable: `export X402_PRIVATE_KEY=0x...` (bash/zsh) or `$env:X402_PRIVATE_KEY = "0x..."` (PowerShell). Set it at the OS level for persistence across sessions.
|
|
173
|
+
|
|
151
174
|
### Security
|
|
152
175
|
|
|
153
176
|
Never commit your private key to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
154
177
|
|
|
178
|
+
> **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.
|
|
179
|
+
|
|
180
|
+
## Environment Variables
|
|
181
|
+
|
|
182
|
+
| Variable | Default | Description |
|
|
183
|
+
|----------|---------|-------------|
|
|
184
|
+
| `X402_PRIVATE_KEY` | — | EVM private key (hex, 0x-prefixed) for automatic x402 USDC payments on Base |
|
|
185
|
+
| `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | API base URL |
|
|
186
|
+
| `ONESOURCE_ANALYTICS` | — | Set to `false` to disable analytics |
|
|
187
|
+
|
|
188
|
+
## Troubleshooting
|
|
189
|
+
|
|
190
|
+
**`1s_setup_check` shows "Not configured"** — Reload the MCP server first (see note above). If the key still isn't reaching the server after reloading, set it as an environment variable directly.
|
|
191
|
+
|
|
192
|
+
**"MCP server onesource already exists" error** — Run `claude mcp remove onesource` first, then re-add.
|
|
193
|
+
|
|
194
|
+
**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.
|
|
195
|
+
|
|
196
|
+
**`npx` hangs with no output** — That's normal in stdio mode. Use `--http` for an HTTP server.
|
|
197
|
+
|
|
198
|
+
**Port already in use** — Specify a different port: `npx -y @one-source/mcp@latest --http --port=8080`
|
|
199
|
+
|
|
200
|
+
## Links
|
|
201
|
+
|
|
202
|
+
- [GitHub Repository](https://github.com/blockparty-global/1s-mcp)
|
|
203
|
+
- [OneSource Documentation](https://docs.onesource.io)
|
|
204
|
+
- [Report an Issue](https://github.com/blockparty-global/1s-mcp/issues)
|
|
205
|
+
|
|
155
206
|
## License
|
|
156
207
|
|
|
157
208
|
Apache 2.0
|
package/README.repo.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @one-source/mcp
|
|
2
2
|
|
|
3
|
-
Unified MCP server for [OneSource](https://docs.onesource.io) —
|
|
3
|
+
Unified MCP server for [OneSource](https://docs.onesource.io) — 34 tools for blockchain data, live chain queries, and API documentation in a single server.
|
|
4
4
|
|
|
5
5
|
Combines [`@one-source/api-mcp`](https://www.npmjs.com/package/@one-source/api-mcp) (22 tools) and [`@one-source/docs-mcp`](https://www.npmjs.com/package/@one-source/docs-mcp) (11 tools) so your AI assistant gets full access to OneSource with one MCP connection.
|
|
6
6
|
|
|
@@ -46,7 +46,7 @@ Then connect your MCP client to `http://localhost:3000/`.
|
|
|
46
46
|
|
|
47
47
|
Health check: `GET http://localhost:3000/health`
|
|
48
48
|
|
|
49
|
-
## Tools (
|
|
49
|
+
## Tools (34)
|
|
50
50
|
|
|
51
51
|
### Blockchain API — Live Chain (12 tools)
|
|
52
52
|
|
|
@@ -82,13 +82,14 @@ RPC only.
|
|
|
82
82
|
| `1s_storage_read` | Read storage slot |
|
|
83
83
|
| `1s_tx_receipt` | Transaction receipt |
|
|
84
84
|
|
|
85
|
-
### Documentation &
|
|
85
|
+
### Documentation, Setup & Ops (12 tools)
|
|
86
86
|
|
|
87
87
|
Read-only, no API key required.
|
|
88
88
|
|
|
89
89
|
| Tool | Purpose | When to use |
|
|
90
90
|
|------|---------|-------------|
|
|
91
91
|
| `1s_setup_check` | Server health, version, x402 status, setup instructions | First thing to call — checks if everything is configured |
|
|
92
|
+
| `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
|
|
92
93
|
| `search_docs` | Keyword search across all documentation | Finding guides, concepts, or API patterns |
|
|
93
94
|
| `get_query_reference` | Full reference for a root GraphQL query | Building a specific query with correct args/filters |
|
|
94
95
|
| `get_type_definition` | Schema definition for any type/enum/input | Understanding field shapes and return types |
|
|
@@ -118,7 +119,7 @@ Documentation tools are always free — no key or payment needed.
|
|
|
118
119
|
|
|
119
120
|
### Setup
|
|
120
121
|
|
|
121
|
-
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key
|
|
122
|
+
1. **Get an EVM private key** — export one from MetaMask, Coinbase Wallet, or any EVM wallet. The key must start with `0x` followed by 64 hex characters (e.g. `0x4c08...7e3d`). Some wallets export the key without the `0x` prefix — if yours is just letters and numbers without `0x` at the start, add `0x` to the beginning yourself.
|
|
122
123
|
2. **Fund the wallet with USDC on Base** — the wallet address derived from the key must hold USDC on the [Base](https://base.org) network. Bridge or transfer USDC to it.
|
|
123
124
|
3. **Pass the key to the server** using one of the methods below.
|
|
124
125
|
|
|
@@ -152,10 +153,30 @@ Add the `env` block to your MCP config:
|
|
|
152
153
|
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
153
154
|
```
|
|
154
155
|
|
|
156
|
+
### Config File Locations
|
|
157
|
+
|
|
158
|
+
If you prefer editing the config file directly instead of using CLI commands:
|
|
159
|
+
|
|
160
|
+
| Client | Config file path |
|
|
161
|
+
|--------|-----------------|
|
|
162
|
+
| Claude Code | Run `claude mcp get onesource` to see the file path |
|
|
163
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
164
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
165
|
+
| Cursor (macOS) | `~/.cursor/mcp.json` |
|
|
166
|
+
| Cursor (Windows) | `%USERPROFILE%\.cursor\mcp.json` |
|
|
167
|
+
|
|
168
|
+
Add the `onesource` entry inside `"mcpServers"` using the JSON block shown above.
|
|
169
|
+
|
|
170
|
+
### Alternative: Set as an Environment Variable
|
|
171
|
+
|
|
172
|
+
Instead of the `env` config block, you can set `X402_PRIVATE_KEY` as a shell or system environment variable: `export X402_PRIVATE_KEY=0x...` (bash/zsh) or `$env:X402_PRIVATE_KEY = "0x..."` (PowerShell). Set it at the OS level for persistence across sessions.
|
|
173
|
+
|
|
155
174
|
### Security
|
|
156
175
|
|
|
157
176
|
Never commit your private key to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
158
177
|
|
|
178
|
+
> **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.
|
|
179
|
+
|
|
159
180
|
## Environment Variables
|
|
160
181
|
|
|
161
182
|
| Variable | Default | Description |
|
|
@@ -168,6 +189,15 @@ Never commit your private key to source control. Use environment variables, a `.
|
|
|
168
189
|
|
|
169
190
|
## Troubleshooting
|
|
170
191
|
|
|
192
|
+
**`1s_setup_check` shows "Not configured"**
|
|
193
|
+
Reload the MCP server first (see note above). If the key still isn't reaching the server after reloading, set it as an environment variable directly.
|
|
194
|
+
|
|
195
|
+
**"MCP server onesource already exists" error**
|
|
196
|
+
Run `claude mcp remove onesource` first, then re-add with your updated config.
|
|
197
|
+
|
|
198
|
+
**Windows: `npx` requires `cmd /c` wrapper**
|
|
199
|
+
Claude Code's `/doctor` command may warn about this. Update your MCP config to use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@one-source/mcp@latest"]`.
|
|
200
|
+
|
|
171
201
|
**`npx` hangs with no output**
|
|
172
202
|
That's normal — stdio mode waits for JSON-RPC input on stdin. Use `--http` if you want an HTTP server you can curl.
|
|
173
203
|
|
package/dist/analytics.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { type Analytics as _Analytics, type ToolCallEvent as _ToolCallEvent, type HttpCallEvent as _HttpCallEvent, type ServiceEvent as _ServiceEvent } from '@one-source/api-mcp/analytics';
|
|
10
10
|
/** ToolCallEvent with category widened to include docs tools. */
|
|
11
11
|
export type ToolCallEvent = Omit<_ToolCallEvent, 'category'> & {
|
|
12
|
-
category: _ToolCallEvent['category'] | 'docs';
|
|
12
|
+
category: _ToolCallEvent['category'] | 'docs' | 'ops';
|
|
13
13
|
source?: string;
|
|
14
14
|
};
|
|
15
15
|
export type HttpCallEvent = _HttpCallEvent & {
|
package/dist/analytics.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,aAAa,IAAI,cAAc,EACpC,KAAK,aAAa,IAAI,cAAc,EACpC,KAAK,YAAY,IAAI,aAAa,EACnC,MAAM,+BAA+B,CAAC;AAEvC,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IAC7D,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,aAAa,IAAI,cAAc,EACpC,KAAK,aAAa,IAAI,cAAc,EACpC,KAAK,YAAY,IAAI,aAAa,EACnC,MAAM,+BAA+B,CAAC;AAEvC,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IAC7D,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,0EAA0E;AAC1E,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAC;IAC7F,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;CACzC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,SAAS,CAK3C"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AA8TH,OAAO,EAAE,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -26,11 +26,13 @@ async function checkLatestVersion() {
|
|
|
26
26
|
/** Build the MCP instructions string based on version comparison. */
|
|
27
27
|
function buildInstructions(currentVersion, latestVersion) {
|
|
28
28
|
const baseline = [
|
|
29
|
-
'OneSource MCP —
|
|
29
|
+
'OneSource MCP — 34 tools for blockchain data and API documentation.',
|
|
30
30
|
'',
|
|
31
31
|
'Blockchain API tools require x402 payment (USDC on Base). If a tool returns a 402 error, the user needs to configure X402_PRIVATE_KEY. Call 1s_setup_check for diagnostics and setup instructions.',
|
|
32
32
|
'',
|
|
33
33
|
'Documentation tools (search_docs, get_query_reference, etc.) are always free.',
|
|
34
|
+
'',
|
|
35
|
+
'Bug Reporting: When any blockchain API tool (1s_* prefix) returns an error, automatically call 1s_report_bug with the tool_name, error_message, and a brief description of what was attempted. Set severity based on the error: "critical" for server crashes or data loss, "high" for broken features, "medium" for degraded functionality, "low" for cosmetic issues. Do NOT auto-report x402 payment errors (HTTP 402) — those mean the user needs to configure X402_PRIVATE_KEY, not that there is a bug. Do not report the same error more than once per conversation. Also call 1s_report_bug when the user explicitly asks to report a bug or issue.',
|
|
34
36
|
].join('\n');
|
|
35
37
|
if (latestVersion && latestVersion !== currentVersion) {
|
|
36
38
|
return [
|
|
@@ -87,6 +89,8 @@ if (args.includes('--http')) {
|
|
|
87
89
|
catch (err) {
|
|
88
90
|
console.error(`[onesource] x402 setup failed, continuing without payments: ${err instanceof Error ? err.message : err}`);
|
|
89
91
|
}
|
|
92
|
+
// Bug report endpoint (silent override for dev/testing)
|
|
93
|
+
const bugReportUrl = process.env.ONESOURCE_BUG_REPORT_URL;
|
|
90
94
|
// Pre-load docs data once at startup
|
|
91
95
|
const docsData = loadData();
|
|
92
96
|
// Check for updates (non-blocking, 3s timeout)
|
|
@@ -104,6 +108,7 @@ if (args.includes('--http')) {
|
|
|
104
108
|
// Shared singletons — reused across stateless per-request servers
|
|
105
109
|
const sharedAnalytics = createAnalytics();
|
|
106
110
|
console.error(`[onesource] analytics: ${process.env.ONESOURCE_ANALYTICS === 'false' ? 'disabled' : `dashboard (${process.env.ONESOURCE_ANALYTICS_URL})`}`);
|
|
111
|
+
console.error(`[onesource] bug reporting: ${bugReportUrl ?? 'https://1s-analytics.vercel.app/api/bugs'}`);
|
|
107
112
|
const sharedClient = createClientFromEnv({ fetch: x402Fetch });
|
|
108
113
|
// Compute tool count once at startup (server object is discarded)
|
|
109
114
|
const { toolCount } = createMcpServer({
|
|
@@ -114,6 +119,7 @@ if (args.includes('--http')) {
|
|
|
114
119
|
x402Enabled,
|
|
115
120
|
x402Address,
|
|
116
121
|
instructions,
|
|
122
|
+
bugReportUrl,
|
|
117
123
|
});
|
|
118
124
|
const httpServer = createServer(async (req, res) => {
|
|
119
125
|
// CORS headers
|
|
@@ -155,6 +161,7 @@ if (args.includes('--http')) {
|
|
|
155
161
|
x402Enabled,
|
|
156
162
|
x402Address,
|
|
157
163
|
instructions,
|
|
164
|
+
bugReportUrl,
|
|
158
165
|
});
|
|
159
166
|
const httpTransport = new StreamableHTTPServerTransport({
|
|
160
167
|
sessionIdGenerator: undefined,
|
|
@@ -236,6 +243,8 @@ else {
|
|
|
236
243
|
catch (err) {
|
|
237
244
|
console.error(`[onesource] x402 setup failed, continuing without payments: ${err instanceof Error ? err.message : err}`);
|
|
238
245
|
}
|
|
246
|
+
// Bug report endpoint (silent override for dev/testing)
|
|
247
|
+
const bugReportUrl = process.env.ONESOURCE_BUG_REPORT_URL;
|
|
239
248
|
// Check for updates (non-blocking, 3s timeout)
|
|
240
249
|
const latestVersion = await checkLatestVersion();
|
|
241
250
|
const instructions = buildInstructions(VERSION, latestVersion);
|
|
@@ -249,11 +258,12 @@ else {
|
|
|
249
258
|
console.error(`[onesource] v${VERSION}`);
|
|
250
259
|
}
|
|
251
260
|
const client = createClientFromEnv({ fetch: x402Fetch });
|
|
252
|
-
const { server, analytics } = createMcpServer({ client, transport: 'stdio', x402Enabled, x402Address, instructions });
|
|
261
|
+
const { server, analytics } = createMcpServer({ client, transport: 'stdio', x402Enabled, x402Address, instructions, bugReportUrl });
|
|
253
262
|
const stdioTransport = new StdioServerTransport();
|
|
254
263
|
await server.connect(stdioTransport);
|
|
255
264
|
console.error('[onesource] Server connected via stdio');
|
|
256
265
|
console.error(`[onesource] analytics: ${process.env.ONESOURCE_ANALYTICS === 'false' ? 'disabled' : `dashboard (${process.env.ONESOURCE_ANALYTICS_URL})`}`);
|
|
266
|
+
console.error(`[onesource] bug reporting: ${bugReportUrl ?? 'https://1s-analytics.vercel.app/api/bugs'}`);
|
|
257
267
|
analytics.trackService({
|
|
258
268
|
type: 'service_start',
|
|
259
269
|
service: 'onesource',
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,yFAAyF;AACzF,KAAK,UAAU,kBAAkB;IAC/B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,mDAAmD,EAAE;YAC3E,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;QACH,IAAI,CAAC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rB,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,OAAO,EAAE,OAAO;YAChB,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,OAAO,CAAC,IAAI,CAAC;YACjB,CAAC,KAAK,IAAI,EAAE;gBACV,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;gBACxB,cAAc,CAAC,KAAK,EAAE,CAAC;gBACvB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC,CAAC,EAAE;YACJ,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC3D,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/create-server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Unified MCP Server Factory
|
|
3
3
|
*
|
|
4
|
-
* Creates a single McpServer named 'onesource' with all
|
|
5
|
-
* (22 API +
|
|
4
|
+
* Creates a single McpServer named 'onesource' with all 34 tools
|
|
5
|
+
* (22 API + 11 docs + 1 bug report) by delegating to the register modules.
|
|
6
6
|
*/
|
|
7
7
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
8
|
import type { OneSourceClient } from '@one-source/api-mcp/client';
|
|
@@ -24,6 +24,8 @@ export interface CreateServerOptions {
|
|
|
24
24
|
x402Address?: string;
|
|
25
25
|
/** Server instructions injected into the LLM's system prompt by MCP clients. */
|
|
26
26
|
instructions?: string;
|
|
27
|
+
/** Override the default bug report endpoint (for dev/testing). */
|
|
28
|
+
bugReportUrl?: string;
|
|
27
29
|
}
|
|
28
30
|
export interface CreateServerResult {
|
|
29
31
|
server: McpServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-server.d.ts","sourceRoot":"","sources":["../src/create-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAqB,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"create-server.d.ts","sourceRoot":"","sources":["../src/create-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAqB,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,mBAAmB,GAAG,kBAAkB,CAiC9E;AAED,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC"}
|
package/dist/create-server.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Unified MCP Server Factory
|
|
3
3
|
*
|
|
4
|
-
* Creates a single McpServer named 'onesource' with all
|
|
5
|
-
* (22 API +
|
|
4
|
+
* Creates a single McpServer named 'onesource' with all 34 tools
|
|
5
|
+
* (22 API + 11 docs + 1 bug report) by delegating to the register modules.
|
|
6
6
|
*/
|
|
7
7
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
8
|
import { registerApiTools } from './register-api-tools.js';
|
|
9
9
|
import { registerDocsTools, loadData } from './register-docs-tools.js';
|
|
10
|
+
import { registerBugReportTool } from './register-bug-report-tool.js';
|
|
10
11
|
import { createAnalytics } from './analytics.js';
|
|
11
12
|
import { VERSION } from './version.js';
|
|
12
13
|
/**
|
|
@@ -30,7 +31,13 @@ export function createMcpServer(opts) {
|
|
|
30
31
|
x402Enabled: opts?.x402Enabled,
|
|
31
32
|
x402Address: opts?.x402Address,
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
const bugCount = registerBugReportTool({
|
|
35
|
+
server,
|
|
36
|
+
analytics,
|
|
37
|
+
transport,
|
|
38
|
+
bugReportUrl: opts?.bugReportUrl,
|
|
39
|
+
});
|
|
40
|
+
return { server, analytics, client, toolCount: apiCount + docsCount + bugCount };
|
|
34
41
|
}
|
|
35
42
|
export { loadData };
|
|
36
43
|
export { VERSION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-server.js","sourceRoot":"","sources":["../src/create-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAmB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"create-server.js","sourceRoot":"","sources":["../src/create-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAmB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA4BvC;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAA0B;IACxD,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,eAAe,EAAE,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,CAAC;IAElC,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EACvC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CACrE,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;QACnD,MAAM;QACN,SAAS;QACT,SAAS;QACT,MAAM,EAAE,IAAI,EAAE,MAAM;KACrB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,iBAAiB,CAAC;QAClC,MAAM;QACN,SAAS;QACT,SAAS;QACT,IAAI,EAAE,IAAI,EAAE,QAAQ;QACpB,WAAW,EAAE,IAAI,EAAE,WAAW;QAC9B,WAAW,EAAE,IAAI,EAAE,WAAW;KAC/B,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,qBAAqB,CAAC;QACrC,MAAM;QACN,SAAS;QACT,SAAS;QACT,YAAY,EAAE,IAAI,EAAE,YAAY;KACjC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,EAAE,CAAC;AACnF,CAAC;AAED,OAAO,EAAE,QAAQ,EAAmB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register the 1s_report_bug tool onto a shared McpServer.
|
|
3
|
+
*
|
|
4
|
+
* Sends structured bug reports to the OneSource bug report endpoint,
|
|
5
|
+
* which forwards them to Slack. Works out of the box — no configuration
|
|
6
|
+
* needed. The endpoint URL defaults to the analytics dashboard.
|
|
7
|
+
*/
|
|
8
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
+
import type { Analytics } from './analytics.js';
|
|
10
|
+
export interface RegisterBugReportToolOptions {
|
|
11
|
+
server: McpServer;
|
|
12
|
+
analytics: Analytics;
|
|
13
|
+
transport?: 'stdio' | 'http';
|
|
14
|
+
/** Override the default bug report endpoint (for dev/testing). */
|
|
15
|
+
bugReportUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Register the bug report tool and return the tool count (1).
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerBugReportTool(opts: RegisterBugReportToolOptions): number;
|
|
21
|
+
//# sourceMappingURL=register-bug-report-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-bug-report-tool.d.ts","sourceRoot":"","sources":["../src/register-bug-report-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAoB/D,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,GAAG,MAAM,CA2GhF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register the 1s_report_bug tool onto a shared McpServer.
|
|
3
|
+
*
|
|
4
|
+
* Sends structured bug reports to the OneSource bug report endpoint,
|
|
5
|
+
* which forwards them to Slack. Works out of the box — no configuration
|
|
6
|
+
* needed. The endpoint URL defaults to the analytics dashboard.
|
|
7
|
+
*/
|
|
8
|
+
import { createHash } from 'node:crypto';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { VERSION } from './version.js';
|
|
11
|
+
/** Default bug report endpoint (analytics dashboard). */
|
|
12
|
+
const DEFAULT_BUG_REPORT_URL = 'https://1s-analytics.vercel.app/api/bugs';
|
|
13
|
+
function hashSession(sessionId) {
|
|
14
|
+
if (!sessionId)
|
|
15
|
+
return undefined;
|
|
16
|
+
return createHash('sha256').update(sessionId).digest('hex').slice(0, 16);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Register the bug report tool and return the tool count (1).
|
|
20
|
+
*/
|
|
21
|
+
export function registerBugReportTool(opts) {
|
|
22
|
+
const { server, analytics, transport } = opts;
|
|
23
|
+
const bugReportUrl = opts.bugReportUrl ?? DEFAULT_BUG_REPORT_URL;
|
|
24
|
+
server.tool('1s_report_bug', 'Report a bug or issue to the OneSource team. Use when a tool returns an unexpected error or when the user asks to report a problem. Free, no payment required.', z.object({
|
|
25
|
+
description: z.string().describe('What went wrong — describe the bug, what you expected, and what actually happened.'),
|
|
26
|
+
tool_name: z.string().optional().describe('The MCP tool that produced the error (e.g. 1s_network_info, search_docs).'),
|
|
27
|
+
error_message: z.string().optional().describe('The error message or relevant output from the failed tool call.'),
|
|
28
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Bug severity: low (cosmetic), medium (degraded function), high (feature broken), critical (server crash or data loss).'),
|
|
29
|
+
network: z.string().optional().describe('The blockchain network involved, if applicable (e.g. ethereum, sepolia, avax).'),
|
|
30
|
+
steps_to_reproduce: z.string().optional().describe('Steps to reproduce the issue, if known.'),
|
|
31
|
+
}).shape, async (input, extra) => {
|
|
32
|
+
const start = performance.now();
|
|
33
|
+
const inputKeys = Object.keys(input);
|
|
34
|
+
const sessionHash = hashSession(extra.sessionId);
|
|
35
|
+
const clientInfo = server.server.getClientVersion();
|
|
36
|
+
const base = {
|
|
37
|
+
type: 'tool_call',
|
|
38
|
+
service: 'onesource-ops',
|
|
39
|
+
tool: '1s_report_bug',
|
|
40
|
+
category: 'ops',
|
|
41
|
+
timestamp: new Date().toISOString(),
|
|
42
|
+
input_params: inputKeys,
|
|
43
|
+
version: VERSION,
|
|
44
|
+
auth_method: 'none',
|
|
45
|
+
client_name: clientInfo?.name,
|
|
46
|
+
client_version: clientInfo?.version,
|
|
47
|
+
session_id: sessionHash,
|
|
48
|
+
transport,
|
|
49
|
+
source: 'unified',
|
|
50
|
+
};
|
|
51
|
+
try {
|
|
52
|
+
// Validate: description is required and non-empty
|
|
53
|
+
if (!input.description?.trim()) {
|
|
54
|
+
return {
|
|
55
|
+
content: [{ type: 'text', text: 'Bug report requires a description. Please describe what went wrong.' }],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Build the payload — structured JSON, backend handles formatting
|
|
59
|
+
const payload = {
|
|
60
|
+
description: input.description.slice(0, 3000),
|
|
61
|
+
tool_name: input.tool_name,
|
|
62
|
+
error_message: input.error_message?.slice(0, 1000),
|
|
63
|
+
severity: input.severity ?? 'medium',
|
|
64
|
+
network: input.network,
|
|
65
|
+
steps_to_reproduce: input.steps_to_reproduce?.slice(0, 2000),
|
|
66
|
+
context: {
|
|
67
|
+
mcp_version: VERSION,
|
|
68
|
+
transport: transport ?? 'unknown',
|
|
69
|
+
timestamp: new Date().toISOString(),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
const res = await fetch(bugReportUrl, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: { 'Content-Type': 'application/json' },
|
|
75
|
+
body: JSON.stringify(payload),
|
|
76
|
+
signal: AbortSignal.timeout(10_000),
|
|
77
|
+
});
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
const body = await res.text().catch(() => '');
|
|
80
|
+
throw new Error(`Bug report endpoint returned ${res.status}: ${body.slice(0, 200)}`);
|
|
81
|
+
}
|
|
82
|
+
const durationMs = Math.round(performance.now() - start);
|
|
83
|
+
const successText = 'Bug report sent to the OneSource team. Thank you for reporting this issue.';
|
|
84
|
+
analytics.trackTool({
|
|
85
|
+
...base,
|
|
86
|
+
duration_ms: durationMs,
|
|
87
|
+
success: true,
|
|
88
|
+
response_size: successText.length,
|
|
89
|
+
});
|
|
90
|
+
return { content: [{ type: 'text', text: successText }] };
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
const durationMs = Math.round(performance.now() - start);
|
|
94
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
95
|
+
analytics.trackTool({
|
|
96
|
+
...base,
|
|
97
|
+
duration_ms: durationMs,
|
|
98
|
+
success: false,
|
|
99
|
+
error_category: message.slice(0, 100).replace(/0x[a-fA-F0-9]+/g, '0x***'),
|
|
100
|
+
response_size: 0,
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
isError: true,
|
|
104
|
+
content: [{
|
|
105
|
+
type: 'text',
|
|
106
|
+
text: `Failed to send bug report: ${message.slice(0, 500)}\n\nPlease report the bug manually at: https://github.com/blockparty-global/1s-mcp/issues`,
|
|
107
|
+
}],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return 1;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=register-bug-report-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-bug-report-tool.js","sourceRoot":"","sources":["../src/register-bug-report-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,yDAAyD;AACzD,MAAM,sBAAsB,GAAG,0CAA0C,CAAC;AAE1E,SAAS,WAAW,CAAC,SAA6B;IAChD,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAmBD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAkC;IACtE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,sBAAsB,CAAC;IAEjE,MAAM,CAAC,IAAI,CACT,eAAe,EACf,gKAAgK,EAChK,CAAC,CAAC,MAAM,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ACrB,IAAI,EAAE,8BAA8B,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,2FAA2F;qBACrJ,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-docs-tools.d.ts","sourceRoot":"","sources":["../src/register-docs-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAYjE,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAgF/D,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"register-docs-tools.d.ts","sourceRoot":"","sources":["../src/register-docs-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAYjE,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAgF/D,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAoMxE;AAED,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
|
@@ -102,10 +102,10 @@ export function registerDocsTools(opts) {
|
|
|
102
102
|
const x402Enabled = opts.x402Enabled;
|
|
103
103
|
const x402Address = opts.x402Address;
|
|
104
104
|
instrumentedTool(server, analytics, transport, '1s_setup_check', 'Check OneSource MCP server health — version (current vs latest), x402 payment status, wallet address, API connectivity, and setup instructions if anything is missing. Free, no payment required. Call this first when troubleshooting.', {}, async () => {
|
|
105
|
-
const
|
|
105
|
+
const parts = [];
|
|
106
106
|
// 1. Server version
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
parts.push('## Server Version\n');
|
|
108
|
+
parts.push(`Current: ${VERSION}`);
|
|
109
109
|
let latestVersion = 'unknown';
|
|
110
110
|
try {
|
|
111
111
|
const res = await fetch('https://registry.npmjs.org/@one-source/mcp/latest', {
|
|
@@ -117,86 +117,96 @@ export function registerDocsTools(opts) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
catch { /* network error — skip */ }
|
|
120
|
-
|
|
120
|
+
parts.push(`Latest: ${latestVersion}`);
|
|
121
121
|
if (latestVersion !== 'unknown' && latestVersion !== VERSION) {
|
|
122
|
-
|
|
122
|
+
parts.push('\n**Update available!** Run: `npx -y @one-source/mcp@latest`');
|
|
123
123
|
}
|
|
124
124
|
else if (latestVersion === VERSION) {
|
|
125
|
-
|
|
125
|
+
parts.push('\nYou are on the latest version.');
|
|
126
126
|
}
|
|
127
127
|
// 2. x402 payment status
|
|
128
|
-
|
|
128
|
+
parts.push('\n## x402 Payment Status\n');
|
|
129
129
|
const enabled = x402Enabled ?? !!process.env.X402_PRIVATE_KEY;
|
|
130
130
|
if (enabled && x402Address) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
parts.push('Status: **Configured**');
|
|
132
|
+
parts.push(`Wallet: \`${x402Address}\``);
|
|
133
|
+
parts.push('\nThis wallet must hold USDC on the **Base** network to pay for API calls.');
|
|
134
134
|
}
|
|
135
135
|
else if (enabled) {
|
|
136
|
-
|
|
136
|
+
parts.push('Status: **Configured** (wallet address not available)');
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
139
|
+
parts.push('Status: **Not configured**');
|
|
140
|
+
parts.push('\nBlockchain API tools require x402 payment. Without a key, paid endpoints return HTTP 402 errors.\n');
|
|
141
|
+
parts.push('### How to configure x402\n');
|
|
142
|
+
parts.push('1. **Get an EVM private key** — export from MetaMask, Coinbase Wallet, or generate one.');
|
|
143
|
+
parts.push(' The key must start with `0x` followed by 64 hex characters. Some wallets export without the `0x` prefix — if so, add `0x` to the beginning yourself.');
|
|
144
|
+
parts.push(' ```');
|
|
145
|
+
parts.push(' # Generate a new key (macOS/Linux, or Git Bash on Windows)');
|
|
146
|
+
parts.push(' echo "0x$(openssl rand -hex 32)"');
|
|
147
|
+
parts.push(' ```\n');
|
|
148
|
+
parts.push('2. **Fund the wallet** with USDC on the **Base** network (not Ethereum mainnet). A few dollars is enough for hundreds of queries.\n');
|
|
149
|
+
parts.push('3. **Set the key** for your MCP client:\n');
|
|
150
|
+
parts.push(' **Claude Code:**');
|
|
151
|
+
parts.push(' ```');
|
|
152
|
+
parts.push(' claude mcp remove onesource');
|
|
153
|
+
parts.push(' claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest');
|
|
154
|
+
parts.push(' ```\n');
|
|
155
|
+
parts.push(' **Claude Desktop / Cursor** — add an `env` block to your MCP config:');
|
|
156
|
+
parts.push(' ```json');
|
|
157
|
+
parts.push(' {');
|
|
158
|
+
parts.push(' "mcpServers": {');
|
|
159
|
+
parts.push(' "onesource": {');
|
|
160
|
+
parts.push(' "command": "npx",');
|
|
161
|
+
parts.push(' "args": ["-y", "@one-source/mcp@latest"],');
|
|
162
|
+
parts.push(' "env": { "X402_PRIVATE_KEY": "0x..." }');
|
|
163
|
+
parts.push(' }');
|
|
164
|
+
parts.push(' }');
|
|
165
|
+
parts.push(' }');
|
|
166
|
+
parts.push(' ```\n');
|
|
167
|
+
parts.push(' **Any MCP client (stdio):**');
|
|
168
|
+
parts.push(' ```');
|
|
169
|
+
parts.push(' X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest');
|
|
170
|
+
parts.push(' ```\n');
|
|
171
|
+
parts.push(' **Alternative — set `X402_PRIVATE_KEY` as a shell or system environment variable:**');
|
|
172
|
+
parts.push(' ```');
|
|
173
|
+
parts.push(' # bash/zsh: export X402_PRIVATE_KEY=0x...');
|
|
174
|
+
parts.push(' # PowerShell: $env:X402_PRIVATE_KEY = "0x..."');
|
|
175
|
+
parts.push(' ```\n');
|
|
176
|
+
parts.push('4. **Reload the MCP server** after setting the key — run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor.\n');
|
|
177
|
+
parts.push('**Security:** Never commit your private key to source control. Use environment variables or a secrets manager.\n');
|
|
178
|
+
parts.push('For detailed setup instructions, call the `get_mcp_setup_guide` tool.');
|
|
172
179
|
}
|
|
173
180
|
// 3. API connectivity
|
|
174
|
-
|
|
181
|
+
parts.push('\n## API Connectivity\n');
|
|
175
182
|
const baseUrl = process.env.ONESOURCE_BASE_URL ?? 'https://skills.onesource.io';
|
|
176
183
|
try {
|
|
177
184
|
const res = await fetch(baseUrl, { method: 'HEAD', signal: AbortSignal.timeout(5000) });
|
|
178
|
-
|
|
185
|
+
parts.push(`Backend: **Reachable** (${baseUrl})`);
|
|
179
186
|
}
|
|
180
187
|
catch (err) {
|
|
181
188
|
const msg = err instanceof Error ? err.message : String(err);
|
|
182
|
-
|
|
189
|
+
parts.push(`Backend: **Unreachable** — ${msg}`);
|
|
183
190
|
}
|
|
184
191
|
// 4. Transport
|
|
185
|
-
|
|
186
|
-
|
|
192
|
+
parts.push('\n## Transport\n');
|
|
193
|
+
parts.push(`Mode: ${transport ?? 'unknown'}`);
|
|
194
|
+
// 4.5 Bug reporting
|
|
195
|
+
parts.push('\n## Bug Reporting\n');
|
|
196
|
+
parts.push('Status: **Enabled** — call `1s_report_bug` to report issues to the OneSource team.');
|
|
187
197
|
// 5. Next steps
|
|
188
|
-
|
|
198
|
+
parts.push('\n## Next Steps\n');
|
|
189
199
|
if (!enabled) {
|
|
190
|
-
|
|
200
|
+
parts.push('- Configure x402 payments to use blockchain API tools (see instructions above)');
|
|
191
201
|
}
|
|
192
202
|
if (latestVersion !== 'unknown' && latestVersion !== VERSION) {
|
|
193
|
-
|
|
203
|
+
parts.push('- Update to the latest version: `npx -y @one-source/mcp@latest`');
|
|
194
204
|
}
|
|
195
|
-
|
|
205
|
+
parts.push('- Documentation tools are free — try `search_docs` or `list_supported_chains`');
|
|
196
206
|
if (enabled) {
|
|
197
|
-
|
|
207
|
+
parts.push('- Try a paid API tool: `1s_network_info` (returns chain ID, block number, gas price)');
|
|
198
208
|
}
|
|
199
|
-
return
|
|
209
|
+
return parts.join('\n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
{
|
|
2
2
|
"name": "@one-source/mcp",
|
|
3
3
|
"mcpName": "io.onesource/mcp",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.4",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "Unified MCP server for OneSource —
|
|
6
|
+
"description": "Unified MCP server for OneSource — 34 tools for blockchain data and API documentation",
|
|
7
7
|
"bin": {
|
|
8
8
|
"onesource-mcp": "./dist/cli.js"
|
|
9
9
|
},
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
|
|
10
10
|
# OneSource MCP Setup Guide
|
|
11
11
|
|
|
12
|
-
OneSource MCP provides
|
|
12
|
+
OneSource MCP provides 34 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.
|
|
13
13
|
|
|
14
14
|
## Before You Start
|
|
15
15
|
|
|
@@ -21,6 +21,8 @@ OneSource MCP provides 33 tools for blockchain data, live chain queries, and API
|
|
|
21
21
|
|
|
22
22
|
Do not skip this step — outdated versions may be missing tools, fixes, or protocol changes.
|
|
23
23
|
|
|
24
|
+
> **Note:** The `get_mcp_setup_guide` tool also provides setup documentation and can be used as a reference alongside this guide.
|
|
25
|
+
|
|
24
26
|
## Step 1: Check Current Installation
|
|
25
27
|
|
|
26
28
|
Call the `1s_setup_check` tool. It reports:
|
|
@@ -72,7 +74,9 @@ To update, reinstall with `@latest` or clear the npx cache: `npx -y @one-source/
|
|
|
72
74
|
|
|
73
75
|
## Step 3: Get an EVM Private Key
|
|
74
76
|
|
|
75
|
-
The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It must
|
|
77
|
+
The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It must start with `0x` followed by 64 hex characters (e.g. `0x4c08...7e3d`).
|
|
78
|
+
|
|
79
|
+
> **Important:** Some wallets (including MetaMask) export the private key **without** the `0x` prefix — it will look like just a long string of letters and numbers. If the key you copied doesn't start with `0x`, you need to add `0x` to the beginning yourself before using it as `X402_PRIVATE_KEY`.
|
|
76
80
|
|
|
77
81
|
### Option A: Export from MetaMask
|
|
78
82
|
|
|
@@ -80,7 +84,7 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
|
|
|
80
84
|
2. Click the three dots next to the account name
|
|
81
85
|
3. Go to **Account details** > **Show private key**
|
|
82
86
|
4. Enter your MetaMask password
|
|
83
|
-
5. Copy the key
|
|
87
|
+
5. Copy the key — if it doesn't already start with `0x`, add `0x` to the beginning
|
|
84
88
|
|
|
85
89
|
### Option B: Export from Coinbase Wallet
|
|
86
90
|
|
|
@@ -90,26 +94,21 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
|
|
|
90
94
|
### Option C: Generate a New Wallet
|
|
91
95
|
|
|
92
96
|
```bash
|
|
93
|
-
# Using OpenSSL
|
|
97
|
+
# Using OpenSSL (macOS/Linux, or Git Bash on Windows)
|
|
94
98
|
echo "0x$(openssl rand -hex 32)"
|
|
95
99
|
|
|
96
100
|
# Using Foundry (if installed)
|
|
97
101
|
cast wallet new
|
|
98
102
|
```
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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.
|
|
104
|
+
```powershell
|
|
105
|
+
# PowerShell (Windows)
|
|
106
|
+
"0x" + -join ((1..32) | ForEach-Object { "{0:x2}" -f (Get-Random -Max 256) })
|
|
107
|
+
```
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
**Important:** Use a dedicated wallet for MCP payments — do not use your primary wallet with large holdings. Transfer only what you need.
|
|
111
110
|
|
|
112
|
-
## Step
|
|
111
|
+
## Step 4: Set the Private Key
|
|
113
112
|
|
|
114
113
|
### Claude Code
|
|
115
114
|
|
|
@@ -118,6 +117,8 @@ claude mcp remove onesource
|
|
|
118
117
|
claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
|
|
119
118
|
```
|
|
120
119
|
|
|
120
|
+
> **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).
|
|
121
|
+
|
|
121
122
|
### Claude Desktop / Cursor
|
|
122
123
|
|
|
123
124
|
Add the `env` block to your MCP config:
|
|
@@ -142,27 +143,113 @@ Add the `env` block to your MCP config:
|
|
|
142
143
|
X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
|
|
143
144
|
```
|
|
144
145
|
|
|
146
|
+
### Manual Setup (Editing the Config File Directly)
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
150
|
+
**Claude Code** — Find which file your config is in by running `claude mcp get onesource`. Depending on the scope:
|
|
151
|
+
- **Local:** `.claude/settings.local.json` in your project directory
|
|
152
|
+
- **Project:** `.claude/settings.json` in your project directory
|
|
153
|
+
- **User:** `~/.claude/settings.json` (macOS/Linux) or `%USERPROFILE%\.claude\settings.json` (Windows)
|
|
154
|
+
|
|
155
|
+
**Claude Desktop:**
|
|
156
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
157
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
158
|
+
|
|
159
|
+
**Cursor:**
|
|
160
|
+
- **macOS:** `~/.cursor/mcp.json`
|
|
161
|
+
- **Windows:** `%USERPROFILE%\.cursor\mcp.json`
|
|
162
|
+
|
|
163
|
+
Open the config file and add (or update) the `onesource` entry inside `"mcpServers"`:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"mcpServers": {
|
|
168
|
+
"onesource": {
|
|
169
|
+
"command": "npx",
|
|
170
|
+
"args": ["-y", "@one-source/mcp@latest"],
|
|
171
|
+
"env": {
|
|
172
|
+
"X402_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY_HERE"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Save the file, then reload (see below).
|
|
180
|
+
|
|
181
|
+
### Important: Reload After Config Changes
|
|
182
|
+
|
|
183
|
+
Changing the config file (via `claude mcp add` or manual edit) does **not** automatically restart the running MCP server. You must reload:
|
|
184
|
+
|
|
185
|
+
- **Claude Code:** Run `/reload-plugins` (preferred — no restart needed), or restart Claude Code entirely.
|
|
186
|
+
- **Claude Desktop / Cursor:** Restart the app — close it completely and reopen.
|
|
187
|
+
|
|
188
|
+
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.
|
|
189
|
+
|
|
190
|
+
### Alternative: Set the Key as an Environment Variable
|
|
191
|
+
|
|
192
|
+
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:
|
|
193
|
+
|
|
194
|
+
**bash / zsh (macOS / Linux):**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
export X402_PRIVATE_KEY=0x...
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
To make it persistent, add the line to your `~/.bashrc`, `~/.zshrc`, or `~/.profile`.
|
|
201
|
+
|
|
202
|
+
**PowerShell (Windows):**
|
|
203
|
+
|
|
204
|
+
```powershell
|
|
205
|
+
$env:X402_PRIVATE_KEY = "0x..."
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
This only lasts for the current session. To make it persistent, either:
|
|
209
|
+
- Add it to your PowerShell profile (`notepad $PROFILE`, add the line, restart PowerShell)
|
|
210
|
+
- 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...`
|
|
211
|
+
|
|
212
|
+
After setting the variable, restart your MCP client and run `1s_setup_check` to confirm.
|
|
213
|
+
|
|
214
|
+
> **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"]`.
|
|
215
|
+
|
|
145
216
|
### Security
|
|
146
217
|
|
|
147
218
|
- **Never** commit your private key to source control.
|
|
148
219
|
- Use environment variables, a `.env` file (excluded from git), or a secrets manager.
|
|
149
220
|
- Use a dedicated wallet with minimal funds — only what you need for API calls.
|
|
150
221
|
|
|
222
|
+
## Step 5: Fund the Wallet with USDC on Base
|
|
223
|
+
|
|
224
|
+
The wallet must hold **USDC on the Base network** (not Ethereum mainnet, not other tokens).
|
|
225
|
+
|
|
226
|
+
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.
|
|
227
|
+
2. Send USDC to that address **on the Base network**.
|
|
228
|
+
3. A few dollars ($1–5 USDC) is enough for hundreds of API calls.
|
|
229
|
+
|
|
230
|
+
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.
|
|
231
|
+
|
|
151
232
|
## Step 6: Verify
|
|
152
233
|
|
|
153
|
-
After setting the key
|
|
234
|
+
After setting the key, reload and verify:
|
|
154
235
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
236
|
+
1. **Reload the MCP server** — In Claude Code, run `/reload-plugins` to pick up config changes without restarting the session.
|
|
237
|
+
2. **Check MCP connection** — Run `/mcp` to confirm the `onesource` server is connected.
|
|
238
|
+
3. **Run `1s_setup_check`** — You should see:
|
|
239
|
+
- **x402 status:** Configured
|
|
240
|
+
- **Wallet address:** Your wallet address
|
|
241
|
+
- **API backend:** Reachable
|
|
242
|
+
4. **Test a paid tool** — Try `1s_network_info` to confirm payments work end-to-end.
|
|
158
243
|
|
|
159
|
-
|
|
244
|
+
> **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
245
|
|
|
161
246
|
## Troubleshooting
|
|
162
247
|
|
|
163
248
|
| Problem | Solution |
|
|
164
249
|
|---------|----------|
|
|
165
|
-
| `1s_setup_check` shows "Not configured" |
|
|
250
|
+
| `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. |
|
|
251
|
+
| "MCP server onesource already exists" error | Run `claude mcp remove onesource` first, then re-add it with your updated config. |
|
|
252
|
+
| Config changed but nothing happened | Run `/reload-plugins` in Claude Code to reload MCP servers, then `/mcp` to check connection status. |
|
|
166
253
|
| Tool returns HTTP 402 error | x402 is not configured, or the wallet has insufficient USDC on Base. |
|
|
167
254
|
| "x402 setup failed" in server logs | The private key format is wrong. It must be a 64-character hex string prefixed with `0x`. |
|
|
168
255
|
| Key is set but wallet shows 0 USDC | Make sure USDC is on the **Base** network, not Ethereum mainnet or another chain. |
|