@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 +50 -48
- package/README.npm.md +50 -48
- package/README.repo.md +349 -327
- package/dist/analytics.d.ts +3 -2
- package/dist/analytics.d.ts.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +72 -45
- package/dist/cli.js.map +1 -1
- package/dist/create-server.d.ts +5 -9
- package/dist/create-server.d.ts.map +1 -1
- package/dist/create-server.js +7 -6
- package/dist/create-server.js.map +1 -1
- package/dist/register-api-tools.d.ts +2 -0
- package/dist/register-api-tools.d.ts.map +1 -1
- package/dist/register-api-tools.js +3 -2
- package/dist/register-api-tools.js.map +1 -1
- package/dist/register-bug-report-tool.js +1 -1
- package/dist/register-bug-report-tool.js.map +1 -1
- package/dist/register-docs-tools.d.ts +6 -11
- package/dist/register-docs-tools.d.ts.map +1 -1
- package/dist/register-docs-tools.js +126 -62
- package/dist/register-docs-tools.js.map +1 -1
- package/package.json +3 -3
- package/skills/onesource-mcp-setup/SKILL.md +6 -10
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Register
|
|
2
|
+
* Register docs tools from @one-source/docs-mcp onto a shared McpServer.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Analytics events use service: 'onesource-docs', category: 'docs'.
|
|
4
|
+
* NOTE: Docs tools are temporarily disabled (product not yet released).
|
|
5
|
+
* Code is commented out for easy re-enable. Only 1s_setup_check remains active.
|
|
7
6
|
*/
|
|
8
7
|
import { createHash } from 'node:crypto';
|
|
9
|
-
import { loadData } from '@one-source/docs-mcp';
|
|
10
|
-
import { searchDocsSchema, handleSearchDocs } from '@one-source/docs-mcp/tools/search-docs';
|
|
11
|
-
import { getQueryReferenceSchema, handleGetQueryReference } from '@one-source/docs-mcp/tools/get-query-reference';
|
|
12
|
-
import { getTypeDefinitionSchema, handleGetTypeDefinition } from '@one-source/docs-mcp/tools/get-type-definition';
|
|
13
|
-
import { listExamplesSchema, handleListExamples } from '@one-source/docs-mcp/tools/list-examples';
|
|
14
|
-
import { listSupportedChainsSchema, handleListSupportedChains } from '@one-source/docs-mcp/tools/list-supported-chains';
|
|
15
|
-
import { getFilterReferenceSchema, handleGetFilterReference } from '@one-source/docs-mcp/tools/get-filter-reference';
|
|
16
|
-
import { getPaginationGuideSchema, handleGetPaginationGuide } from '@one-source/docs-mcp/tools/get-pagination-guide';
|
|
17
|
-
import { getSchemaOverviewSchema, handleGetSchemaOverview } from '@one-source/docs-mcp/tools/get-schema-overview';
|
|
18
|
-
import { getAuthenticationGuideSchema, handleGetAuthenticationGuide } from '@one-source/docs-mcp/tools/get-authentication-guide';
|
|
19
|
-
import { getMcpSetupGuideSchema, handleGetMcpSetupGuide } from '@one-source/docs-mcp/tools/get-mcp-setup-guide';
|
|
20
8
|
import { VERSION } from './version.js';
|
|
21
9
|
function hashSession(sessionId) {
|
|
22
10
|
if (!sessionId)
|
|
@@ -88,20 +76,70 @@ handler) {
|
|
|
88
76
|
*/
|
|
89
77
|
export function registerDocsTools(opts) {
|
|
90
78
|
const { server, analytics, transport } = opts;
|
|
91
|
-
const { sections, index, schema } = opts.data ?? loadData();
|
|
92
|
-
instrumentedTool(server, analytics, transport,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
instrumentedTool(server, analytics, transport,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
// const { sections, index, schema } = opts.data ?? loadData();
|
|
80
|
+
// instrumentedTool(server, analytics, transport,
|
|
81
|
+
// 'search_docs',
|
|
82
|
+
// 'Search OneSource documentation by keyword. Returns the top 5 matching sections.',
|
|
83
|
+
// searchDocsSchema.shape,
|
|
84
|
+
// (input) => handleSearchDocs(input, index),
|
|
85
|
+
// );
|
|
86
|
+
// instrumentedTool(server, analytics, transport,
|
|
87
|
+
// 'get_query_reference',
|
|
88
|
+
// 'Get full reference for a OneSource root GraphQL query — arguments, filters, return type. There are 12 root queries: address, addresses, block, blocks, contract, contracts, nft, nfts, token, tokens, transaction, transactions.',
|
|
89
|
+
// getQueryReferenceSchema.shape,
|
|
90
|
+
// (input) => handleGetQueryReference(input, schema),
|
|
91
|
+
// );
|
|
92
|
+
// instrumentedTool(server, analytics, transport,
|
|
93
|
+
// 'get_type_definition',
|
|
94
|
+
// 'Get the schema definition for a GraphQL type, enum, scalar, input, or interface. Returns fields, values, and descriptions.',
|
|
95
|
+
// getTypeDefinitionSchema.shape,
|
|
96
|
+
// (input) => handleGetTypeDefinition(input, schema),
|
|
97
|
+
// );
|
|
98
|
+
// instrumentedTool(server, analytics, transport,
|
|
99
|
+
// 'list_examples',
|
|
100
|
+
// 'List or search working GraphQL examples. Without a topic, returns a summary of all available examples. With a topic, returns full example content matching that keyword.',
|
|
101
|
+
// listExamplesSchema.shape,
|
|
102
|
+
// (input) => handleListExamples(input, sections),
|
|
103
|
+
// );
|
|
104
|
+
// instrumentedTool(server, analytics, transport,
|
|
105
|
+
// 'list_supported_chains',
|
|
106
|
+
// 'List all blockchain networks supported by OneSource with endpoint URLs.',
|
|
107
|
+
// listSupportedChainsSchema.shape,
|
|
108
|
+
// () => handleListSupportedChains(),
|
|
109
|
+
// );
|
|
110
|
+
// instrumentedTool(server, analytics, transport,
|
|
111
|
+
// 'get_filter_reference',
|
|
112
|
+
// 'Get all filter fields and operators for a list query (e.g. transactions, tokens).',
|
|
113
|
+
// getFilterReferenceSchema.shape,
|
|
114
|
+
// (input) => handleGetFilterReference(input, schema),
|
|
115
|
+
// );
|
|
116
|
+
// instrumentedTool(server, analytics, transport,
|
|
117
|
+
// 'get_pagination_guide',
|
|
118
|
+
// 'Get the cursor-based pagination pattern with examples for a list query.',
|
|
119
|
+
// getPaginationGuideSchema.shape,
|
|
120
|
+
// (input) => handleGetPaginationGuide(input, schema),
|
|
121
|
+
// );
|
|
122
|
+
// instrumentedTool(server, analytics, transport,
|
|
123
|
+
// 'get_schema_overview',
|
|
124
|
+
// 'Get a high-level summary of the entire GraphQL schema — all queries, types, enums, and scalars.',
|
|
125
|
+
// getSchemaOverviewSchema.shape,
|
|
126
|
+
// () => handleGetSchemaOverview(schema),
|
|
127
|
+
// );
|
|
128
|
+
// instrumentedTool(server, analytics, transport,
|
|
129
|
+
// 'get_authentication_guide',
|
|
130
|
+
// 'Get the authentication guide — API key format, endpoints, headers, and common mistakes.',
|
|
131
|
+
// getAuthenticationGuideSchema.shape,
|
|
132
|
+
// () => handleGetAuthenticationGuide(),
|
|
133
|
+
// );
|
|
134
|
+
// instrumentedTool(server, analytics, transport,
|
|
135
|
+
// 'get_mcp_setup_guide',
|
|
136
|
+
// 'Get the MCP installation and setup guide — quickstart, per-client instructions, authentication (API key or x402), configuration, and individual MCP packages. Use the topic parameter to focus on a specific area.',
|
|
137
|
+
// getMcpSetupGuideSchema.shape,
|
|
138
|
+
// (input) => handleGetMcpSetupGuide(input, sections),
|
|
139
|
+
// );
|
|
140
|
+
const authMethod = opts.authMethod;
|
|
103
141
|
const x402Address = opts.x402Address;
|
|
104
|
-
instrumentedTool(server, analytics, transport, '1s_setup_check', 'Check OneSource MCP server health — version (current vs latest),
|
|
142
|
+
instrumentedTool(server, analytics, transport, '1s_setup_check', 'Check OneSource MCP server health — version (current vs latest), authentication status (API key or x402), API connectivity, and setup instructions if anything is missing. Free, no authentication required. Call this first when troubleshooting.', {}, async () => {
|
|
105
143
|
const parts = [];
|
|
106
144
|
// 1. Server version
|
|
107
145
|
parts.push('## Server Version\n');
|
|
@@ -124,35 +162,68 @@ export function registerDocsTools(opts) {
|
|
|
124
162
|
else if (latestVersion === VERSION) {
|
|
125
163
|
parts.push('\nYou are on the latest version.');
|
|
126
164
|
}
|
|
127
|
-
// 2.
|
|
128
|
-
parts.push('\n##
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
// 2. Authentication status
|
|
166
|
+
parts.push('\n## Authentication\n');
|
|
167
|
+
const runtimeApiKey = process.env.ONESOURCE_API_KEY;
|
|
168
|
+
const runtimeX402Key = process.env.X402_PRIVATE_KEY;
|
|
169
|
+
const bothSet = !!(runtimeApiKey && runtimeX402Key);
|
|
170
|
+
// Use authMethod from startup; fall back to runtime env check for robustness
|
|
171
|
+
const activeMethod = authMethod ?? (runtimeApiKey ? 'api_key' : runtimeX402Key ? 'x402' : 'none');
|
|
172
|
+
if (activeMethod === 'api_key') {
|
|
173
|
+
parts.push('Status: **Configured (API key)**');
|
|
174
|
+
if (bothSet) {
|
|
175
|
+
parts.push('\n⚠️ Both `ONESOURCE_API_KEY` and `X402_PRIVATE_KEY` are set. API key takes priority; x402 is not used.');
|
|
176
|
+
}
|
|
177
|
+
parts.push('\nAPI key authentication is active. Blockchain API tools are ready to use.');
|
|
134
178
|
}
|
|
135
|
-
else if (
|
|
136
|
-
parts.push('Status: **Configured
|
|
179
|
+
else if (activeMethod === 'x402') {
|
|
180
|
+
parts.push('Status: **Configured (x402)**');
|
|
181
|
+
if (x402Address) {
|
|
182
|
+
parts.push(`Wallet: \`${x402Address}\``);
|
|
183
|
+
}
|
|
184
|
+
parts.push('\nThis wallet must hold USDC on the **Base** network to pay for API calls.');
|
|
137
185
|
}
|
|
138
186
|
else {
|
|
139
187
|
parts.push('Status: **Not configured**');
|
|
140
|
-
parts.push('\nBlockchain API tools require
|
|
141
|
-
parts.push('###
|
|
188
|
+
parts.push('\nBlockchain API tools require authentication. Choose one of the options below.\n');
|
|
189
|
+
parts.push('### Option 1: API Key (recommended)\n');
|
|
190
|
+
parts.push('Set `ONESOURCE_API_KEY` with your OneSource API key.\n');
|
|
191
|
+
parts.push('**Claude Code:**');
|
|
192
|
+
parts.push('```');
|
|
193
|
+
parts.push('claude mcp remove onesource');
|
|
194
|
+
parts.push('claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest');
|
|
195
|
+
parts.push('```\n');
|
|
196
|
+
parts.push('**Claude Desktop / Cursor:**');
|
|
197
|
+
parts.push('```json');
|
|
198
|
+
parts.push('{');
|
|
199
|
+
parts.push(' "mcpServers": {');
|
|
200
|
+
parts.push(' "onesource": {');
|
|
201
|
+
parts.push(' "command": "npx",');
|
|
202
|
+
parts.push(' "args": ["-y", "@one-source/mcp@latest"],');
|
|
203
|
+
parts.push(' "env": { "ONESOURCE_API_KEY": "<key>" }');
|
|
204
|
+
parts.push(' }');
|
|
205
|
+
parts.push(' }');
|
|
206
|
+
parts.push('}');
|
|
207
|
+
parts.push('```\n');
|
|
208
|
+
parts.push('**Any MCP client (stdio):**');
|
|
209
|
+
parts.push('```');
|
|
210
|
+
parts.push('ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest');
|
|
211
|
+
parts.push('```\n');
|
|
212
|
+
parts.push('### Option 2: x402 Micropayments\n');
|
|
213
|
+
parts.push('Set `X402_PRIVATE_KEY` with an EVM private key (64-char hex, `0x` prefix optional) funded with USDC on Base.\n');
|
|
142
214
|
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
215
|
parts.push(' ```');
|
|
145
|
-
parts.push(' #
|
|
216
|
+
parts.push(' # macOS/Linux or Git Bash on Windows');
|
|
146
217
|
parts.push(' echo "0x$(openssl rand -hex 32)"');
|
|
147
218
|
parts.push(' ```\n');
|
|
148
|
-
parts.push('2. **Fund the wallet** with USDC on the **Base** network (not Ethereum mainnet)
|
|
149
|
-
parts.push('3. **Set the key
|
|
219
|
+
parts.push('2. **Fund the wallet** with USDC on the **Base** network (not Ethereum mainnet).\n');
|
|
220
|
+
parts.push('3. **Set the key:**\n');
|
|
150
221
|
parts.push(' **Claude Code:**');
|
|
151
222
|
parts.push(' ```');
|
|
152
223
|
parts.push(' claude mcp remove onesource');
|
|
153
224
|
parts.push(' claude mcp add onesource -e X402_PRIVATE_KEY=0x... -- npx -y @one-source/mcp@latest');
|
|
154
225
|
parts.push(' ```\n');
|
|
155
|
-
parts.push(' **Claude Desktop / Cursor
|
|
226
|
+
parts.push(' **Claude Desktop / Cursor:**');
|
|
156
227
|
parts.push(' ```json');
|
|
157
228
|
parts.push(' {');
|
|
158
229
|
parts.push(' "mcpServers": {');
|
|
@@ -168,20 +239,14 @@ export function registerDocsTools(opts) {
|
|
|
168
239
|
parts.push(' ```');
|
|
169
240
|
parts.push(' X402_PRIVATE_KEY=0x... npx -y @one-source/mcp@latest');
|
|
170
241
|
parts.push(' ```\n');
|
|
171
|
-
parts.push('
|
|
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.');
|
|
242
|
+
parts.push('4. **Reload the MCP server** — run `/reload-plugins` in Claude Code, or restart Claude Desktop / Cursor.\n');
|
|
243
|
+
parts.push('**Security:** Never commit keys to source control. Use environment variables or a secrets manager.\n');
|
|
179
244
|
}
|
|
180
245
|
// 3. API connectivity
|
|
181
246
|
parts.push('\n## API Connectivity\n');
|
|
182
247
|
const baseUrl = process.env.ONESOURCE_BASE_URL ?? 'https://skills.onesource.io';
|
|
183
248
|
try {
|
|
184
|
-
|
|
249
|
+
await fetch(baseUrl, { method: 'HEAD', signal: AbortSignal.timeout(5000) });
|
|
185
250
|
parts.push(`Backend: **Reachable** (${baseUrl})`);
|
|
186
251
|
}
|
|
187
252
|
catch (err) {
|
|
@@ -191,24 +256,23 @@ export function registerDocsTools(opts) {
|
|
|
191
256
|
// 4. Transport
|
|
192
257
|
parts.push('\n## Transport\n');
|
|
193
258
|
parts.push(`Mode: ${transport ?? 'unknown'}`);
|
|
194
|
-
//
|
|
259
|
+
// 5. Bug reporting
|
|
195
260
|
parts.push('\n## Bug Reporting\n');
|
|
196
261
|
parts.push('Status: **Enabled** — call `1s_report_bug` to report issues to the OneSource team.');
|
|
197
|
-
//
|
|
262
|
+
// 6. Next steps
|
|
198
263
|
parts.push('\n## Next Steps\n');
|
|
199
|
-
if (
|
|
200
|
-
parts.push('- Configure
|
|
264
|
+
if (activeMethod === 'none') {
|
|
265
|
+
parts.push('- Configure authentication to use blockchain API tools (see instructions above)');
|
|
201
266
|
}
|
|
202
267
|
if (latestVersion !== 'unknown' && latestVersion !== VERSION) {
|
|
203
268
|
parts.push('- Update to the latest version: `npx -y @one-source/mcp@latest`');
|
|
204
269
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
parts.push('- Try a paid API tool: `1s_network_info` (returns chain ID, block number, gas price)');
|
|
270
|
+
if (activeMethod !== 'none') {
|
|
271
|
+
parts.push('- Try an API tool: `1s_network_info` (returns chain ID, block number, gas price)');
|
|
208
272
|
}
|
|
209
273
|
return parts.join('\n');
|
|
210
274
|
});
|
|
211
|
-
return
|
|
275
|
+
return 1;
|
|
212
276
|
}
|
|
213
|
-
export { loadData };
|
|
277
|
+
// export { loadData, type LoadedData };
|
|
214
278
|
//# sourceMappingURL=register-docs-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-docs-tools.js","sourceRoot":"","sources":["../src/register-docs-tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"register-docs-tools.js","sourceRoot":"","sources":["../src/register-docs-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;A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1",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "Unified MCP server for OneSource —
|
|
6
|
+
"description": "Unified MCP server for OneSource — 24 tools for blockchain data",
|
|
7
7
|
"bin": {
|
|
8
8
|
"onesource-mcp": "./dist/cli.js"
|
|
9
9
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
32
|
-
"@one-source/api-mcp": "^
|
|
32
|
+
"@one-source/api-mcp": "^5.0.0",
|
|
33
33
|
"@one-source/docs-mcp": "^4.0.3",
|
|
34
34
|
"zod": "^3.24.0"
|
|
35
35
|
},
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
|
|
10
10
|
# OneSource MCP Setup Guide
|
|
11
11
|
|
|
12
|
-
OneSource MCP provides
|
|
12
|
+
OneSource MCP provides 24 tools for blockchain data and live chain queries. Blockchain API tools require authentication — either an API key (`ONESOURCE_API_KEY`) or x402 micropayments in USDC on the Base network (`X402_PRIVATE_KEY`).
|
|
13
13
|
|
|
14
14
|
## Before You Start
|
|
15
15
|
|
|
@@ -21,8 +21,6 @@ OneSource MCP provides 34 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
|
-
|
|
26
24
|
## Step 1: Check Current Installation
|
|
27
25
|
|
|
28
26
|
Call the `1s_setup_check` tool. It reports:
|
|
@@ -74,9 +72,7 @@ To update, reinstall with `@latest` or clear the npx cache: `npx -y @one-source/
|
|
|
74
72
|
|
|
75
73
|
## Step 3: Get an EVM Private Key
|
|
76
74
|
|
|
77
|
-
The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It
|
|
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`.
|
|
75
|
+
The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by MetaMask, Coinbase Wallet, or Foundry. It is a 64-character hex string. The `0x` prefix is optional — both formats are accepted.
|
|
80
76
|
|
|
81
77
|
### Option A: Export from MetaMask
|
|
82
78
|
|
|
@@ -84,7 +80,7 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
|
|
|
84
80
|
2. Click the three dots next to the account name
|
|
85
81
|
3. Go to **Account details** > **Show private key**
|
|
86
82
|
4. Enter your MetaMask password
|
|
87
|
-
5. Copy the key
|
|
83
|
+
5. Copy the key
|
|
88
84
|
|
|
89
85
|
### Option B: Export from Coinbase Wallet
|
|
90
86
|
|
|
@@ -95,7 +91,7 @@ The `X402_PRIVATE_KEY` is an EVM wallet private key — the same kind used by Me
|
|
|
95
91
|
|
|
96
92
|
```bash
|
|
97
93
|
# Using OpenSSL (macOS/Linux, or Git Bash on Windows)
|
|
98
|
-
|
|
94
|
+
openssl rand -hex 32
|
|
99
95
|
|
|
100
96
|
# Using Foundry (if installed)
|
|
101
97
|
cast wallet new
|
|
@@ -103,7 +99,7 @@ cast wallet new
|
|
|
103
99
|
|
|
104
100
|
```powershell
|
|
105
101
|
# PowerShell (Windows)
|
|
106
|
-
|
|
102
|
+
-join ((1..32) | ForEach-Object { "{0:x2}" -f (Get-Random -Max 256) })
|
|
107
103
|
```
|
|
108
104
|
|
|
109
105
|
**Important:** Use a dedicated wallet for MCP payments — do not use your primary wallet with large holdings. Transfer only what you need.
|
|
@@ -251,6 +247,6 @@ After setting the key, reload and verify:
|
|
|
251
247
|
| "MCP server onesource already exists" error | Run `claude mcp remove onesource` first, then re-add it with your updated config. |
|
|
252
248
|
| Config changed but nothing happened | Run `/reload-plugins` in Claude Code to reload MCP servers, then `/mcp` to check connection status. |
|
|
253
249
|
| Tool returns HTTP 402 error | x402 is not configured, or the wallet has insufficient USDC on Base. |
|
|
254
|
-
| "x402 setup failed" in server logs | The private key format is wrong. It must be a 64-character hex string
|
|
250
|
+
| "x402 setup failed" in server logs | The private key format is wrong. It must be a 64-character hex string (with or without `0x` prefix). |
|
|
255
251
|
| Key is set but wallet shows 0 USDC | Make sure USDC is on the **Base** network, not Ethereum mainnet or another chain. |
|
|
256
252
|
| Tools work but results seem stale | Check `1s_setup_check` for version — you may need to update to the latest. |
|