datatoll-mcp 0.0.0-stage → 0.3.2

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,3 +1,119 @@
1
- # Temporary Holding Version
1
+ # DataToll Commercial Intelligence · Official MCP Server (`datatoll-mcp`)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-app.datatoll%2Fcommercial--intel-0f766e)](https://registry.modelcontextprotocol.io/v0/servers?search=app.datatoll/commercial-intel)
4
+ [![Glama MCP Score](https://glama.ai/mcp/connectors/app.datatoll/commercial-intel/badges/score.svg)](https://glama.ai/mcp/connectors/app.datatoll/commercial-intel)
5
+ [![npm version](https://img.shields.io/npm/v/datatoll-mcp?color=2563eb)](https://www.npmjs.com/package/datatoll-mcp)
6
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-339933)](https://nodejs.org/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-slate)](https://opensource.org/licenses/MIT)
8
+
9
+ Contract-validated commercial intelligence tools for AI agents and MCP clients: query live public **Google Ads Transparency creatives**, **4-in-1 ATS job boards (Ashby, Greenhouse, Lever & SmartRecruiters)**, and **Shopify product catalogs, variants & stock** in seconds — without managing headless browsers or proxy pools.
10
+
11
+ - **Free live preview**: Run `npx -y datatoll-mcp` without a wallet or API key. Call any `extract_*` tool with its usual selectors to get up to 5 live, `SchemaGuard`-validated items for free.
12
+ - **Billing**: Paid requests follow `Verify -> Extract -> SchemaGuard Validate -> Persist -> Settle -> Deliver`. Empty results, upstream anti-bot blocks, and layout drift cost **`$0.00`**.
13
+ - **Optional Base Mainnet `x402` Auto-Signing**: Configure a dedicated Base USDC key (`DATATOLL_EVM_PRIVATE_KEY`) to sign gasless EIP-3009 `TransferWithAuthorization` quotes locally (`$0.005–$0.008 USDC/call`, up to 100 items), protected by a hard client-side per-call cap (`DATATOLL_MAX_USDC`, default `$0.01`).
14
+
15
+ ---
16
+
17
+ ## Available MCP Tools
18
+
19
+ | Tool Name | Data Source | Pricing | Max Items / Call | Validated Key Fields |
20
+ | :--- | :--- | :--- | :--- | :--- |
21
+ | `preview_datatoll_sample` | Shopify / Google Ads / ATS | **Free (`$0.00`)** | 5 items | Live sample matching full contract schema (zero auth) |
22
+ | `extract_shopify_intel` | Public Shopify Storefronts | **`$0.005 USDC`** (`x402`) | 100 products | `product_id`, `title`, `price_min`, `discount_pct`, `in_stock`, `variant_count`, `product_url` |
23
+ | `extract_google_ads_intel` | Google Ads Transparency RPC | **`$0.006 USDC`** (`x402`) | 100 creatives | `creative_id`, `advertiser_name`, `ad_format`, `days_active`, `first_shown`, `last_shown`, `transparency_url` |
24
+ | `extract_ats_jobs_radar` | Ashby, Greenhouse, Lever, SmartRecruiters | **`$0.008 USDC`** (`x402`) | 100 postings | `job_id`, `ats_provider`, `company_slug`, `title`, `department`, `location`, `is_remote`, `salary_summary`, `job_url` |
25
+
26
+ > All tools declare MCP `annotations: { "readOnlyHint": true, "destructiveHint": false }` and return both human-readable JSON and typed `structuredContent` matching `outputSchema`.
27
+
28
+ ---
29
+
30
+ ## Quickstart
31
+
32
+ ### Option 1: Remote Streamable HTTP (Zero Install — Cursor, Claude Code, VS Code, Windsurf)
33
+
34
+ If your MCP client supports remote Streamable HTTP, connect to `/mcp/free` for automatic previews on unsigned `extract_*` calls:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "datatoll": {
40
+ "type": "http",
41
+ "url": "https://datatoll.app/mcp/free"
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ The standard `https://datatoll.app/mcp` endpoint returns an HTTP 402 quote for unsigned `extract_*` calls. Both endpoints accept x402 authorizations for full batches.
48
+
49
+ ### Option 2: Stdio Bridge — Free Preview Mode (Claude Desktop & Stdio Clients)
50
+
51
+ No environment variables are required. When an `extract_*` call receives an HTTP 402 quote, the bridge calls `preview_datatoll_sample` with the same selectors and returns up to 5 live items. Both preview modes share the same daily quota. When it runs out, the tool returns `preview_rate_limit_exceeded` with links for paid access.
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "datatoll": {
57
+ "command": "npx",
58
+ "args": ["-y", "datatoll-mcp"]
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ ### Option 3: Autonomous `x402` Auto-Pay Mode (Up to 100 Items / Call)
65
+
66
+ Install globally (so optional `viem` signing support is present) and attach a dedicated low-balance Base Mainnet wallet funded with `$1–$5 USDC` (EIP-3009 signatures are gasless — no ETH required):
67
+
68
+ ```bash
69
+ npm install -g datatoll-mcp
70
+ ```
71
+
72
+ ```json
73
+ {
74
+ "mcpServers": {
75
+ "datatoll": {
76
+ "command": "datatoll-mcp",
77
+ "env": {
78
+ "DATATOLL_EVM_PRIVATE_KEY": "0xYOUR_DEDICATED_AGENT_WALLET_KEY",
79
+ "DATATOLL_MAX_USDC": "0.01"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Environment Variables & Safety Controls
89
+
90
+ | Variable | Default | Description |
91
+ | :--- | :--- | :--- |
92
+ | `DATATOLL_MCP_URL` | `https://datatoll.app/mcp` | Upstream Streamable HTTP MCP endpoint |
93
+ | `DATATOLL_EVM_PRIVATE_KEY` | *(unset)* | Optional dedicated Base Mainnet private key for gasless EIP-3009 USDC signing. Never transmitted over the network — only bounded `X-PAYMENT` headers are sent |
94
+ | `DATATOLL_MAX_USDC` | `0.01` | Hard client-side per-call ceiling in USDC (`0 < value <= 1.0`). Quotes exceeding this limit are rejected locally before signing |
95
+
96
+ ### Verify Locally
97
+
98
+ ```bash
99
+ npx -y datatoll-mcp --self-test
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Bulk Exports (No Crypto Wallet Required)
105
+
106
+ Need 1,000+ rows on a recurring schedule or inside n8n / Make / Zapier? Run the same `SchemaGuard`-enforced extractors on Apify Store with a **`$0.00` start fee**:
107
+
108
+ - **Shopify Products, Prices & Inventory (`$0.50 / 1,000 items`)**: [`apify.com/tokenkite/shopify-intel`](https://apify.com/tokenkite/shopify-intel)
109
+ - **Google Ads Transparency Creatives (`$0.90 / 1,000 items`)**: [`apify.com/tokenkite/google-ads-intel`](https://apify.com/tokenkite/google-ads-intel)
110
+ - **Multi-ATS Job Postings Radar (`$1.40 / 1,000 items`)**: [`apify.com/tokenkite/ats-jobs-radar`](https://apify.com/tokenkite/ats-jobs-radar)
111
+
112
+ ---
113
+
114
+ ## Machine Discovery & Protocol Endpoints
115
+
116
+ - **Gateway & Pricing Docs**: [`https://datatoll.app/`](https://datatoll.app/)
117
+ - **Live Contract Catalog (`JSON`)**: [`https://datatoll.app/v1/catalog`](https://datatoll.app/v1/catalog)
118
+ - **x402 / Bazaar Discovery Manifest**: [`https://datatoll.app/.well-known/x402`](https://datatoll.app/.well-known/x402)
119
+ - **LLM Context (`llms.txt`)**: [`https://datatoll.app/llms.txt`](https://datatoll.app/llms.txt)
@@ -0,0 +1,416 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * DataToll MCP Stdio <-> Streamable HTTP Bridge (`datatoll-mcp`)
4
+ *
5
+ * - Zero-config mode: forwards JSON-RPC 2.0 over stdio to https://datatoll.app/mcp
6
+ * and retries unpaid `extract_*` calls with `preview_datatoll_sample` for up to
7
+ * 5 free, validated items.
8
+ * - Auto-pay x402 mode: set `DATATOLL_EVM_PRIVATE_KEY=0x...` to sign EIP-3009
9
+ * Base Mainnet USDC `TransferWithAuthorization` quotes up to `DATATOLL_MAX_USDC`
10
+ * (default `0.01` USDC per call).
11
+ */
12
+
13
+ import { deepStrictEqual } from 'node:assert';
14
+ import { randomBytes } from 'node:crypto';
15
+ import { createServer } from 'node:http';
16
+ import { createInterface } from 'node:readline';
17
+
18
+ const BASE_MAINNET_USDC = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
19
+ const DEFAULT_MCP_URL = 'https://datatoll.app/mcp';
20
+ const DEFAULT_MAX_USDC = '0.01';
21
+ const PACKAGE_VERSION = '0.3.2';
22
+
23
+ function parseUsdcToAtomic(usdcStr) {
24
+ const num = Number(usdcStr);
25
+ if (!Number.isFinite(num) || num <= 0 || num > 1) {
26
+ throw new Error(`Invalid DATATOLL_MAX_USDC value: ${usdcStr} (expected 0 < value <= 1.0)`);
27
+ }
28
+ return BigInt(Math.round(num * 1_000_000));
29
+ }
30
+
31
+ function formatGuidanceFrom402(body) {
32
+ const req = Array.isArray(body?.accepts) ? body.accepts[0] : null;
33
+ const amountUsdc = req?.maxAmountRequired
34
+ ? (Number(req.maxAmountRequired) / 1_000_000).toFixed(3)
35
+ : '0.005-0.008';
36
+ const resource = req?.resource || 'https://datatoll.app/v1/catalog';
37
+ const slug = resource.split('/').pop() || '';
38
+ const apifyUrl = slug
39
+ ? `https://apify.com/tokenkite/${slug}`
40
+ : 'https://apify.com/tokenkite';
41
+
42
+ return JSON.stringify(
43
+ {
44
+ error: 'payment_required',
45
+ charged: false,
46
+ quote_usdc: amountUsdc,
47
+ resource,
48
+ next_steps: {
49
+ free_preview:
50
+ 'Call `preview_datatoll_sample` right now for a free live preview (up to 5 validated items, $0 cost, no wallet needed).',
51
+ auto_x402_wallet:
52
+ 'Set env `DATATOLL_EVM_PRIVATE_KEY` (Base Mainnet wallet funded with $1 USDC) in your MCP server config to auto-sign single calls up to 100 items.',
53
+ bulk_apify_store: `For no-wallet bulk exports ($0 start fee), run on Apify Store: ${apifyUrl}`,
54
+ },
55
+ },
56
+ null,
57
+ 2,
58
+ );
59
+ }
60
+
61
+ async function signX402Requirement(req, privateKey, maxAtomic) {
62
+ if (!req || req.scheme !== 'exact' || req.network !== 'base') {
63
+ throw new Error(`Unsupported x402 scheme/network: ${req?.scheme}/${req?.network}`);
64
+ }
65
+ if (String(req.asset || '').toLowerCase() !== BASE_MAINNET_USDC.toLowerCase()) {
66
+ throw new Error(`Refusing non-USDC asset: ${req?.asset}`);
67
+ }
68
+ const value = BigInt(String(req.maxAmountRequired || '0'));
69
+ if (value <= 0n || value > maxAtomic) {
70
+ throw new Error(
71
+ `Quote ${value} atomic USDC exceeds safety cap ${maxAtomic} atomic USDC`,
72
+ );
73
+ }
74
+ let privateKeyToAccount;
75
+ try {
76
+ ({ privateKeyToAccount } = await import('viem/accounts'));
77
+ } catch {
78
+ throw new Error(
79
+ 'Optional dependency `viem` is required for DATATOLL_EVM_PRIVATE_KEY signing (`npm install -g datatoll-mcp`).',
80
+ );
81
+ }
82
+ const normalizedKey = privateKey.startsWith('0x') ? privateKey : `0x${privateKey}`;
83
+ const account = privateKeyToAccount(normalizedKey);
84
+ const nowSec = BigInt(Math.floor(Date.now() / 1000));
85
+ const validAfter = nowSec - 60n;
86
+ const timeoutSec = BigInt(Math.max(30, Number(req.maxTimeoutSeconds || 60)));
87
+ const validBefore = nowSec + timeoutSec;
88
+ const nonce = `0x${randomBytes(32).toString('hex')}`;
89
+
90
+ const signature = await account.signTypedData({
91
+ domain: {
92
+ name: req.extra?.name || 'USD Coin',
93
+ version: req.extra?.version || '2',
94
+ chainId: 8453,
95
+ verifyingContract: BASE_MAINNET_USDC,
96
+ },
97
+ types: {
98
+ TransferWithAuthorization: [
99
+ { name: 'from', type: 'address' },
100
+ { name: 'to', type: 'address' },
101
+ { name: 'value', type: 'uint256' },
102
+ { name: 'validAfter', type: 'uint256' },
103
+ { name: 'validBefore', type: 'uint256' },
104
+ { name: 'nonce', type: 'bytes32' },
105
+ ],
106
+ },
107
+ primaryType: 'TransferWithAuthorization',
108
+ message: {
109
+ from: account.address,
110
+ to: req.payTo,
111
+ value,
112
+ validAfter,
113
+ validBefore,
114
+ nonce,
115
+ },
116
+ });
117
+
118
+ const payment = {
119
+ x402Version: 1,
120
+ scheme: 'exact',
121
+ network: 'base',
122
+ resource: req.resource,
123
+ payload: {
124
+ signature,
125
+ authorization: {
126
+ from: account.address,
127
+ to: req.payTo,
128
+ value: value.toString(),
129
+ validAfter: validAfter.toString(),
130
+ validBefore: validBefore.toString(),
131
+ nonce,
132
+ },
133
+ },
134
+ };
135
+ return Buffer.from(JSON.stringify(payment), 'utf8').toString('base64');
136
+ }
137
+
138
+ export async function forwardRpcMessage(msg, options = {}) {
139
+ const endpoint = options.endpoint || process.env.DATATOLL_MCP_URL || DEFAULT_MCP_URL;
140
+ const privateKey = (options.privateKey ?? process.env.DATATOLL_EVM_PRIVATE_KEY ?? '').trim();
141
+ const maxAtomic = parseUsdcToAtomic(
142
+ options.maxUsdc || process.env.DATATOLL_MAX_USDC || DEFAULT_MAX_USDC,
143
+ );
144
+ const signFn = options.signFn || signX402Requirement;
145
+
146
+ const postJson = async (message, extraHeaders = {}) =>
147
+ fetch(endpoint, {
148
+ method: 'POST',
149
+ headers: {
150
+ 'Content-Type': 'application/json',
151
+ Accept: 'application/json',
152
+ ...extraHeaders,
153
+ },
154
+ body: JSON.stringify(message),
155
+ });
156
+
157
+ let resp = await postJson(msg);
158
+ if (resp.status === 202 || !('id' in msg)) {
159
+ return null;
160
+ }
161
+
162
+ if (resp.status === 402) {
163
+ const quoteBody = await resp.json().catch(() => ({}));
164
+ if (!privateKey) {
165
+ const { name, arguments: args } = msg.params ?? {};
166
+ if (msg.method === 'tools/call' && typeof name === 'string' && name.startsWith('extract_')
167
+ && args && typeof args === 'object' && !Array.isArray(args)) {
168
+ const previewArgs = {
169
+ source: name.slice('extract_'.length),
170
+ domain: args.domain ?? args.store_domain,
171
+ advertiser_id: args.advertiser_id,
172
+ provider: args.provider,
173
+ company: args.company ?? args.company_slug,
174
+ keyword: args.keyword,
175
+ remote_only: args.remote_only,
176
+ collection: args.collection ?? args.collection_handle,
177
+ };
178
+ const previewResp = await postJson({
179
+ jsonrpc: '2.0',
180
+ id: msg.id,
181
+ method: 'tools/call',
182
+ params: { name: 'preview_datatoll_sample', arguments: previewArgs },
183
+ }).catch(() => null);
184
+ const previewData = await previewResp?.json().catch(() => null);
185
+ if (previewResp?.status === 200 && previewData?.jsonrpc === '2.0') return previewData;
186
+ }
187
+ return {
188
+ jsonrpc: '2.0',
189
+ id: msg.id,
190
+ result: {
191
+ isError: true,
192
+ content: [{ type: 'text', text: formatGuidanceFrom402(quoteBody) }],
193
+ },
194
+ };
195
+ }
196
+ try {
197
+ const req = Array.isArray(quoteBody.accepts) ? quoteBody.accepts[0] : null;
198
+ const paymentHeader = await signFn(req, privateKey, maxAtomic);
199
+ resp = await postJson(msg, { 'X-PAYMENT': paymentHeader });
200
+ } catch (err) {
201
+ return {
202
+ jsonrpc: '2.0',
203
+ id: msg.id,
204
+ result: {
205
+ isError: true,
206
+ content: [
207
+ {
208
+ type: 'text',
209
+ text: JSON.stringify({
210
+ error: 'x402_client_signing_refused',
211
+ detail: err instanceof Error ? err.message : String(err),
212
+ }),
213
+ },
214
+ ],
215
+ },
216
+ };
217
+ }
218
+ }
219
+
220
+ const data = await resp.json().catch(() => null);
221
+ if (data && typeof data === 'object' && data.jsonrpc === '2.0') {
222
+ return data;
223
+ }
224
+ return {
225
+ jsonrpc: '2.0',
226
+ id: msg.id,
227
+ error: {
228
+ code: -32603,
229
+ message: `Upstream MCP HTTP ${resp.status}`,
230
+ },
231
+ };
232
+ }
233
+
234
+ async function runSelfTest() {
235
+ const assert = (cond, label) => {
236
+ if (!cond) throw new Error(`datatoll-mcp self-test failed: ${label}`);
237
+ };
238
+ const calls = [];
239
+ const sample = { preview: true, charged: false, items: [{ product_id: 'sample' }] };
240
+ const server = createServer((req, res) => {
241
+ let raw = '';
242
+ req.on('data', (c) => (raw += c));
243
+ req.on('end', () => {
244
+ const msg = JSON.parse(raw);
245
+ calls.push(msg);
246
+ if (msg.method === 'ping') {
247
+ res.writeHead(200, { 'Content-Type': 'application/json' });
248
+ res.end(JSON.stringify({ jsonrpc: '2.0', id: msg.id, result: {} }));
249
+ return;
250
+ }
251
+ if (msg.params?.name === 'preview_datatoll_sample') {
252
+ res.writeHead(200, { 'Content-Type': 'application/json' });
253
+ res.end(JSON.stringify({
254
+ jsonrpc: '2.0', id: msg.id, result: {
255
+ isError: false, structuredContent: sample,
256
+ content: [{ type: 'text', text: JSON.stringify(sample) }],
257
+ },
258
+ }));
259
+ return;
260
+ }
261
+ if (!req.headers['x-payment']) {
262
+ const amount = msg.params?.arguments?.expensive ? '99000' : '5000';
263
+ res.writeHead(402, { 'Content-Type': 'application/json' });
264
+ res.end(
265
+ JSON.stringify({
266
+ x402Version: 1,
267
+ accepts: [
268
+ {
269
+ scheme: 'exact',
270
+ network: 'base',
271
+ maxAmountRequired: amount,
272
+ resource: 'https://datatoll.app/v1/extract/shopify-intel',
273
+ payTo: '0xAA8cf6a43994E976f1Dbed70D3Bf60371FE93A40',
274
+ asset: BASE_MAINNET_USDC,
275
+ },
276
+ ],
277
+ }),
278
+ );
279
+ return;
280
+ }
281
+ res.writeHead(200, { 'Content-Type': 'application/json' });
282
+ res.end(
283
+ JSON.stringify({
284
+ jsonrpc: '2.0',
285
+ id: msg.id,
286
+ result: { isError: false, content: [{ type: 'text', text: '{"ok":true}' }] },
287
+ }),
288
+ );
289
+ });
290
+ });
291
+
292
+ await new Promise((r) => server.listen(0, '127.0.0.1', r));
293
+ const port = server.address().port;
294
+ const endpoint = `http://127.0.0.1:${port}/mcp`;
295
+
296
+ try {
297
+ const ping = await forwardRpcMessage({ jsonrpc: '2.0', id: 1, method: 'ping' }, { endpoint });
298
+ assert(ping.result && ping.id === 1, 'ping forwarded');
299
+
300
+ const extract = {
301
+ jsonrpc: '2.0', id: 'preview', method: 'tools/call',
302
+ params: {
303
+ name: 'extract_shopify_intel', arguments: { domain: 'www.beardbrand.com', max_products: 25 },
304
+ },
305
+ };
306
+ const preview = await forwardRpcMessage(extract, { endpoint, privateKey: '' });
307
+ deepStrictEqual(calls.slice(1), [extract, {
308
+ jsonrpc: '2.0', id: extract.id, method: 'tools/call', params: {
309
+ name: 'preview_datatoll_sample',
310
+ arguments: { source: 'shopify_intel', domain: 'www.beardbrand.com' },
311
+ },
312
+ }]);
313
+ assert(preview.id === extract.id && preview.result?.isError === false, 'free preview returned');
314
+ deepStrictEqual(preview.result.structuredContent, sample);
315
+
316
+ const unpaid = await forwardRpcMessage(
317
+ { jsonrpc: '2.0', id: 2, method: 'tools/call', params: { name: 'extract_shopify_intel' } },
318
+ { endpoint, privateKey: '' },
319
+ );
320
+ assert(unpaid.result?.isError === true, 'unpaid 402 translated to CallToolResult');
321
+ assert(
322
+ unpaid.result.content[0].text.includes('preview_datatoll_sample'),
323
+ 'guidance points to free preview tool',
324
+ );
325
+
326
+ const capped = await forwardRpcMessage(
327
+ {
328
+ jsonrpc: '2.0',
329
+ id: 3,
330
+ method: 'tools/call',
331
+ params: { name: 'extract_shopify_intel', arguments: { expensive: true } },
332
+ },
333
+ { endpoint, privateKey: '0x' + '11'.repeat(32), maxUsdc: '0.01' },
334
+ );
335
+ assert(
336
+ capped.result?.isError === true &&
337
+ capped.result.content[0].text.includes('exceeds safety cap'),
338
+ 'safety cap blocks quotes above $0.01 USDC',
339
+ );
340
+
341
+ const signed = await forwardRpcMessage(
342
+ { jsonrpc: '2.0', id: 4, method: 'tools/call', params: { name: 'extract_shopify_intel' } },
343
+ {
344
+ endpoint,
345
+ privateKey: '0x' + '22'.repeat(32),
346
+ signFn: async () => Buffer.from('{"ok":1}').toString('base64'),
347
+ },
348
+ );
349
+ assert(signed.result?.isError === false && calls.length === 7, 'paid retry succeeds');
350
+ console.log('DataToll datatoll-mcp.mjs self-test PASS (5/5)');
351
+ } finally {
352
+ server.close();
353
+ }
354
+ }
355
+
356
+ async function main() {
357
+ if (process.argv.includes('--version') || process.argv.includes('-v')) {
358
+ console.log(PACKAGE_VERSION);
359
+ return;
360
+ }
361
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
362
+ console.log(
363
+ [
364
+ `datatoll-mcp v${PACKAGE_VERSION} — Official MCP stdio bridge for DataToll Commercial Intelligence`,
365
+ '',
366
+ 'Usage:',
367
+ ' npx -y datatoll-mcp Start MCP JSON-RPC 2.0 stdio bridge -> https://datatoll.app/mcp',
368
+ ' npx -y datatoll-mcp --self-test Run offline protocol & x402 safety-cap self-tests',
369
+ ' npx -y datatoll-mcp --version Print package version',
370
+ '',
371
+ 'Environment Variables:',
372
+ ' DATATOLL_MCP_URL Override upstream MCP endpoint (default: https://datatoll.app/mcp)',
373
+ ' DATATOLL_EVM_PRIVATE_KEY Optional Base Mainnet key to auto-sign EIP-3009 USDC x402 quotes',
374
+ ' DATATOLL_MAX_USDC Local per-call USDC ceiling when auto-signing (default: 0.01)',
375
+ ].join('\n'),
376
+ );
377
+ return;
378
+ }
379
+ if (process.argv.includes('--self-test')) {
380
+ await runSelfTest();
381
+ return;
382
+ }
383
+ const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });
384
+ for await (const line of rl) {
385
+ const trimmed = line.trim();
386
+ if (!trimmed) continue;
387
+ let msg;
388
+ try {
389
+ msg = JSON.parse(trimmed);
390
+ } catch {
391
+ process.stdout.write(
392
+ JSON.stringify({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } }) +
393
+ '\n',
394
+ );
395
+ continue;
396
+ }
397
+ try {
398
+ const reply = await forwardRpcMessage(msg);
399
+ if (reply !== null) {
400
+ process.stdout.write(JSON.stringify(reply) + '\n');
401
+ }
402
+ } catch (err) {
403
+ if ('id' in msg) {
404
+ process.stdout.write(
405
+ JSON.stringify({
406
+ jsonrpc: '2.0',
407
+ id: msg.id,
408
+ error: { code: -32603, message: err instanceof Error ? err.message : String(err) },
409
+ }) + '\n',
410
+ );
411
+ }
412
+ }
413
+ }
414
+ }
415
+
416
+ await main();
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "datatoll-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.2",
4
+ "mcpName": "app.datatoll/commercial-intel",
5
+ "description": "Official MCP stdio & x402 bridge for DataToll Commercial Intelligence — contract-validated Google Ads Transparency, multi-ATS jobs & Shopify pricing/stock with free live previews.",
6
+ "author": "TokenKite Labs (https://datatoll.app)",
7
+ "license": "MIT",
8
+ "type": "module",
9
+ "bin": {
10
+ "datatoll-mcp": "bin/datatoll-mcp.mjs"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "README.md"
15
+ ],
16
+ "engines": {
17
+ "node": ">=20.0.0"
18
+ },
19
+ "optionalDependencies": {
20
+ "viem": "^2.21.0"
21
+ },
22
+ "scripts": {
23
+ "test": "node ./bin/datatoll-mcp.mjs --self-test"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/ByKite/datatoll-mcp.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/ByKite/datatoll-mcp/issues"
31
+ },
32
+ "homepage": "https://datatoll.app/",
33
+ "keywords": [
34
+ "mcp",
35
+ "mcp-server",
36
+ "model-context-protocol",
37
+ "claude-desktop",
38
+ "cursor",
39
+ "windsurf",
40
+ "x402",
41
+ "coinbase-x402",
42
+ "base",
43
+ "usdc",
44
+ "google-ads",
45
+ "ad-intelligence",
46
+ "shopify",
47
+ "ecommerce",
48
+ "ats-jobs",
49
+ "greenhouse",
50
+ "ashby",
51
+ "lever",
52
+ "smartrecruiters",
53
+ "commercial-intelligence"
54
+ ]
55
+ }