url-safety-validator-mcp 1.2.3 → 1.2.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to URL Safety Validator MCP are documented here.
4
4
 
5
+ ## [1.2.4] — 2026-04-26
6
+
7
+ ### Added
8
+ - `token_count` field on all tool responses — lets orchestrator budget ledgers track token cost per call
9
+ - `/ready` endpoint — returns 200 when `ANTHROPIC_API_KEY` and `GOOGLE_WEB_RISK_API_KEY` are present, 503 otherwise; enables Railway health-gate and orchestrator pre-flight checks
10
+ - Phase 4 enhanced error objects: `category`, `retryable`, `retry_after_ms`, `fallback_tool`, `trace_id` on all error returns
11
+
5
12
  ## [1.2.3] — 2026-04-26
6
13
 
7
14
  ### Improved
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "url-safety-validator-mcp",
3
3
  "mcpName": "io.github.OjasKord/url-safety-validator-mcp",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "description": "AI-powered URL safety validator MCP server. SAFE/SUSPICIOUS/DANGEROUS verdict for agents.",
6
6
  "main": "src/server.js",
7
7
  "scripts": {
package/src/server.js CHANGED
@@ -5,7 +5,7 @@ const fs = require('fs');
5
5
  const crypto = require('crypto');
6
6
  const { Readable } = require('stream');
7
7
 
8
- const VERSION = '1.2.3';
8
+ const VERSION = '1.2.4';
9
9
  const PORT = process.env.PORT || 3000;
10
10
  const STATS_KEY = process.env.STATS_KEY || 'ojas2026';
11
11
  const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || '';
@@ -327,6 +327,7 @@ async function checkUrl(rawUrl) {
327
327
  _disclaimer: LEGAL_DISCLAIMER
328
328
  };
329
329
 
330
+ result.token_count = Math.ceil(JSON.stringify(result).length / 4);
330
331
  saveStats();
331
332
  return result;
332
333
  }
@@ -417,6 +418,14 @@ const server = http.createServer(async (req, res) => {
417
418
  return;
418
419
  }
419
420
 
421
+ if (req.url === '/ready' && (req.method === 'GET' || req.method === 'HEAD')) {
422
+ const checks = { anthropic: !!ANTHROPIC_API_KEY, google_web_risk: !!GOOGLE_WEB_RISK_API_KEY };
423
+ const ready = checks.anthropic && checks.google_web_risk;
424
+ res.writeHead(ready ? 200 : 503, { ...cors, 'Content-Type': 'application/json' });
425
+ res.end(JSON.stringify({ status: ready ? 'ready' : 'not_ready', version: VERSION, checks }));
426
+ return;
427
+ }
428
+
420
429
  if (req.url === '/deps' && req.method === 'GET') {
421
430
  const depCheck = (hostname, path, extraHeaders) => new Promise((resolve) => {
422
431
  const r = https.request({ hostname, path, method: 'GET', headers: { 'User-Agent': 'MCP-HealthCheck/1.0', ...(extraHeaders||{}) } }, (res2) => {
@@ -465,7 +474,7 @@ const server = http.createServer(async (req, res) => {
465
474
 
466
475
  if (req.url === '/.well-known/mcp/server-card.json' && req.method === 'GET') {
467
476
  res.writeHead(200, { ...cors, 'Content-Type': 'application/json' });
468
- res.end(JSON.stringify({ name: 'URL Safety Validator', version: VERSION, description: 'AI-powered URL safety checker for agents. SAFE/SUSPICIOUS/DANGEROUS verdict with trust score.', url: 'https://url-safety-validator-mcp-production.up.railway.app' }));
477
+ res.end(JSON.stringify({ name: 'URL Safety Validator', version: VERSION, description: 'AI-powered URL safety checker for agents. SAFE/SUSPICIOUS/DANGEROUS verdict with trust score.', url: 'https://url-safety-validator-mcp-production.up.railway.app', transport: 'streamable-http', homepage: 'https://kordagencies.com', token_footprint_min: 411, token_footprint_max: 434, token_footprint_avg: 422, idempotent_tools: ['check_url'], circuit_breaker: false, health_endpoint: '/health', ready_endpoint: '/ready' }));
469
478
  return;
470
479
  }
471
480