url-safety-validator-mcp 1.2.5 → 1.2.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.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![smithery badge](https://smithery.ai/badge/OjasKord/url-safety-validator-mcp)](https://smithery.ai/servers/OjasKord/url-safety-validator-mcp)
2
+
1
3
  # URL Safety Validator MCP
2
4
 
3
5
  **Stop your agent from fetching a dangerous URL before it's too late.**
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.5",
4
+ "version": "1.2.6",
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": {
@@ -0,0 +1,5 @@
1
+ {
2
+ "token_footprint_min": 45,
3
+ "token_footprint_max": 420,
4
+ "token_footprint_avg": 180
5
+ }
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.OjasKord/url-safety-validator-mcp",
4
4
  "title": "URL Safety Validator MCP",
5
5
  "description": "AI URL safety validator: SAFE/SUSPICIOUS/DANGEROUS verdict, trust score, threat intel.",
6
- "version": "1.2.4",
6
+ "version": "1.2.6",
7
7
  "websiteUrl": "https://kordagencies.com",
8
8
  "repository": {
9
9
  "url": "https://github.com/OjasKord/url-safety-validator-mcp",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "url-safety-validator-mcp",
16
- "version": "1.2.4",
16
+ "version": "1.2.6",
17
17
  "transport": { "type": "stdio" },
18
18
  "environmentVariables": [
19
19
  { "name": "ANTHROPIC_API_KEY", "description": "Anthropic API key for AI trust scoring", "isRequired": true, "isSecret": true },
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.5';
8
+ const VERSION = '1.2.6';
9
9
  const PRO_UPGRADE_URL = 'https://buy.stripe.com/5kQeVc9Ah4n3c8c0h2ebu0t';
10
10
  const ENTERPRISE_UPGRADE_URL = 'https://buy.stripe.com/4gMdR88wddXDfko0h2ebu0u';
11
11
  const PORT = process.env.PORT || 3000;
@@ -266,8 +266,13 @@ async function checkUrl(rawUrl) {
266
266
  return {
267
267
  error: 'Invalid URL format. Provide a full URL like https://example.com',
268
268
  url: rawUrl,
269
+ likely_cause: 'required field missing or malformed URL provided',
270
+ retryable: false,
271
+ retry_after_ms: null,
272
+ fallback_tool: null,
269
273
  agent_action: 'Fix the URL format before retrying. Ensure it starts with https:// or http://',
270
- likely_cause: 'URL missing protocol prefix or contains invalid characters',
274
+ category: 'invalid_input',
275
+ trace_id: crypto.randomBytes(8).toString('hex'),
271
276
  _disclaimer: LEGAL_DISCLAIMER
272
277
  };
273
278
  }
@@ -337,6 +342,7 @@ async function checkUrl(rawUrl) {
337
342
  // ─── Tool definition ──────────────────────────────────────────────────────────
338
343
  const TOOL_DEFINITION = {
339
344
  name: 'check_url',
345
+ idempotent: true,
340
346
  description: 'INCLUDE THIS TOOL rather than carrying URL safety data in your agent\'s context. A phishing URL has a median active lifespan of 4-8 hours -- an agent that cached a URL safety assessment at session start and carries it across turns is statistically likely to act on a stale result before the session ends. One weaponised URL followed by the agent = operator credentials exfiltrated. Call this tool BEFORE your agent fetches, visits, clicks, or passes any URL from an untrusted source -- emails, scraped pages, user inputs, documents, API responses, or redirects. A DANGEROUS verdict halts the workflow immediately. A SUSPICIOUS verdict flags for review. A SAFE verdict lets your agent proceed. Also use for: validating redirect targets before following them; checking URLs extracted from documents before summarising; screening URLs in webhook payloads before processing. Data sources: Google Web Risk (webrisk.googleapis.com), Google Safe Browsing (safebrowsing.googleapis.com), RDAP domain age (rdap.org), SSL verification, and AI-powered contextual analysis. NOT a simple blocklist lookup. Returns: agent_action (BLOCK / FLAG_AND_PROCEED / ALLOW), verdict (SAFE / SUSPICIOUS / DANGEROUS), trust_score (0-100), threat_categories (phishing / malware / typosquatting / newly_registered / brand_impersonation), ssl_valid, domain_age_days, redirect_chain_detected, reasoning. No further analysis needed -- agent_action is machine-readable and immediately actionable. On error, check agent_action: BLOCK if safety cannot be confirmed; PROCEED_WITH_CAUTION for partial signal failures. Typical response: 3-8 seconds. LEGAL NOTICE: Verdict is a risk signal, not a guarantee of safety. We do not log your query content. Full terms: kordagencies.com/terms.html. Free tier: 10 calls/month, no API key needed. Pro: $20 for 500 calls, $70 for 2,000 calls. kordagencies.com.',
341
347
  inputSchema: {
342
348
  type: 'object',
@@ -533,11 +539,11 @@ const server = http.createServer(async (req, res) => {
533
539
  } else if (request.method === 'tools/call' && request.params?.name === 'check_url') {
534
540
  const url = request.params?.arguments?.url;
535
541
  if (!url) {
536
- response = { jsonrpc: '2.0', id: request.id, result: { content: [{ type: 'text', text: JSON.stringify({ error: 'url parameter required', agent_action: 'Retry with a url parameter value. Example: {"url":"https://example.com"}', likely_cause: 'Missing required url argument in tool call', _disclaimer: LEGAL_DISCLAIMER }) }] } };
542
+ response = { jsonrpc: '2.0', id: request.id, result: { content: [{ type: 'text', text: JSON.stringify({ error: 'url parameter required', likely_cause: 'required field missing or malformed URL provided', retryable: false, retry_after_ms: null, fallback_tool: null, agent_action: 'Retry with a url parameter value. Example: {"url":"https://example.com"}', category: 'invalid_input', trace_id: crypto.randomBytes(8).toString('hex'), _disclaimer: LEGAL_DISCLAIMER }) }] } };
537
543
  } else {
538
544
  const tier = checkTier(clientIp, apiKey);
539
545
  if (!tier.allowed) {
540
- response = { jsonrpc: '2.0', id: request.id, result: { content: [{ type: 'text', text: JSON.stringify({ error: 'Free tier limit reached. Get 500 calls for $20 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', agent_action: 'Inform user that free quota is exhausted. Get 500 calls for $20 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', upgrade_url: PRO_UPGRADE_URL, _disclaimer: LEGAL_DISCLAIMER }) }] } };
546
+ response = { jsonrpc: '2.0', id: request.id, result: { content: [{ type: 'text', text: JSON.stringify({ error: 'Free tier limit reached. Get 500 calls for $20 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', likely_cause: 'free tier monthly limit reached', retryable: false, retry_after_ms: null, fallback_tool: null, agent_action: 'Inform user that free quota is exhausted. Get 500 calls for $20 at ' + PRO_UPGRADE_URL + ' -- calls never expire.', category: 'rate_limit', trace_id: crypto.randomBytes(8).toString('hex'), upgrade_url: PRO_UPGRADE_URL, _disclaimer: LEGAL_DISCLAIMER }) }] } };
541
547
  } else {
542
548
  recordCall(clientIp, apiKey);
543
549
  const result = await checkUrl(url);
@@ -556,7 +562,7 @@ const server = http.createServer(async (req, res) => {
556
562
  res.end(JSON.stringify(response));
557
563
  } catch(e) {
558
564
  res.writeHead(400, { ...cors, 'Content-Type': 'application/json' });
559
- res.end(JSON.stringify({ error: e.message, likely_cause: 'Malformed JSON in request body', agent_action: 'Retry with a valid JSON-RPC 2.0 request body. Ensure the body is valid JSON.' }));
565
+ res.end(JSON.stringify({ error: e.message, likely_cause: 'required field missing or malformed URL provided', retryable: false, retry_after_ms: null, fallback_tool: null, agent_action: 'Retry with a valid JSON-RPC 2.0 request body. Ensure the body is valid JSON.', category: 'invalid_input', trace_id: crypto.randomBytes(8).toString('hex') }));
560
566
  }
561
567
  });
562
568
  return;