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 (page text retrieval via Exa Contents). The enclave sends queries or URLs to Exa over TLS and returns the results to the caller through the verified transport.
Use this guide to call the web-search tools from your own agent runtime or an MCP-compatible client. For web search built into a chat completion, follow the Web search guide. It uses the same server through web_search_options and the web_search Responses tool.
Optional safety filters run inside secure enclaves:
- PII filter removes detected sensitive identifiers from outgoing search queries before they reach Exa. Search continues with the remaining query.
- 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.
Raw HTTP clients must accept both application/json and text/event-stream responses. An MCP Streamable HTTP transport handles this framing and returns the tool result; an SSE response must not be parsed as a single JSON document.
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
The search payload is returned in MCPresult.structuredContent and as serialized JSON in a text block under result.content. For example, if the filter detects the personal email in [email protected] hiking trails:
The span list does not repeat sensitive values. Callers can use the offsets to identify removed text in their own original query. Offsets exclude adjacent whitespace removed during cleanup and are not UTF-8 byte or JavaScript UTF-16 code unit offsets.
Masking follows the model’s detected span boundaries, which may cover only part of a sensitive value. Neither
pii_checked: true nor pii_masked: true guarantees that the remaining query is free of PII.
If filtering leaves an empty or whitespace-only query, the server skips Exa and returns an empty results array with the PII metadata. If the PII check fails, the server does not send the query to Exa and returns an MCP tool error (isError: true), not a successful checked result.
fetch
Fetch one or more web pages via Exa Contents and return their text. Use this after search when you need the full page beyond the returned snippet.
Arguments
Use public HTTP/HTTPS URLs. PII masking does not apply to fetch URLs, so do not include sensitive values in them.
Response
results includes both completed and failed fetches. Match entries by url: URLs rejected by allowed_domains appear after the fetched results. pages contains successful pages with non-empty content and may be omitted when none succeeded.
Per-request safety headers
The server’s safety filters have 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.
X-Tinfoil-Tool-PII-Check: true runs the check when you call the MCP search tool directly. Send it on the HTTP request carrying tools/call, not only on MCP initialization. A successful search is expected even when PII was masked. Inspect result.structuredContent.pii_checked and pii_redactions to see whether the check ran and what it removed.
Names alone are allowed. Personal emails are removed when detected; invented names or addresses do not guarantee a particular model classification. The PII filter applies to the search query, not to fetch URLs or returned page content.
See PII protection and Prompt-injection protection in the Web search guide for the filtering policies.
Calling from a Tinfoil SDK
Because the websearch server is an attested enclave, verify its attestation before trusting traffic to it. Each Tinfoil SDK provides verified HTTP access: it checks the enclave against the signed release fromtinfoilsh/confidential-websearch and binds requests to the attested TLS or HPKE key.
The example below pairs tinfoil-js with the TypeScript MCP SDK to call search with PII masking enabled. Resolve /mcp from the origin, not by appending it to the SDK’s inference base URL, which includes /v1/.
ready() rejects before any MCP request is sent. See the JavaScript SDK guide for transport-mode options (EHBP vs. TLS pinning) and proxying.
For the other SDKs, use the following verified HTTP entry points to send MCP requests to https://websearch.tinfoil.sh/mcp. Set the bearer token and safety headers on each request. Hostname parameters use websearch.tinfoil.sh without a scheme; URL parameters use https://websearch.tinfoil.sh.
In each row,
repo is tinfoilsh/confidential-websearch. These HTTP clients handle connection-time verification, not MCP message framing; use an MCP transport adapter or handle the JSON-RPC and SSE envelopes before reading result.structuredContent.
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: the attested
SecureClientused in the example above.

