Tavily Proxy
БесплатноНе проверенA Cloudflare Worker that proxies requests to the Tavily API with automatic key rotation from a pool, providing search, extract, crawl, and map tools via MCP.
Описание
A Cloudflare Worker that proxies requests to the Tavily API with automatic key rotation from a pool, providing search, extract, crawl, and map tools via MCP.
README
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 client - 4 Tavily Tools —
tavily-search,tavily-extract,tavily-crawl,tavily-map - API 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
Endpoints
| Method | Path | Description |
|---|---|---|
POST |
/mcp |
MCP Streamable HTTP endpoint (tool calls) |
POST |
/api/keys |
Add a Tavily API key to the pool |
DELETE |
/api/keys |
Remove a Tavily API key from the pool |
GET |
/api/keys |
List all keys and their remaining credits |
GET |
/ |
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 dev
Wrangler 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 keys - The key with the largest remaining credit is selected
- The request is proxied to
api.tavily.comusing that key - After 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
Установка Tavily Proxy
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/sunwu51/tavily-proxyFAQ
Tavily Proxy MCP бесплатный?
Да, Tavily Proxy MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Tavily Proxy?
Нет, Tavily Proxy работает без API-ключей и переменных окружения.
Tavily Proxy — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Tavily Proxy в Claude Desktop, Claude Code или Cursor?
Открой Tavily Proxy на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Tavily Proxy with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
