Overview
Theconfidential-websearch MCP server runs inside a Tinfoil secure enclave and exposes two tools: search (web search via Exa, a Zero Data Retention provider) and fetch (headless-browser page rendering via Cloudflare Browser Rendering). Both return results back into the enclave before being handed to the caller, so queries and page content are only ever decrypted inside attested code.
Use this guide when you want to drive the web-search tool loop yourself — for example, from a custom agent runtime or any MCP-compatible client. If you just want a model to search the web as part of a chat completion, prefer the higher-level Web search guide which wraps this same server behind web_search_options and the web_search Responses tool.
Optional safety filters run inside the same enclave:
- PII filter blocks outgoing search queries that contain sensitive identifiers before they reach Exa.
- Prompt-injection filter drops search results and fetched pages that contain instructions aimed at hijacking a downstream model.
Endpoint and transport
Any MCP-compliant client can introspect the tool surface by calling
tools/list on the endpoint.
Authentication
Send your Tinfoil API key as a bearer token:Tools
search
Run a web search and return ranked results with titles, URLs, snippets, and publication dates.
Arguments
Response
fetch
Fetch one or more web pages via Cloudflare Browser Rendering and return them as clean markdown. Use this after search when you need the full page beyond the returned snippet.
Arguments
The server rejects unsafe fetch targets before they reach Cloudflare (localhost, internal hostnames, private IP ranges, unsupported URL schemes).
Response
results preserves input order and includes both completed and failed fetches. pages is the convenience subset of results whose status is completed.
Per-request safety headers
The server’s safety filters have env-configured defaults, but an integrator can override them on a single request by forwarding either header on thePOST /mcp call. Missing, empty, or unparseable values fall back to the server default, so a malformed header cannot silently weaken filtering.
See PII protection and Prompt-injection protection in the Web search guide for what each filter blocks.
Calling from a Tinfoil SDK
Because the websearch server is an attested enclave, you should verify its attestation before trusting traffic to it. Every Tinfoil SDK exposes aSecureClient that does this for you: it verifies the enclave’s signed release against the tinfoilsh/confidential-websearch GitHub repo, pins the attested transport, and returns a verified HTTP client you can hand to any MCP client transport.
The example below pairs tinfoil-js with the TypeScript MCP SDK to call search. The same pattern works from the Python, Go, and Swift SDKs — point their SecureClient at websearch.tinfoil.sh with configRepo = tinfoilsh/confidential-websearch and plug the verified client into the MCP SDK of your choice.
ready() rejects before any request is sent. See the JavaScript SDK guide for transport-mode options (EHBP vs. TLS pinning) and proxying.
Limits and defaults
See also
- Web search guide — the higher-level wrapper that drives this server for you on
/v1/chat/completionsand/v1/responses. tinfoilsh/confidential-websearch— source and release history for the MCP server itself.- JavaScript SDK — attested
SecureClientused in the example above.

