MeshSearch

An MCP server that gives AI agents private web search: committed queries, 3-hop relay routing, x402 payments, and encrypted history.

ETHMumbai 2026

🎓 ETHMumbai

📌 World Trade Center, Mumbai

🚀 42 hours Hackathon Project

🏅 Winner

What it is

MeshSearch is a private web search tool for AI agents. It is an MCP (Model Context Protocol) server, so Claude, Cursor, or any other MCP client can call it as a tool. A companion web app adds wallet connect, a paid-search chat, and a view of how each search was routed and paid for. The team built it at ETHMumbai 2026.

The problem

AI agents do more and more of people's web searching. Every one of those queries still leaks who is asking and what they are asking about to whoever runs the search backend. There is no way for an agent to search on your behalf privately. MeshSearch tries to fix that with cryptography instead of a privacy policy.

How it works

The repository is a pnpm and Turborepo monorepo. A search passes through these services:

  1. MCP server (apps/mcp-server) receives the private_search tool call. An x402 middleware answers with HTTP 402 and a USDC price until the client attaches a signed payment. Only tools/call is gated; initialize and tools/list stay free.
  2. The tool builds a salted SHA-256 commitment to the query (a fixed-size fingerprint that hides the query but binds the proof to it) and a Semaphore zero-knowledge proof over it. It records the proof's nullifier (a unique value derived from the proof, which the contract stores so it can detect reuse) in the NullifierRegistry contract, which rejects a replayed proof.
  3. The tool encrypts the query for the search backend with secp256k1 ECDH (elliptic-curve Diffie-Hellman), HKDF, and AES-256-GCM. It wraps the result in three onion layers, one per relay. Each relay can decrypt only its own layer, so it learns the next hop but not the query (packages/crypto, apps/mcp-server/src/relay/routing.ts).
  4. Relay nodes (apps/relay-node) each peel one layer. A relay learns only the next hop and cannot read the query. Each relay has an ENS (Ethereum Name Service) name, such as relay1.meshsearch.eth, which appears in the routing line of every result.
  5. The search backend (apps/search-backend) decrypts the query, asks a self-hosted SearXNG instance, and hashes the results. The MCP server checks that hash and stores it on-chain.
  6. Fileverse (apps/fileverse) stores an encrypted record of the search on IPFS. The get_history and compile_report tools read it back.
  7. When BitGo is enabled, the MCP server pays the relay operators through BitGo wallets (see the next section).

The server also runs in stdio mode for direct use from Claude Desktop or Cursor. In both modes, the private_search tool itself builds the commitment, proof, and encrypted query. That process is therefore the client side of the design, and the code expects it to run on the user's side of the trust boundary.

Four Solidity contracts in packages/contracts support the flow: NodeRegistry, NullifierRegistry, PaymentSplitter, and AccessControl. The scripts deploy them to Base Sepolia.

What I built

I built the MCP search and payment pipeline, the crypto, relay and search services, the contracts, the web interface and the BitGo integration. Jay added the deployment and RPC architecture notes and the presentation, cookbook and research PDFs. Sundaram built the Fileverse-backed history client and report integration. The commit history does not show who operated the external deployments.

Design decisions

Getting any single piece of this right isn't that hard on its own, because there is plenty of prior art for anonymous payments or private queries individually. What took the most thought was making sure none of the pieces leaked each other. Queries are committed on the client side before they leave your device, so the backend never sees a query it can tie back to you. Payment is an x402 USDC micropayment on Base Sepolia, so there is no account or identity involved, just a wallet signing off on a request.

Fresh payout addresses. The part I spent the most time on was the payout side. Even with fully anonymous queries, if the same wallet keeps paying the same three relay operators over and over, that pattern alone tells you who is using the network and how often. So payouts route through BitGo instead of a plain on-chain transfer, and each relay operator gets paid from a fresh, unlinkable address every time. Nobody watching the chain can tell that two payments went to the same operator. The PaymentSplitter contract stays as the fallback when BitGo is not configured. The alternative, a single splitter contract, is simpler but publishes a stable recipient per operator.

ENS names for relays. The three relay hops are identified by ENS name instead of IP address. Every search comes with a routing trail you can verify, and the MCP server checks each name against Ethereum mainnet when it builds a route. A name that does not resolve is logged, and the search continues.

Encrypted history. Search history is encrypted and stored on Fileverse, so even the storage layer only ever sees ciphertext. In the code, the encryption key comes from server configuration (FILEVERSE_ENCRYPTION_KEY). The documentation describes it as the user's wallet key.

Shared packages. packages/crypto and packages/types serve the MCP server, the relays, the search backend, and the web app. A single implementation of the commitment and encryption code keeps both ends of each protocol in step.

Known limits in the current code.

  • The Semaphore proof uses a group with one member, so it works as a replay guard, not as a way to hide among other users. This is an inference from private-search.ts.
  • selectRelays reads relay endpoints from configuration and assigns every relay a fixed reputation of 50. The on-chain reputation selection in the documentation is not wired into route selection.
  • Payouts use a fixed nominal amount of 0.001 ETH on the Hoodi testnet. The code comments say a production version would convert the USDC price with an oracle.

Run it locally

You need Node.js 20 or later, pnpm 9 or later, and Docker for SearXNG.

  1. Clone the repository and install dependencies.

    git clone https://github.com/WhyAsh5114/MeshSearch.git
    cd MeshSearch
    pnpm install
    
  2. Run the interactive setup. It generates keys, deploys the contracts to Base Sepolia, writes the .env files, starts all services, and saves an MCP client configuration to mcp-config.json.

    pnpm run:setup
    
  3. Copy mcp-config.json into your MCP client (Claude Desktop or Cursor). Alternatively, point the client at http://localhost:3038/mcp.

  4. Optional: start the web app and open http://localhost:3000.

    cd apps/web && pnpm dev
    
  5. Optional: run the tests.

    pnpm turbo test
    

x402 payments and BitGo are optional and need extra environment variables. The repository README lists them.

Reference

LayerTools
Zero knowledgeSemaphore v4, Groth16 proofs, Poseidon hashing
Cryptography@noble/curves (secp256k1 ECDH), @noble/hashes (SHA-256, HKDF), AES-256-GCM
Paymentsx402 (@x402/core, @x402/evm), USDC on Base Sepolia
PayoutsBitGo SDK, self-custody MPC (multi-party computation) hot wallets, Hoodi testnet
ContractsSolidity 0.8.24, Hardhat, ethers v6
NamingENS through @ensdomains/ensjs and viem
MCP@modelcontextprotocol/sdk, Streamable HTTP and stdio
SearchSearXNG, self-hosted
ServicesHono (relay and storage services)
FrontendNext.js, Tailwind CSS, wagmi, shadcn/ui, Vercel AI SDK
Monorepopnpm workspaces, Turborepo

The MCP server exposes three tools.

ToolPurpose
private_searchRun a committed, routed, paid search
get_historyRead and decrypt stored search records
compile_reportCombine searches into one encrypted document

Outcome

The team built MeshSearch at ETHMumbai 2026, a 42-hour hackathon at the World Trade Center in Mumbai, starting 2026-03-13. The hackathon page lists the placement as Winner. MeshSearch also took the BitGo track prize for the best privacy project built with BitGo, and the ETHMumbai main track for AI projects.

The repository has 52 commits from three contributors. Most were made between 2026-03-13 and 2026-03-15. On 2026-09-08, a contributor added a presentation, a cookbook, and a technical paper under docs/. The project runs on testnets (Base Sepolia and Hoodi).

Liked MeshSearch? Here's my background.

Full-stack TypeScript, shipped to real users.