# Fonara Search MCP — full > One query, three independent search backends (Brave, Exa, Tavily), merged with cross-provider agreement and provenance. A router tells you what one index said; this tells you what three said and where they disagreed. Hosted: https://searchmcp.fonaralabs.dev/mcp (streamable HTTP, stateless, POST-only; one Fonara key, three backends behind it). Self-hosted: npx-installable over stdio with your own backend keys (BYOK). Response payloads are identical in both modes — only the auth path differs. ## The four tools ### search ``` { query: string, count?: 1-20 = 10, locale?: string = "en", sort?: "default" | "agreement" = "default" } ``` - Runs the query against every enabled backend in parallel. Per-backend timeout: 8 s — a backend that misses the deadline is reported as `timed_out` in `engines[]`, never silently dropped. - Merges results by normalised URL (lowercase host, `www.` stripped, query string and fragment dropped, trailing slash removed). Merged order: best rank across engines, then `agreement_count` desc, then mean rank, publisher recency, URL. `sort: "agreement"` re-orders by `agreement_count`, then best rank. - `agreement_count` is out of the engines that actually answered, not out of three — a 2-of-2 is not the same evidence as a 2-of-3, and `engines[].status` shows which situation you are in. - Whole merged response cached 15 minutes; a cache hit returns the original `run_id` with `cache_status: "hit"`. - Cost: one credit per run. Cache hits cost nothing. ### extract ``` { url: string, format?: "markdown" | "text" = "markdown" } ``` - One URL per call in v1; never automatic, never implied by `search`. - Order of attempts: 7-day cache (keyed on url + format + extractor version) → firecrawl → exa contents. - Prunes nav, footer, ads, cookie banners and repeated boilerplate before metering and before returning. - Failure is free: `{ ok: false, reason }` and every extractor's reason is shown; nothing is charged. Uncached success: from extract allowance. Cache hit: nothing. ### similar ``` { url: string, count?: 1-20 = 10 } ``` - Pages like the seed URL — exa findSimilar. Single-backend by nature and labelled as such: `agreements` is null (not a zeroed block), and every row is `agreement_count` 1 naming exa. - Text snippets ride the same request (up to 300 characters); `snippet` is null when no text was returned — never a fabricated empty string. - Cached 7 days per URL. Cost: one credit per request, independent of row count. ### status ``` { } ``` - Every backend, enabled or not, with the reason (`ok`, ` not set`, `disabled by ENABLE_TAVILY flag`), its version, its published bestFor line and cost per call — plus `schema_version` and `server_version`. - `p50_ms` and `last_error` are null, honestly: the runtime is stateless and keeps no per-instance metrics. ## The response schema (v1, schema_version "1.0") One response for `search` and `similar` (extract and status have their own, in [openapi.json](/docs/openapi.json)): - `run_id` — ULID, monotonic. - `snapshot_url` — permanent, private to the calling credential, immutable; resolves to that run's measurement receipt. Null on keyless runs: the answer without the record. - `schema_version`, `query`, `locale` — what was asked. - `engines[]` — per-backend report: `name`, `status` (ok | error | timed_out | disabled), `ms`, `returned`. - `backends_succeeded` — engines that answered ok. - `agreements` — counts over the merged set: `returned_by_3`, `returned_by_2`, `returned_by_1`, `total_distinct`, `agreement_rate`. Null for `similar`. - `results[]` — merged, ordered. Each row: `position`, `url`, `title`, `snippet` (null when no text exists), `agreement_count`, `engines[]` (name + rank per source), `provenance` (`host_tier`, `is_own_site`, `published_date`, `recency_days` — null when undetermined, never a fabricated guess). - `usage` — `search_calls`, `credits`, `provider_cost_usd` for this run. - `warnings[]` — pruned params, fallbacks, schema notes; never a silent drop. - `cache_status` — `"hit"` with the original run_id on a cached run; `"miss"` on a fresh one. What a response does NOT contain: `by_engine` — raw per-engine payloads — was removed from the response entirely (schema v1.3). Provenance per result is the engines[] list on each row; there is no other copy of the engines' output anywhere in the payload. ## Receipts `snapshot_url` points at a measurement receipt, not a copy of the response: engines, latencies, counts, agreement arithmetic and usage — written once, served verbatim forever, private to the calling credential (a stranger's run and a missing run are the same 404). A receipt never contains `results[]`, per-engine payloads, or the query. Free tier: readable for 7 days; expired receipts return `410` with an upgrade pointer, never a bare 404. Paid: permanent retention plus divergence trend and drift alerts — measurement over time, never result content. ## Auth Three modes on the hosted endpoint — see [auth.md](/auth.md): 1. Keyless — `initialize`, `tools/list`, and `tools/call search`/`tools/call status` answer with no credential; `extract`/`similar` return `429` with `reason: 'identity'`. 2. Bearer — `Authorization: Bearer `. 3. Key in path — `POST /v1//mcp`, for clients that cannot set headers. Self-hosted (BYOK): `BRAVE_SEARCH_API_KEY`, `EXA_API_KEY`, `TAVILY_API_KEY` from env; `FIRECRAWL_API_KEY` optional (extract falls back to exa contents); `ENABLE_TAVILY` defaults on. No Fonara key exists in that mode. Hosted mode is the default on the Fonara-operated deployment: Fonara holds the provider keys (Brave, Exa, Tavily) inside the Worker, and every call is metered — keyed calls against a key's allowance, keyless `search`/`status` against the 200-credits/day cap shared across anonymous callers. Turning hosted mode off removes the auth gate and the meter entirely: anonymous traffic then reaches our provider keys with no cap and no identity, and bills our accounts without limit. BYOK is the self-host mode: the operator's own keys, on their own infrastructure. ## Getting a key `POST https://searchmcp.fonaralabs.dev/v1/key-request` — unauthenticated, one call: `{"agent_name": "...", "contact": "email or URL", "intent": "one line, optional"}` → `{"request_id": "kr_…", "status": "review", "next": "https://searchmcp.fonaralabs.dev/auth.md#creating-a-hosted-key"}`. `status: "review"` means the request is queued and a human mints the key out of band; `status: "issued"` exists only in auto-issuance mode and the answer then carries the key. The route is capped per IP at 3 requests/hour and 10 requests/day. Contract, mint runbook and one-step revocation: [auth.md](/auth.md#creating-a-hosted-key). ## Costs You are billed in units, not dollars. One `search` consumes one credit from your tier; a cache hit, a failure and `status` consume nothing. `provider_cost_usd` reports what the search engines charged for the call — we show it so you can audit the router, not because it is your bill. A cache hit returns the original run's payload unchanged — including its credits field — and consumes nothing new. | Action | Credits | |---|---| | `search` run | 1 | | `search` cache hit | 0 | | `similar` request | 1 | | `extract`, uncached | from extract allowance | | `extract`, cache hit | 0 | | `extract`, failure | 0 | | `status` | 0 | Failed calls consume nothing — a pricing promise, not a courtesy. Agreement, provenance, the merge and the schema are never metered on any tier. ## Limits and rate shapes | Tier | Limits | |---|---| | Keyless | `search` and `status` free; 200 credits/day shared across anonymous callers, 10 runs/min; `snapshot_url: null`; `extract`/`similar` → 429 `identity` | | Free key | 100 runs + 20 extracts per month; 30 runs/min; 7-day receipt retention; no card | | Paid | monthly run allowance; higher concurrency; permanent receipts + divergence trend and drift alerts | On a limit: `429` with `retry_after`, never a silent drop. On an expired receipt: `410` with an upgrade pointer, never a bare `404`. ## Machine-readable surfaces - [openapi.json](/docs/openapi.json) — OpenAPI 3.1; response schemas generated from the zod source of truth. - [auth.md](/auth.md) — auth modes, 401 shape, key creation, BYOK env vars. - [SKILL.md](/SKILL.md) — operating instructions. - [agentNote.md](/docs/agentNote.md) — the measured case for three backends over one. - [Intent pages](/docs/intent/index.md) — one per backend × job, generated. - [Server card](/.well-known/mcp/server-card.json) · [API catalog](/.well-known/api-catalog) · [Agent skills](/.well-known/agent-skills/index.json) ## Self-hosting and version pinning ``` npx -y @fonara/search-mcp@0.1.0 ``` Pin the exact version. Every response carries `schema_version` ("1.0"); `status` reports `server_version`. The full bootstrap (MCP client config, env vars) is in [SKILL.md](/SKILL.md).