Skip to main content
Glama
README.md
# agent-search-mcp (Zero-Dependency Cloudflare Search for Agents MCP Server & CLI)

[![License: MIT](https://img.shields.io/badge/License-MIT-10B981?style=for-the-badge)](./LICENSE)
[![Zero npm Dependencies](https://img.shields.io/badge/npm_dependencies-0-38BDF8?style=for-the-badge)](#quickstart)
[![Node.js 22+](https://img.shields.io/badge/Node.js-20%2B%20%2F%2022%2B-34D399?style=for-the-badge)](#quickstart)

**A zero-dependency Model Context Protocol (MCP) server & CLI for auditing and querying websites via Cloudflare Search for Agents (`/.well-known/search`), RFC 10008 `HTTP QUERY`, `Accept: text/markdown`, `/llms.txt`, and 4-Tier Cascade Discovery BM25 search.**

Zero `npm install`. Zero headless browsers. Built-in **DNS-verified SSRF Shield**. Drop straight into **Claude Desktop**, **Claude Code**, **Cursor**, **Windsurf**, **VS Code Copilot**, or **Google Antigravity**.

---

## 3 Production MCP Tools Included Free (MIT)

| Tool | What It Does |
| :--- | :--- |
| **`agent_readiness_audit`** | Probes `/.well-known/search` (RFC 10008 `HTTP QUERY` / `GET`), `<meta name="agent:endpoint">`, `Accept: text/markdown` (`Vary: Accept`, `x-markdown-tokens`), `/llms.txt`, `/robots.txt` AI bots (`GPTBot`, `ClaudeBot`, `PerplexityBot`, `OAI-SearchBot`, `Google-Extended`, `CCBot`) & `/sitemap.xml`. Returns `0–100` score, grade (`A+–F`), token savings, Cloudflare `$0.75/1k` overage risk & recommendations. |
| **`agent_search_cascade`** | Executes **4-Tier Cascade Discovery** so agents get clean ranked chunks on **100% of websites on Day 1**: `Tier 1 /.well-known/search` → `Tier 2 Accept: text/markdown` → `Tier 3 /llms.txt` → `Tier 4 Clean HTML→Markdown + BM25`. |
| **`estimate_markdown_tokens`** | Compares raw HTML vs native `Accept: text/markdown` (or clean HTML→Markdown), reporting bytes saved, tokens saved, `%` reduction & estimated USD saved per 10,000 agent fetches. |

## Security First (DNS-Verified SSRF Shield)
Every outbound fetch and every HTTP redirect hop resolves DNS via `node:dns/promises` and rejects `localhost`, `127.0.0.1`, AWS/GCP/Azure metadata (`169.254.169.254`), RFC1918 (`10/8`, `172.16/12`, `192.168/16`), CGNAT (`100.64/12`), IPv6 loopback/ULA (`::1`, `fc00::/7`, `fe80::/10`), numeric/octal IP obfuscations, and non-HTTP(S) schemes (`file://`, `gopher://`).

---

## Quickstart

```bash
git clone https://github.com/danlopes18-ctrl/agent-search-mcp
cd agent-search-mcp
npm test   # Runs live stdio JSON-RPC + CLI + SSRF QA suite
```

### Use Directly from Your Terminal (CLI)

```bash
# Audit Cloudflare Search for Agents readiness & token savings
node cli.mjs audit https://blog.cloudflare.com/search-for-agents/

# Run 4-tier Cascade Discovery search with BM25 ranking
node cli.mjs search https://blog.cloudflare.com/search-for-agents/ "markdown for agents" --max-chunks 4

# Estimate HTML vs Markdown token savings on any URL
node cli.mjs tokens https://danlopes18-ctrl.github.io/
```

### Add to Claude Desktop / Cursor / Windsurf / Antigravity

```json
{
  "mcpServers": {
    "agent-search-mcp": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/agent-search-mcp/server.mjs"]
    }
  }
}
```

---

## MIT Lite vs. PRO Kit ($29) — Make *Your* Site Agent-Ready on Cloudflare Free ($0/mo)

Cloudflare's native *Markdown for Agents* requires a **Pro+ plan ($20+/mo)**, and public `/.well-known/search` endpoints face **$0.75/1k semantic query overages** past the 500 pages/day free indexing cap.

Upgrade to **[Cloudflare Agent-Ready & Search Guardrails Kit ($29 · Commercial & Agency License)](https://danlopes3.gumroad.com/l/cloudflare-agent-search-kit)** to deploy the complete server-side & anti-overage stack on **Cloudflare Free ($0/mo)**:

| Capability | `agent-search-mcp` (Free MIT) | Cloudflare Agent-Ready & Search Guardrails Kit (**$29 PRO**) |
| :--- | :---: | :---: |
| 3-Tool Cascade Discovery MCP Server + CLI | ✅ | ✅ (Expanded **5-Tool PRO MCP**) |
| DNS-Verified SSRF Shield + BM25 Chunker | ✅ | ✅ |
| **Cloudflare Free Worker: `Accept: text/markdown` Polyfill** (`x-markdown-tokens`, `Vary: Accept`, Edge Cache — saves $20/mo Pro plan) | — | ✅ |
| **Cloudflare Free Worker: `/.well-known/search` BM25 Gateway** (`GET`, RFC 10008 `QUERY`, `POST`, `<meta name="agent:endpoint">` injector — **$0/1k queries**) | — | ✅ |
| **Cloudflare WAF & Rate-Limiting Anti-Overage Pack** (JSON + Terraform HCL + `budget-auditor.mjs` CI gate + Playbook) | — | ✅ |
| **Batch Fleet Auditor CLI** (Multi-URL audit exporting **JSON + CSV + Executive HTML Report**) | — | ✅ |
| Commercial & Client Agency License | MIT | ✅ Commercial + Client Deployment |

👉 **Get the PRO Kit ($29):** https://danlopes3.gumroad.com/l/cloudflare-agent-search-kit

---

## Hosted API & Bulk Cloud Scraping Options

- **Sub-Second Managed REST Edge API (`/v1/agent-readiness` & `/v1/agent-search` — Free Tier + Pro):** https://api.market/store/danlopes18/edge-web-intel-api
- **Bulk Apify Store Pay-per-Event Actors (`danlopes18`):** https://apify.com/danlopes18
- **All Zero-Dependency AI DevTools & Guides:** https://danlopes18-ctrl.github.io/

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation4/5

Each tool targets a distinct action: auditing readiness, running a tiered discovery search, and estimating markdown token savings. The boundary between agent_readiness_audit and estimate_markdown_tokens is soft, since the audit already reports markdown token savings and $0.75/1k overage risk, so an agent may be unsure which to call for a savings question.

Naming Consistency3/5

All names are snake_case, but ordering conventions are mixed: agent_readiness_audit and agent_search_cascade are noun-first descriptors while estimate_markdown_tokens is verb-first. Readable, but no single predictable pattern an agent can generalize from.

Tool Count3/5

Three tools is thin even for a narrowly scoped server, and there is no utility beyond the three core use cases. Each tool does earn its place, but the surface feels minimal rather than deliberately scoped.

Completeness3/5

Discovery, scoring, and savings estimation are covered, but there is no remediation/setup tool (e.g. generating /.well-known/search, llms.txt, or robots.txt AI policy), no site-wide or batch auditing, and no caching or repeat comparison. Agents can diagnose problems but cannot act on the findings with this server.

Maintenance

ActivityNo data
ResponsivenessNo recent community issues