grid402-mcp 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +11 -5
- package/package.json +2 -2
- package/tools.mjs +54 -4
package/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Grid402 Official Model Context Protocol (MCP) Server
|
|
5
|
-
* Exposes
|
|
5
|
+
* Exposes 27 tools for real-time open data and M2M network utilities with Multi-Chain x402 USDC settlement.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
@@ -11,16 +11,16 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
|
|
|
11
11
|
import { MCP_TOOLS_DEFINITIONS, executeGrid402Request, DEFAULT_ENDPOINT } from './tools.mjs';
|
|
12
12
|
|
|
13
13
|
export const GRID402_MCP_INSTRUCTIONS = [
|
|
14
|
-
'Grid402 is a verifiable public-data and network utility M2M oracle settled via HTTP x402 (
|
|
15
|
-
'Tool selection: use free tools first (`grid402_summary` for
|
|
16
|
-
'Authentication and Payment modes: (1) Set `GRID402_SANDBOX=true` for free sandbox testing via `X-Payment: demo` (
|
|
14
|
+
'Grid402 is a verifiable public-data and network utility M2M oracle settled via HTTP x402 (gasless PayAI exact on Base, Polygon, Arbitrum, and Solana; plus Optimism and Ethereum Session Pass top-ups).',
|
|
15
|
+
'Tool selection: use free tools first (`grid402_summary` for 25-service health, `grid402_pass_balance` for prepaid pass quota/spend-controls, `grid402_verify` for offline-equivalent ECDSA secp256k1 proof verification). Prefer composite bundles (`grid402_domain_audit`, `grid402_kyb_audit`, `grid402_get_dossier_360`, `grid402_market_snapshot`) over multiple separate calls to reduce cost and latency, and use `grid402_extract` (URL-to-Markdown) or `grid402_email_verify` (Zero-PII MX/SPF/DMARC) for high-volume web and lead workflows.',
|
|
16
|
+
'Authentication and Payment modes: (1) Set `GRID402_SANDBOX=true` for free sandbox testing via `X-Payment: demo` (3 queries/day per IP); (2) Set `GRID402_SESSION_PASS=pass_g402_...` for <15ms prepaid calls (`1 credit = 0.0050 USDC`, zero per-call gas); (3) Set `GRID402_PRIVATE_KEY` using a dedicated low-balance operational wallet for automatic on-chain settlement.',
|
|
17
17
|
'Spend controls and error handling: paid tools return `_oracle_proof` (ECDSA secp256k1) and `_meta` (upstream source and TTL). When HTTP 402 (`payment_required: true`) is returned without credentials, present the fee (`0.0050`–`0.0500` USDC) and free `preview` teaser instead of retrying blindly. Respect HTTP 429 (`PassDailyLimitExceeded`, `SandboxRateLimitExceeded`) and HTTP 403 (`PassEndpointNotAllowed`).',
|
|
18
18
|
].join(' ');
|
|
19
19
|
|
|
20
20
|
const server = new Server(
|
|
21
21
|
{
|
|
22
22
|
name: 'grid402-mcp-server',
|
|
23
|
-
version: '
|
|
23
|
+
version: '2.0.0',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
capabilities: {
|
|
@@ -111,6 +111,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
111
111
|
case 'grid402_global_markets':
|
|
112
112
|
service = 'global-markets';
|
|
113
113
|
break;
|
|
114
|
+
case 'grid402_extract':
|
|
115
|
+
service = 'extract';
|
|
116
|
+
break;
|
|
117
|
+
case 'grid402_email_verify':
|
|
118
|
+
service = 'email-verify';
|
|
119
|
+
break;
|
|
114
120
|
case 'grid402_pass':
|
|
115
121
|
service = 'pass';
|
|
116
122
|
break;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grid402-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Official Model Context Protocol (MCP) Server for Grid402 - The Verifiable Data and HTTP x402 Payment Layer for Autonomous AI Agents (
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Official Model Context Protocol (MCP) Server for Grid402 - The Verifiable Data and HTTP x402 Payment Layer for Autonomous AI Agents (27 MCP Tools: Web-to-Markdown Extractor, Zero-PII Email Verifier, KYB 360 AI Dossier, Financial Markets, Compliance, Global LEI, OFAC AML, Network Audits) with gasless PayAI x402 across Base, Polygon, Arbitrum and Solana.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"grid402-mcp": "index.mjs"
|
package/tools.mjs
CHANGED
|
@@ -7,12 +7,12 @@ import { settleX402Payment } from './x402_payer.mjs';
|
|
|
7
7
|
export const DEFAULT_ENDPOINT = process.env.GRID402_ENDPOINT || process.env.GRID402_API_URL || 'https://grid402.online';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Definições formais das
|
|
10
|
+
* Definições formais das 27 ferramentas no padrão MCP (25 micro-serviços + summary + pass_balance)
|
|
11
11
|
*/
|
|
12
12
|
export const MCP_TOOLS_DEFINITIONS = [
|
|
13
13
|
{
|
|
14
14
|
name: 'grid402_summary',
|
|
15
|
-
description: 'Consulta o resumo consolidado de saúde e disponibilidade dos
|
|
15
|
+
description: 'Consulta o resumo consolidado de saúde e disponibilidade dos 25 micro-serviços do Grid402 (gratuito, sem cobrança x402).',
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: 'object',
|
|
18
18
|
properties: {},
|
|
@@ -389,6 +389,46 @@ export const MCP_TOOLS_DEFINITIONS = [
|
|
|
389
389
|
required: [],
|
|
390
390
|
},
|
|
391
391
|
},
|
|
392
|
+
{
|
|
393
|
+
name: 'grid402_extract',
|
|
394
|
+
description: 'Extrai páginas web públicas HTTP/HTTPS com proteção SSRF e devolve Markdown limpo pronto para LLMs e RAG, incluindo título, descrição e links absolutos (0.0050 USDC / 1 crédito).',
|
|
395
|
+
inputSchema: {
|
|
396
|
+
type: 'object',
|
|
397
|
+
properties: {
|
|
398
|
+
url: {
|
|
399
|
+
type: 'string',
|
|
400
|
+
description: 'URL pública HTTP ou HTTPS a ser extraída para Markdown limpo (ex: "https://example.com").',
|
|
401
|
+
},
|
|
402
|
+
max_chars: {
|
|
403
|
+
type: 'integer',
|
|
404
|
+
description: 'Limite opcional de caracteres no Markdown retornado (500 a 25000; padrão: 12000).',
|
|
405
|
+
},
|
|
406
|
+
payment_tx_hash: {
|
|
407
|
+
type: 'string',
|
|
408
|
+
description: 'Hash opcional de transação USDC ou token pass_g402_...',
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
required: ['url'],
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: 'grid402_email_verify',
|
|
416
|
+
description: 'Audita entregabilidade de e-mail B2B estritamente Zero-PII: sintaxe RFC, DNS MX, SPF, DMARC, detecção de domínio descartável (disposable), provedor gratuito e role-based (0.0050 USDC / 1 crédito).',
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: 'object',
|
|
419
|
+
properties: {
|
|
420
|
+
email: {
|
|
421
|
+
type: 'string',
|
|
422
|
+
description: 'Endereço de e-mail a auditar sem armazenamento em disco (ex: "contato@grid402.online").',
|
|
423
|
+
},
|
|
424
|
+
payment_tx_hash: {
|
|
425
|
+
type: 'string',
|
|
426
|
+
description: 'Hash opcional de transação USDC ou token pass_g402_...',
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
required: ['email'],
|
|
430
|
+
},
|
|
431
|
+
},
|
|
392
432
|
{
|
|
393
433
|
name: 'grid402_pass',
|
|
394
434
|
description: 'Emite um Session Pass pré-pago x402 (Starter 2 USDC = 400 créditos, Pro 5 USDC = 1.000 créditos, Fleet 20 USDC = 6.000 créditos; 1 crédito = 0.0050 USDC) ou consulta status via ?status=pass_g402_...',
|
|
@@ -546,6 +586,16 @@ export async function executeGrid402Request(service, params = {}, options = {})
|
|
|
546
586
|
if (params.base) queryParams.set('base', params.base);
|
|
547
587
|
if (params.date) queryParams.set('date', params.date);
|
|
548
588
|
break;
|
|
589
|
+
case 'extract':
|
|
590
|
+
path = '/api/v1/extract';
|
|
591
|
+
if (params.url) queryParams.set('url', params.url);
|
|
592
|
+
if (params.max_chars !== undefined && params.max_chars !== null) queryParams.set('max_chars', String(params.max_chars));
|
|
593
|
+
break;
|
|
594
|
+
case 'email-verify':
|
|
595
|
+
case 'email_verify':
|
|
596
|
+
path = '/api/v1/email-verify';
|
|
597
|
+
if (params.email) queryParams.set('email', params.email);
|
|
598
|
+
break;
|
|
549
599
|
case 'pass':
|
|
550
600
|
path = '/api/v1/pass';
|
|
551
601
|
if (params.status) queryParams.set('status', params.status);
|
|
@@ -570,7 +620,7 @@ export async function executeGrid402Request(service, params = {}, options = {})
|
|
|
570
620
|
headers: {
|
|
571
621
|
'Content-Type': 'application/json',
|
|
572
622
|
'Accept': 'application/json',
|
|
573
|
-
'User-Agent': 'Grid402-MCP-Server/
|
|
623
|
+
'User-Agent': 'Grid402-MCP-Server/2.0.0',
|
|
574
624
|
},
|
|
575
625
|
body: postPayload,
|
|
576
626
|
});
|
|
@@ -582,7 +632,7 @@ export async function executeGrid402Request(service, params = {}, options = {})
|
|
|
582
632
|
|
|
583
633
|
const headers = {
|
|
584
634
|
'Accept': 'application/json',
|
|
585
|
-
'User-Agent': 'Grid402-MCP-Server/
|
|
635
|
+
'User-Agent': 'Grid402-MCP-Server/2.0.0',
|
|
586
636
|
};
|
|
587
637
|
|
|
588
638
|
if (params.idempotency_key) {
|