grid402-mcp 1.2.2 → 1.6.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Grid402 Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -18,6 +18,10 @@ Compatível nativamente com **Claude Desktop**, **Cursor**, **Smithery.ai**, **C
18
18
  | `grid402_asn` | Inteligência BGP, número ASN, organização e país de bloco IP | On-Demand | 0.0005 USDC |
19
19
  | `grid402_cep` | Consulta de endereço postal brasileiro e código IBGE oficial | On-Demand | 0.0005 USDC |
20
20
  | `grid402_cnpj` | Consulta cadastral de CNPJ da Receita Federal com status e CNAE | On-Demand | 0.0020 USDC |
21
+ | `grid402_indicators` | Indicadores macroeconômicos oficiais (Selic meta e diária, CDI anual e IPCA) | On-Demand | 0.0005 USDC |
22
+ | `grid402_holidays` | Calendário oficial de feriados nacionais e bancários ANBIMA por ano | On-Demand | 0.0005 USDC |
23
+ | `grid402_workdays` | Calculadora de dias úteis financeiros e projeção de vencimentos ANBIMA | On-Demand | 0.0005 USDC |
24
+ | `grid402_verify` | Validação matemática de prova criptográfica de oráculo (_oracle_proof) secp256k1 | Direto | Gratuito |
21
25
 
22
26
  ---
23
27
 
@@ -98,6 +102,12 @@ O provedor gerencia automaticamente o ciclo de vida HTTP 402, transferindo os mi
98
102
 
99
103
  ---
100
104
 
105
+ ## 🛡️ Prova Criptografica de Oraculo (Proof of Data)
106
+
107
+ Todas as ferramentas pagas e em sandbox retornam o bloco `_oracle_proof` com garantia matematica de integridade e assinatura ECDSA secp256k1 emitida pela carteira oficial do Grid402 (`0xa31c31069c43ac1c0075a93c325b0dcd7744356c`). Isso permite que agentes validem que os dados consumidos sao legitimos e nao sofreram alteracao durante o trânsito.
108
+
109
+ ---
110
+
101
111
  ## 🧪 Testando Localmente
102
112
 
103
113
  ```bash
package/index.mjs CHANGED
@@ -13,7 +13,7 @@ import { MCP_TOOLS_DEFINITIONS, executeGrid402Request, DEFAULT_ENDPOINT } from '
13
13
  const server = new Server(
14
14
  {
15
15
  name: 'grid402-mcp-server',
16
- version: '1.0.0',
16
+ version: '1.6.0',
17
17
  },
18
18
  {
19
19
  capabilities: {
@@ -61,6 +61,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
61
61
  case 'grid402_cnpj':
62
62
  service = 'cnpj';
63
63
  break;
64
+ case 'grid402_indicators':
65
+ service = 'indicators';
66
+ break;
67
+ case 'grid402_holidays':
68
+ service = 'holidays';
69
+ break;
70
+ case 'grid402_workdays':
71
+ service = 'workdays';
72
+ break;
73
+ case 'grid402_verify':
74
+ service = 'verify';
75
+ break;
64
76
  default:
65
77
  throw new Error(`Ferramenta MCP desconhecida: ${toolName}`);
66
78
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "grid402-mcp",
3
- "version": "1.2.2",
4
- "description": "Official Model Context Protocol (MCP) Server for Grid402 - Public Open Data e Network Utilities Hub (Forex, Crypto, DNS, SSL, ASN, CEP, CNPJ) with Base x402 micropayments e Sandbox.",
3
+ "version": "1.6.0",
4
+ "description": "Official Model Context Protocol (MCP) Server for Grid402 - Public Open Data e Network Utilities Hub (Forex, Crypto, DNS, SSL, ASN, CEP, CNPJ, Indicators, Holidays, Workdays, Oracle Verifier) with Base x402 micropayments, Oracle Proof e Sandbox.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "grid402-mcp": "index.mjs"
@@ -12,6 +12,7 @@
12
12
  "tools.mjs",
13
13
  "x402_payer.mjs",
14
14
  "README.md",
15
+ "LICENSE",
15
16
  "package.json"
16
17
  ],
17
18
  "scripts": {
@@ -36,6 +37,11 @@
36
37
  "asn",
37
38
  "cep",
38
39
  "cnpj",
40
+ "indicators",
41
+ "holidays",
42
+ "workdays",
43
+ "oracle",
44
+ "proof-of-data",
39
45
  "sandbox"
40
46
  ],
41
47
  "author": "Grid402 Team <contato@grid402.com.br>",
package/tools.mjs CHANGED
@@ -7,7 +7,7 @@ import { settleX402Payment } from './x402_payer.mjs';
7
7
  export const DEFAULT_ENDPOINT = process.env.GRID402_ENDPOINT || process.env.GRID402_API_URL || 'https://orangered-jackal-900744.hostingersite.com';
8
8
 
9
9
  /**
10
- * Definições formais das 7 ferramentas no padrão MCP
10
+ * Definições formais das 11 ferramentas no padrão MCP
11
11
  */
12
12
  export const MCP_TOOLS_DEFINITIONS = [
13
13
  {
@@ -137,6 +137,82 @@ export const MCP_TOOLS_DEFINITIONS = [
137
137
  required: ['cnpj'],
138
138
  },
139
139
  },
140
+ {
141
+ name: 'grid402_indicators',
142
+ description: 'Consulta taxas oficiais Selic meta e diária, CDI anual e diário, IPCA acumulado 12m e mensal do Banco Central e IBGE.',
143
+ inputSchema: {
144
+ type: 'object',
145
+ properties: {
146
+ payment_tx_hash: {
147
+ type: 'string',
148
+ description: 'Hash opcional de transação na Base Mainnet comprovando o pagamento de 0.0005 USDC caso não utilize liquidação automática.',
149
+ },
150
+ },
151
+ required: [],
152
+ },
153
+ },
154
+ {
155
+ name: 'grid402_holidays',
156
+ description: 'Consulta o calendário oficial de feriados nacionais e dias sem expediente bancário (ANBIMA e Febraban) com cálculo de feriados móveis.',
157
+ inputSchema: {
158
+ type: 'object',
159
+ properties: {
160
+ year: {
161
+ type: 'integer',
162
+ description: 'Ano calendário de 4 dígitos entre 1900 e 2100 (ex: 2026). Se omitido, consulta o ano corrente.',
163
+ },
164
+ payment_tx_hash: {
165
+ type: 'string',
166
+ description: 'Hash opcional de transação na Base Mainnet comprovando o pagamento de 0.0005 USDC caso não utilize liquidação automática.',
167
+ },
168
+ },
169
+ required: [],
170
+ },
171
+ },
172
+ {
173
+ name: 'grid402_workdays',
174
+ description: 'Calcula dias úteis financeiros e projeção de vencimentos na convenção ANBIMA (D+0 exclusivo no início e inclusivo no fim) ou verifica se uma data é dia útil bancário.',
175
+ inputSchema: {
176
+ type: 'object',
177
+ properties: {
178
+ start_date: {
179
+ type: 'string',
180
+ description: 'Data de início no formato AAAA-MM-DD para contagem de intervalo ou projeção de prazo.',
181
+ },
182
+ end_date: {
183
+ type: 'string',
184
+ description: 'Data de término no formato AAAA-MM-DD para contagem de intervalo de dias úteis.',
185
+ },
186
+ days: {
187
+ type: 'integer',
188
+ description: 'Quantidade inteira de dias úteis para projeção de vencimento (positivo para futuro, negativo para passado).',
189
+ },
190
+ date: {
191
+ type: 'string',
192
+ description: 'Data pontual no formato AAAA-MM-DD para verificação de dia útil.',
193
+ },
194
+ payment_tx_hash: {
195
+ type: 'string',
196
+ description: 'Hash opcional de transacao na Base Mainnet comprovando o pagamento de 0.0005 USDC caso nao utilize liquidacao automatica.',
197
+ },
198
+ },
199
+ required: [],
200
+ },
201
+ },
202
+ {
203
+ name: 'grid402_verify',
204
+ description: 'Valida a integridade matematica da prova criptografica de oraculo (_oracle_proof) secp256k1 em uma resposta do Grid402 (gratuito).',
205
+ inputSchema: {
206
+ type: 'object',
207
+ properties: {
208
+ payload: {
209
+ type: 'string',
210
+ description: 'Payload JSON serializado da resposta da API contendo a chave _oracle_proof.',
211
+ },
212
+ },
213
+ required: ['payload'],
214
+ },
215
+ },
140
216
  ];
141
217
 
142
218
  /**
@@ -180,8 +256,40 @@ export async function executeGrid402Request(service, params = {}, options = {})
180
256
  path = '/api/v1/cnpj';
181
257
  if (params.cnpj) queryParams.set('cnpj', params.cnpj);
182
258
  break;
259
+ case 'indicators':
260
+ path = '/api/v1/indicators';
261
+ break;
262
+ case 'holidays':
263
+ path = '/api/v1/holidays';
264
+ if (params.year) queryParams.set('year', params.year);
265
+ break;
266
+ case 'workdays':
267
+ path = '/api/v1/workdays';
268
+ if (params.start_date || params.startDate) queryParams.set('start_date', params.start_date || params.startDate);
269
+ if (params.end_date || params.endDate) queryParams.set('end_date', params.end_date || params.endDate);
270
+ if (params.days !== undefined && params.days !== null) queryParams.set('days', params.days);
271
+ if (params.date) queryParams.set('date', params.date);
272
+ break;
273
+ case 'verify':
274
+ path = '/api/v1/verify';
275
+ break;
183
276
  default:
184
- throw new Error(`Serviço desconhecido: ${service}`);
277
+ throw new Error(`Servico desconhecido: ${service}`);
278
+ }
279
+
280
+ // Verificacao de oraculo via POST sem estado
281
+ if (service === 'verify') {
282
+ const postPayload = typeof params.payload === 'string' ? params.payload : JSON.stringify(params.payload || params);
283
+ const verifyRes = await fetch(`${endpoint}/api/v1/verify`, {
284
+ method: 'POST',
285
+ headers: {
286
+ 'Content-Type': 'application/json',
287
+ 'Accept': 'application/json',
288
+ 'User-Agent': 'Grid402-MCP-Server/1.6',
289
+ },
290
+ body: postPayload,
291
+ });
292
+ return await verifyRes.json();
185
293
  }
186
294
 
187
295
  const queryString = queryParams.toString();
@@ -189,7 +297,7 @@ export async function executeGrid402Request(service, params = {}, options = {})
189
297
 
190
298
  const headers = {
191
299
  'Accept': 'application/json',
192
- 'User-Agent': 'Grid402-MCP-Server/1.1',
300
+ 'User-Agent': 'Grid402-MCP-Server/1.6',
193
301
  };
194
302
 
195
303
  if (params.payment_tx_hash) {