@one-source/mcp 4.0.4 → 5.0.1

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 CHANGED
@@ -1,8 +1,6 @@
1
1
  # @one-source/mcp
2
2
 
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
-
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.
3
+ Unified MCP server for [OneSource](https://docs.onesource.io) — 24 tools for blockchain data and live chain queries in a single server.
6
4
 
7
5
  > **What is MCP?** The [Model Context Protocol](https://modelcontextprotocol.io) lets AI assistants call tools and access data sources. This server exposes both the OneSource blockchain API and its documentation as tools.
8
6
 
@@ -46,7 +44,7 @@ Then connect your MCP client to `http://localhost:3000/`.
46
44
 
47
45
  Health check: `GET http://localhost:3000/health`
48
46
 
49
- ## Tools (34)
47
+ ## Tools (24)
50
48
 
51
49
  ### Blockchain API — Live Chain (12 tools)
52
50
 
@@ -82,24 +80,14 @@ RPC only.
82
80
  | `1s_storage_read` | Read storage slot |
83
81
  | `1s_tx_receipt` | Transaction receipt |
84
82
 
85
- ### Documentation, Setup & Ops (12 tools)
83
+ ### Setup & Ops (2 tools)
86
84
 
87
- Read-only, no API key required.
85
+ No authentication required.
88
86
 
89
87
  | Tool | Purpose | When to use |
90
88
  |------|---------|-------------|
91
- | `1s_setup_check` | Server health, version, x402 status, setup instructions | First thing to call — checks if everything is configured |
89
+ | `1s_setup_check` | Server health, version, auth status, setup instructions | First thing to call — checks if everything is configured |
92
90
  | `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
93
- | `search_docs` | Keyword search across all documentation | Finding guides, concepts, or API patterns |
94
- | `get_query_reference` | Full reference for a root GraphQL query | Building a specific query with correct args/filters |
95
- | `get_type_definition` | Schema definition for any type/enum/input | Understanding field shapes and return types |
96
- | `list_examples` | Browse or search working GraphQL examples | Finding ready-to-use query patterns |
97
- | `list_supported_chains` | All supported blockchain networks + endpoints | First question: "What chains are supported?" |
98
- | `get_filter_reference` | Filter fields and operators for a list query | Building filtered queries with correct syntax |
99
- | `get_pagination_guide` | Cursor-based pagination pattern with examples | Implementing pagination for list queries |
100
- | `get_schema_overview` | High-level summary of the entire schema | Exploring the API surface before diving in |
101
- | `get_authentication_guide` | API key format, headers, and endpoints | Setting up authentication for the first time |
102
- | `get_mcp_setup_guide` | MCP installation, setup, x402 config guide | Setting up the MCP server or configuring payments |
103
91
 
104
92
  ## Networks
105
93
 
@@ -111,27 +99,24 @@ All blockchain API tools accept an optional `network` parameter:
111
99
  | `sepolia` | Ethereum Sepolia testnet |
112
100
  | `avax` | Avalanche C-Chain |
113
101
 
114
- ## Payment (x402)
115
-
116
- Blockchain API endpoints are priced in USDC on Base via [x402](https://github.com/coinbase/x402). When you set `X402_PRIVATE_KEY`, the server automatically handles payments — tool calls that return HTTP 402 are paid and retried without any extra work from the agent.
102
+ ## Authentication
117
103
 
118
- Documentation tools are always free no key or payment needed.
104
+ Blockchain API tools require authentication. Two options are availableAPI key takes priority if both are set.
119
105
 
120
- ### Setup
106
+ | Method | Variable | Description |
107
+ |--------|----------|-------------|
108
+ | API key | `ONESOURCE_API_KEY` | Unlimited calls, no per-call cost |
109
+ | x402 micropayments | `X402_PRIVATE_KEY` | Pay-per-call via USDC on Base |
121
110
 
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.
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.
124
- 3. **Pass the key to the server** using one of the methods below.
111
+ ### Option 1: API Key (recommended)
125
112
 
126
- ### Claude Code
113
+ #### Claude Code
127
114
 
128
115
  ```bash
129
- claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
116
+ claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
130
117
  ```
131
118
 
132
- ### Claude Desktop / Cursor
133
-
134
- Add the `env` block to your MCP config:
119
+ #### Claude Desktop / Cursor
135
120
 
136
121
  ```json
137
122
  {
@@ -140,40 +125,56 @@ Add the `env` block to your MCP config:
140
125
  "command": "npx",
141
126
  "args": ["-y", "@one-source/mcp@latest"],
142
127
  "env": {
143
- "X402_PRIVATE_KEY": "0x..."
128
+ "ONESOURCE_API_KEY": "<key>"
144
129
  }
145
130
  }
146
131
  }
147
132
  }
148
133
  ```
149
134
 
150
- ### Any MCP Client (stdio)
135
+ #### Any MCP Client (stdio)
151
136
 
152
137
  ```bash
153
- X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
138
+ ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
154
139
  ```
155
140
 
156
- ### Config File Locations
141
+ ### Option 2: x402 Micropayments
157
142
 
158
- If you prefer editing the config file directly instead of using CLI commands:
143
+ 1. **Get an EVM private key** export from MetaMask, Coinbase Wallet, or generate one. The key is a 64-character hex string. The `0x` prefix is optional — both formats are accepted.
144
+ 2. **Fund the wallet with USDC on Base** — bridge or transfer USDC to the derived wallet address on [Base](https://base.org).
145
+ 3. **Pass the key to the server:**
159
146
 
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` |
147
+ #### Claude Code
167
148
 
168
- Add the `onesource` entry inside `"mcpServers"` using the JSON block shown above.
149
+ ```bash
150
+ claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
151
+ ```
152
+
153
+ #### Claude Desktop / Cursor
154
+
155
+ ```json
156
+ {
157
+ "mcpServers": {
158
+ "onesource": {
159
+ "command": "npx",
160
+ "args": ["-y", "@one-source/mcp@latest"],
161
+ "env": {
162
+ "X402_PRIVATE_KEY": "0x..."
163
+ }
164
+ }
165
+ }
166
+ }
167
+ ```
169
168
 
170
- ### Alternative: Set as an Environment Variable
169
+ #### Any MCP Client (stdio)
171
170
 
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.
171
+ ```bash
172
+ X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
173
+ ```
173
174
 
174
175
  ### Security
175
176
 
176
- Never commit your private key to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
177
+ Never commit keys to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
177
178
 
178
179
  > **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
 
@@ -181,13 +182,14 @@ Never commit your private key to source control. Use environment variables, a `.
181
182
 
182
183
  | Variable | Default | Description |
183
184
  |----------|---------|-------------|
184
- | `X402_PRIVATE_KEY` | — | EVM private key (hex, 0x-prefixed) for automatic x402 USDC payments on Base |
185
+ | `ONESOURCE_API_KEY` | — | OneSource API key for Bearer token auth. Takes priority over x402. |
186
+ | `X402_PRIVATE_KEY` | — | EVM private key (64-char hex, `0x` prefix optional) for automatic x402 USDC payments on Base |
185
187
  | `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | API base URL |
186
188
  | `ONESOURCE_ANALYTICS` | — | Set to `false` to disable analytics |
187
189
 
188
190
  ## Troubleshooting
189
191
 
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.
192
+ **`1s_setup_check` shows "Not configured"** — Set either `ONESOURCE_API_KEY` or `X402_PRIVATE_KEY`. Reload the MCP server after setting either variable. If the key still isn't reaching the server, set it as a shell environment variable directly.
191
193
 
192
194
  **"MCP server onesource already exists" error** — Run `claude mcp remove onesource` first, then re-add.
193
195
 
package/README.npm.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # @one-source/mcp
2
2
 
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
-
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.
3
+ Unified MCP server for [OneSource](https://docs.onesource.io) — 24 tools for blockchain data and live chain queries in a single server.
6
4
 
7
5
  > **What is MCP?** The [Model Context Protocol](https://modelcontextprotocol.io) lets AI assistants call tools and access data sources. This server exposes both the OneSource blockchain API and its documentation as tools.
8
6
 
@@ -46,7 +44,7 @@ Then connect your MCP client to `http://localhost:3000/`.
46
44
 
47
45
  Health check: `GET http://localhost:3000/health`
48
46
 
49
- ## Tools (34)
47
+ ## Tools (24)
50
48
 
51
49
  ### Blockchain API — Live Chain (12 tools)
52
50
 
@@ -82,24 +80,14 @@ RPC only.
82
80
  | `1s_storage_read` | Read storage slot |
83
81
  | `1s_tx_receipt` | Transaction receipt |
84
82
 
85
- ### Documentation, Setup & Ops (12 tools)
83
+ ### Setup & Ops (2 tools)
86
84
 
87
- Read-only, no API key required.
85
+ No authentication required.
88
86
 
89
87
  | Tool | Purpose | When to use |
90
88
  |------|---------|-------------|
91
- | `1s_setup_check` | Server health, version, x402 status, setup instructions | First thing to call — checks if everything is configured |
89
+ | `1s_setup_check` | Server health, version, auth status, setup instructions | First thing to call — checks if everything is configured |
92
90
  | `1s_report_bug` | Report bugs to Slack (or GitHub Issues fallback) | When a tool errors or user wants to report an issue |
93
- | `search_docs` | Keyword search across all documentation | Finding guides, concepts, or API patterns |
94
- | `get_query_reference` | Full reference for a root GraphQL query | Building a specific query with correct args/filters |
95
- | `get_type_definition` | Schema definition for any type/enum/input | Understanding field shapes and return types |
96
- | `list_examples` | Browse or search working GraphQL examples | Finding ready-to-use query patterns |
97
- | `list_supported_chains` | All supported blockchain networks + endpoints | First question: "What chains are supported?" |
98
- | `get_filter_reference` | Filter fields and operators for a list query | Building filtered queries with correct syntax |
99
- | `get_pagination_guide` | Cursor-based pagination pattern with examples | Implementing pagination for list queries |
100
- | `get_schema_overview` | High-level summary of the entire schema | Exploring the API surface before diving in |
101
- | `get_authentication_guide` | API key format, headers, and endpoints | Setting up authentication for the first time |
102
- | `get_mcp_setup_guide` | MCP installation, setup, x402 config guide | Setting up the MCP server or configuring payments |
103
91
 
104
92
  ## Networks
105
93
 
@@ -111,27 +99,24 @@ All blockchain API tools accept an optional `network` parameter:
111
99
  | `sepolia` | Ethereum Sepolia testnet |
112
100
  | `avax` | Avalanche C-Chain |
113
101
 
114
- ## Payment (x402)
115
-
116
- Blockchain API endpoints are priced in USDC on Base via [x402](https://github.com/coinbase/x402). When you set `X402_PRIVATE_KEY`, the server automatically handles payments — tool calls that return HTTP 402 are paid and retried without any extra work from the agent.
102
+ ## Authentication
117
103
 
118
- Documentation tools are always free no key or payment needed.
104
+ Blockchain API tools require authentication. Two options are availableAPI key takes priority if both are set.
119
105
 
120
- ### Setup
106
+ | Method | Variable | Description |
107
+ |--------|----------|-------------|
108
+ | API key | `ONESOURCE_API_KEY` | Unlimited calls, no per-call cost |
109
+ | x402 micropayments | `X402_PRIVATE_KEY` | Pay-per-call via USDC on Base |
121
110
 
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.
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.
124
- 3. **Pass the key to the server** using one of the methods below.
111
+ ### Option 1: API Key (recommended)
125
112
 
126
- ### Claude Code
113
+ #### Claude Code
127
114
 
128
115
  ```bash
129
- claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
116
+ claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest
130
117
  ```
131
118
 
132
- ### Claude Desktop / Cursor
133
-
134
- Add the `env` block to your MCP config:
119
+ #### Claude Desktop / Cursor
135
120
 
136
121
  ```json
137
122
  {
@@ -140,40 +125,56 @@ Add the `env` block to your MCP config:
140
125
  "command": "npx",
141
126
  "args": ["-y", "@one-source/mcp@latest"],
142
127
  "env": {
143
- "X402_PRIVATE_KEY": "0x..."
128
+ "ONESOURCE_API_KEY": "<key>"
144
129
  }
145
130
  }
146
131
  }
147
132
  }
148
133
  ```
149
134
 
150
- ### Any MCP Client (stdio)
135
+ #### Any MCP Client (stdio)
151
136
 
152
137
  ```bash
153
- X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
138
+ ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest
154
139
  ```
155
140
 
156
- ### Config File Locations
141
+ ### Option 2: x402 Micropayments
157
142
 
158
- If you prefer editing the config file directly instead of using CLI commands:
143
+ 1. **Get an EVM private key** export from MetaMask, Coinbase Wallet, or generate one. The key is a 64-character hex string. The `0x` prefix is optional — both formats are accepted.
144
+ 2. **Fund the wallet with USDC on Base** — bridge or transfer USDC to the derived wallet address on [Base](https://base.org).
145
+ 3. **Pass the key to the server:**
159
146
 
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` |
147
+ #### Claude Code
167
148
 
168
- Add the `onesource` entry inside `"mcpServers"` using the JSON block shown above.
149
+ ```bash
150
+ claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest
151
+ ```
152
+
153
+ #### Claude Desktop / Cursor
154
+
155
+ ```json
156
+ {
157
+ "mcpServers": {
158
+ "onesource": {
159
+ "command": "npx",
160
+ "args": ["-y", "@one-source/mcp@latest"],
161
+ "env": {
162
+ "X402_PRIVATE_KEY": "0x..."
163
+ }
164
+ }
165
+ }
166
+ }
167
+ ```
169
168
 
170
- ### Alternative: Set as an Environment Variable
169
+ #### Any MCP Client (stdio)
171
170
 
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.
171
+ ```bash
172
+ X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest
173
+ ```
173
174
 
174
175
  ### Security
175
176
 
176
- Never commit your private key to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
177
+ Never commit keys to source control. Use environment variables, a `.env` file (excluded from git), or a secrets manager.
177
178
 
178
179
  > **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
 
@@ -181,13 +182,14 @@ Never commit your private key to source control. Use environment variables, a `.
181
182
 
182
183
  | Variable | Default | Description |
183
184
  |----------|---------|-------------|
184
- | `X402_PRIVATE_KEY` | — | EVM private key (hex, 0x-prefixed) for automatic x402 USDC payments on Base |
185
+ | `ONESOURCE_API_KEY` | — | OneSource API key for Bearer token auth. Takes priority over x402. |
186
+ | `X402_PRIVATE_KEY` | — | EVM private key (64-char hex, `0x` prefix optional) for automatic x402 USDC payments on Base |
185
187
  | `ONESOURCE_BASE_URL` | `https://skills.onesource.io` | API base URL |
186
188
  | `ONESOURCE_ANALYTICS` | — | Set to `false` to disable analytics |
187
189
 
188
190
  ## Troubleshooting
189
191
 
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.
192
+ **`1s_setup_check` shows "Not configured"** — Set either `ONESOURCE_API_KEY` or `X402_PRIVATE_KEY`. Reload the MCP server after setting either variable. If the key still isn't reaching the server, set it as a shell environment variable directly.
191
193
 
192
194
  **"MCP server onesource already exists" error** — Run `claude mcp remove onesource` first, then re-add.
193
195