tavily-proxy
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tavily-proxysearch the web for latest breakthroughs in quantum computing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tavily-proxy
A Cloudflare Worker that acts as an MCP (Model Context Protocol) proxy for the Tavily API. It provides the same tools as the official Tavily MCP server, but with an API key pool — automatically rotating through multiple Tavily keys and selecting the one with the most remaining credit.
Features
MCP Server — Streamable HTTP transport at
POST /mcp, compatible with any MCP client4 Tavily Tools —
tavily-search,tavily-extract,tavily-crawl,tavily-mapAPI Key Pool — Multiple Tavily API keys stored in Cloudflare KV; each request picks the key with the highest remaining credit
Key Management API — HTTP endpoints to add/delete keys and query their status
Auth Protected — All endpoints (except health check) require an
x-api-keyheader
Related MCP server: Cloudflare Tavily Search MCP
Endpoints
Method | Path | Description |
|
| MCP Streamable HTTP endpoint (tool calls) |
|
| Add a Tavily API key to the pool |
|
| Remove a Tavily API key from the pool |
|
| List all keys and their remaining credits |
|
| Health check (no auth required) |
All endpoints except GET / require the x-api-key header matching your configured AUTH_KEY.
Setup
Prerequisites
Node.js v18+
Wrangler CLI (
npm install -g wrangler)A Cloudflare account
Local Development
# Install dependencies
npm install
# Set your auth key for local dev (already in .dev.vars)
# AUTH_KEY=test-secret-key
# Start local server
npm run devWrangler simulates KV locally — no Cloudflare account needed for development.
Deploy to Production
Create a KV namespace:
npx wrangler kv namespace create KVUpdate
wrangler.toml— replaceYOUR_KV_NAMESPACE_IDwith the real ID from step 1.Set the auth secret:
npx wrangler secret put AUTH_KEYDeploy:
npm run deployAdd Tavily API keys to the pool:
curl -X POST https://your-worker.workers.dev/api/keys \ -H "Content-Type: application/json" \ -H "x-api-key: your-auth-key" \ -d '{"apiKey": "tvly-xxx"}'
Usage
Connect MCP Clients
With mcp-remote (for clients like Cursor, Claude Desktop, etc.):
{
"mcpServers": {
"tavily-proxy": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://your-worker.workers.dev/mcp",
"--header", "x-api-key:${AUTH_KEY}"
],
"env": {
"AUTH_KEY": "your-auth-key"
}
}
}
}Key Management
# Add a key (auto-queries remaining credit from Tavily)
curl -X POST https://your-worker.workers.dev/api/keys \
-H "Content-Type: application/json" \
-H "x-api-key: your-auth-key" \
-d '{"apiKey": "tvly-xxx"}'
# List all keys and credits
curl https://your-worker.workers.dev/api/keys \
-H "x-api-key: your-auth-key"
# Delete a key
curl -X DELETE https://your-worker.workers.dev/api/keys \
-H "Content-Type: application/json" \
-H "x-api-key: your-auth-key" \
-d '{"apiKey": "tvly-xxx"}'How the Key Pool Works
When a tool is called,
KV.list()retrieves all stored API keysThe key with the largest remaining credit is selected
The request is proxied to
api.tavily.comusing that keyAfter the call, the estimated credit cost is deducted locally in KV
When a key is added via
/api/keys, its real remaining credit is fetched from Tavily's/usageendpoint
License
ISC
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloudflare Workers MCP server: agent-workflow-engine
Cloudflare Workers MCP server: ai-crawler-policy
Cloudflare Workers MCP server: ai-model-router
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA unified search and extraction MCP server hosted on Cloudflare Workers that integrates Tavily and Brave Search APIs with automatic API key rotation. It features secure, encrypted storage for keys using Cloudflare D1 and provides an admin interface for managing client tokens and search configurations.11 npmISC
- AlicenseNot gradedqualityCmaintenanceA remote web search MCP server deployed on Cloudflare Workers that wraps Tavily's low-cost search into a 'web_search' tool. It is suitable for mobile/desktop AI clients or any app supporting remote MCP.MIT
- FlicenseNot gradedqualityDmaintenanceA Cloudflare Worker that proxies the Tavily API through MCP, offering search, extract, crawl, and map tools with automatic API key rotation and health-based routing.3-
- AlicenseNot gradedqualityCmaintenanceExposes pooled Tavily API keys through an MCP streamable HTTP endpoint, providing search, extract, crawl, map, research, and pool status tools with automatic key rotation and quota management.MIT