vat-validator-mcp 1.4.5 → 1.4.6

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.
Files changed (3) hide show
  1. package/LICENSE +18 -7
  2. package/package.json +2 -2
  3. package/src/server.js +13 -11
package/LICENSE CHANGED
@@ -1,10 +1,21 @@
1
- PROPRIETARY LICENSE
1
+ MIT License
2
2
 
3
- Copyright (c) 2026 Kordagencies. All rights reserved.
3
+ Copyright (c) 2026 Kord Agencies Pte Ltd
4
4
 
5
- This software and associated documentation files are proprietary and confidential.
6
- Unauthorized copying, distribution, modification, or use of this software,
7
- via any medium, is strictly prohibited without the express written permission
8
- of Kordagencies.
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:
9
11
 
10
- For licensing inquiries: ojas@kordagencies.com
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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
21
+ THE SOFTWARE.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vat-validator-mcp",
3
3
  "mcpName": "io.github.OjasKord/vat-validator-mcp",
4
- "version": "1.4.5",
4
+ "version": "1.4.6",
5
5
  "description": "VAT number validation for AI agents. EU VIES, UK HMRC, Australian ABN in one call.",
6
6
  "main": "src/server.js",
7
7
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "compliance"
30
30
  ],
31
31
  "author": "Kord Agencies Pte Ltd <ojas@kordagencies.com>",
32
- "license": "UNLICENSED",
32
+ "license": "MIT",
33
33
  "homepage": "https://kordagencies.com",
34
34
  "repository": {
35
35
  "type": "git",
package/src/server.js CHANGED
@@ -4,7 +4,9 @@ const crypto = require('crypto');
4
4
  const fs = require('fs');
5
5
 
6
6
  const PERSIST_FILE = '/tmp/vat_stats.json';
7
- const VERSION = '1.4.5';
7
+ const VERSION = '1.4.6';
8
+ const PRO_UPGRADE_URL = 'https://buy.stripe.com/28EeVceUB06N1ty3teebu0l';
9
+ const ENTERPRISE_UPGRADE_URL = 'https://buy.stripe.com/00w14m7s96vb1ty5Bmebu0m';
8
10
  const RESEND_API_KEY = process.env.RESEND_API_KEY || '';
9
11
  const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || '';
10
12
  const PORT = process.env.PORT || 3000;
@@ -324,11 +326,11 @@ function checkAccess(req) {
324
326
  }
325
327
  const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
326
328
  const calls = freeTierUsage.get(ip) || 0;
327
- if (calls >= FREE_TIER_LIMIT) return { allowed: false, reason: 'Free tier limit of ' + FREE_TIER_LIMIT + ' validations/month reached. Upgrade to Pro ($99/month) at kordagencies.com for 5,000 validations/month.', upgrade_url: 'https://kordagencies.com', tier: 'free_limit_reached' };
329
+ if (calls >= FREE_TIER_LIMIT) return { allowed: false, reason: 'Free tier limit reached. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', upgrade_url: PRO_UPGRADE_URL, tier: 'free_limit_reached' };
328
330
  freeTierUsage.set(ip, calls + 1);
329
331
  saveStats();
330
332
  const remaining = FREE_TIER_LIMIT - calls - 1;
331
- return { allowed: true, tier: 'free', remaining, warning: remaining < 5 ? remaining + ' free validations remaining. Upgrade at kordagencies.com' : null };
333
+ return { allowed: true, tier: 'free', remaining, warning: remaining < 5 ? remaining + ' free validations remaining this month. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.' : null };
332
334
  }
333
335
 
334
336
  function verifyStripeSignature(body, sig, secret) {
@@ -494,7 +496,7 @@ const server = http.createServer(async (req, res) => {
494
496
  } else if (request.method === 'tools/call') {
495
497
  const access = checkAccess(req);
496
498
  if (!access.allowed) {
497
- response = { jsonrpc: '2.0', id: request.id, error: { code: -32000, message: access.reason, upgrade_url: 'https://kordagencies.com', agent_action: 'Inform user free tier quota is exhausted. Upgrade required at kordagencies.com' } };
499
+ response = { jsonrpc: '2.0', id: request.id, error: { code: -32000, message: access.reason, upgrade_url: PRO_UPGRADE_URL, agent_action: 'Inform user free tier quota is exhausted. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.' } };
498
500
  } else {
499
501
  const { name, arguments: args } = request.params;
500
502
  const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || 'unknown';
@@ -526,12 +528,12 @@ const server = http.createServer(async (req, res) => {
526
528
  if (request.method !== 'initialize' && request.method !== 'notifications/initialized') {
527
529
  if (request.method === 'tools/call' && request.params?.name === 'batch_validate') {
528
530
  const apiKey = req.headers['x-api-key'];
529
- if (!apiKey) { res.writeHead(402, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32002, message: 'batch_validate requires a paid API key. Get yours at kordagencies.com - Pro $99/month.', upgrade_url: 'https://kordagencies.com', agent_action: 'Paid API key required for batch_validate. Upgrade at kordagencies.com' } })); return; }
531
+ if (!apiKey) { res.writeHead(402, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32002, message: 'batch_validate requires a paid API key. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', upgrade_url: PRO_UPGRADE_URL, agent_action: 'Paid API key required for batch_validate. Get 500 calls for $8 at ' + PRO_UPGRADE_URL } })); return; }
530
532
  const record = apiKeys.get(apiKey);
531
533
  if (!record) { res.writeHead(401, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32001, message: 'Invalid API key. Get yours at kordagencies.com', agent_action: 'Invalid API key. Obtain a valid key at kordagencies.com' } })); return; }
532
534
  } else {
533
535
  const access = checkAccess(req);
534
- if (!access.allowed) { res.writeHead(429, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32000, message: access.reason, upgrade_url: 'https://kordagencies.com', agent_action: 'Inform user free tier quota is exhausted. Upgrade required at kordagencies.com' } })); return; }
536
+ if (!access.allowed) { res.writeHead(429, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ jsonrpc: '2.0', id: request.id, error: { code: -32000, message: access.reason, upgrade_url: PRO_UPGRADE_URL, agent_action: 'Inform user free tier quota is exhausted. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.' } })); return; }
535
537
  req._accessWarning = access.warning; req._tier = access.tier;
536
538
  }
537
539
  }
@@ -560,7 +562,7 @@ const server = http.createServer(async (req, res) => {
560
562
  // Gate address on free tier — company name + valid status visible
561
563
  const gated = ['registered_address', 'address', 'consultation_number'];
562
564
  gated.forEach(f => delete result[f]);
563
- result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Upgrade to Pro ($39/month) at kordagencies.com for full registered address and HMRC consultation number.';
565
+ result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire. Includes full registered address and HMRC consultation number.';
564
566
  result._gated_fields = gated;
565
567
  }
566
568
 
@@ -568,7 +570,7 @@ const server = http.createServer(async (req, res) => {
568
570
  // Gate full reasoning — verdict visible, details gated
569
571
  const gated = ['fraud_signals', 'positive_indicators', 'recommended_action', 'summary'];
570
572
  gated.forEach(f => delete result[f]);
571
- result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Upgrade to Pro ($39/month) at kordagencies.com for full fraud signal breakdown, positive indicators, and recommended action.';
573
+ result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire. Includes full fraud signal breakdown, positive indicators, and recommended action.';
572
574
  result._gated_fields = gated;
573
575
  }
574
576
 
@@ -576,11 +578,11 @@ const server = http.createServer(async (req, res) => {
576
578
  // Gate detail fields — match_status visible, discrepancies gated
577
579
  const gated = ['discrepancies', 'name_match', 'address_match', 'recommended_action', 'summary'];
578
580
  gated.forEach(f => delete result[f]);
579
- result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Upgrade to Pro ($39/month) at kordagencies.com for full discrepancy analysis and recommended action.';
581
+ result._upgrade_note = 'Free tier: ' + remaining + ' of ' + FREE_TIER_LIMIT + ' calls remaining. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire. Includes full discrepancy analysis and recommended action.';
580
582
  result._gated_fields = gated;
581
583
  }
582
584
 
583
- if (isWarning) result._notice = 'Warning: only ' + remaining + ' free call' + (remaining === 1 ? '' : 's') + ' left this month. Upgrade to Pro at kordagencies.com to avoid interruption.';
585
+ if (isWarning) result._notice = 'Warning: only ' + remaining + ' free call' + (remaining === 1 ? '' : 's') + ' left this month. Get 500 calls for $8 at ' + PRO_UPGRADE_URL + ' -- calls never expire.';
584
586
  }
585
587
 
586
588
  response = { jsonrpc: '2.0', id: request.id, result: { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } };
@@ -592,7 +594,7 @@ const server = http.createServer(async (req, res) => {
592
594
  return;
593
595
  }
594
596
 
595
- if (req.method === 'GET' && req.url === '/') { res.writeHead(200, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ name: 'vat-validator-mcp', version: VERSION, status: 'ok', tools: 6, free_tier: '20 calls/month, no API key required', description: 'VAT validation + AI fraud detection. EU VIES, UK HMRC, Australian ABN.', upgrade: 'https://kordagencies.com' })); return; }
597
+ if (req.method === 'GET' && req.url === '/') { res.writeHead(200, { ...cors, 'Content-Type': 'application/json' }); res.end(JSON.stringify({ name: 'vat-validator-mcp', version: VERSION, status: 'ok', tools: 6, free_tier: '20 calls/month, no API key required', description: 'VAT validation + AI fraud detection. EU VIES, UK HMRC, Australian ABN.', upgrade: PRO_UPGRADE_URL })); return; }
596
598
  res.writeHead(404, cors); res.end(JSON.stringify({ error: 'Not found' }));
597
599
  });
598
600