MCP Nexus MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "ADMIN_API_TOKEN=${ADMIN_API_TOKEN}" -e "KEY_ENCRYPTION_SECRET=${KEY_ENCRYPTION_SECRET}" mcp-nexus-6ba6 -- npx -y @anthropic-ai/mcp-proxy https://your-worker.workers.dev/mcp
Required:ADMIN_API_TOKENKEY_ENCRYPTION_SECRET
README.md

Unified MCP server for Tavily and Brave Search with API key rotation

MCP Nexus - Cloudflare Workers

One-click deployment of MCP Nexus to Cloudflare's free tier. This provides a unified MCP server for Tavily and Brave Search APIs with automatic API key rotation.

Features

  • Zero-cost hosting on Cloudflare Workers free tier
  • D1 Database for persistent storage (automatic provisioning)
  • Encrypted API keys with Web Crypto API
  • Admin UI included - Full web interface for managing keys and tokens
  • 7 MCP tools: tavily_search, tavily_extract, tavily_crawl, tavily_map, tavily_research, brave_web_search, brave_local_search

Deploy

Option 1: One-Click Deploy

Click the button above and follow the prompts. You'll be asked to:

  1. Authorize Cloudflare to access your GitHub (fork will be created)
  2. Configure secrets:
    • ADMIN_API_TOKEN: Token for admin API access (generate with openssl rand -hex 32)
    • KEY_ENCRYPTION_SECRET: Key for encrypting API keys (generate with openssl rand -base64 32)

Option 2: Manual Deploy

# Clone the repo
git clone https://github.com/ykq007/mcp-nexus.git
cd mcp-nexus/packages/worker

# Install dependencies
npm install

# Create D1 database
npx wrangler d1 create mcp-nexus-db
# Copy the database_id from output to wrangler.jsonc

# Set secrets
npx wrangler secret put ADMIN_API_TOKEN
npx wrangler secret put KEY_ENCRYPTION_SECRET

# Run migrations and deploy
npm run deploy

Post-Deployment Setup

After deployment, you need to add API keys and create client tokens.

1. Add Tavily API Keys

curl -X POST https://your-worker.workers.dev/admin/api/tavily-keys \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"label": "Primary Key", "key": "tvly-xxxxx"}'

2. Add Brave API Keys (Optional)

curl -X POST https://your-worker.workers.dev/admin/api/brave-keys \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"label": "Primary Key", "key": "BSAxxxxx"}'

3. Create Client Token

curl -X POST https://your-worker.workers.dev/admin/api/tokens \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"description": "Claude Desktop"}'

Save the returned token - it's only shown once.

MCP Client Configuration

Claude Desktop / Cline

{
  "mcpServers": {
    "mcp-nexus": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-proxy", "https://your-worker.workers.dev/mcp"],
      "env": {
        "MCP_HEADERS": "Authorization: Bearer YOUR_CLIENT_TOKEN"
      }
    }
  }
}

Direct HTTP

curl -X POST https://your-worker.workers.dev/mcp \
  -H "Authorization: Bearer YOUR_CLIENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": 1
  }'

API Endpoints

Endpoint Auth Description
POST /mcp Client Token MCP JSON-RPC endpoint
GET /health None Health check
GET /admin/api/tavily-keys Admin Token List Tavily keys
POST /admin/api/tavily-keys Admin Token Add Tavily key
DELETE /admin/api/tavily-keys/:id Admin Token Delete Tavily key
GET /admin/api/brave-keys Admin Token List Brave keys
POST /admin/api/brave-keys Admin Token Add Brave key
DELETE /admin/api/brave-keys/:id Admin Token Delete Brave key
GET /admin/api/tokens Admin Token List client tokens
POST /admin/api/tokens Admin Token Create client token
DELETE /admin/api/tokens/:id Admin Token Revoke client token
GET /admin/api/settings Admin Token Get settings
PUT /admin/api/settings Admin Token Update settings
GET /admin/api/usage Admin Token View usage logs

Local Development

# Install dependencies
npm install

# Create local D1 database
npm run db:migrate:local

# Start dev server
npm run dev

Architecture

┌─────────────────────────────────────────────────────────┐
│                  Cloudflare Workers                      │
├─────────────────────────────────────────────────────────┤
│  Hono Router                                            │
│  ├── /mcp (MCP JSON-RPC)                               │
│  ├── /admin/api/* (Admin API)                          │
│  └── /health                                           │
├─────────────────────────────────────────────────────────┤
│  Services                                               │
│  ├── Key Pool (rotation, cooldown)                     │
│  ├── Tavily Client                                     │
│  └── Brave Client                                      │
├─────────────────────────────────────────────────────────┤
│  D1 Database

Tools (7)

tavily_searchPerform a web search using Tavily
tavily_extractExtract content from a URL using Tavily
tavily_crawlCrawl a website using Tavily
tavily_mapMap a website using Tavily
tavily_researchPerform comprehensive research using Tavily
brave_web_searchPerform a web search using Brave Search
brave_local_searchPerform a local search using Brave Search

Environment Variables

ADMIN_API_TOKENrequiredToken for admin API access
KEY_ENCRYPTION_SECRETrequiredKey for encrypting API keys

Configuration

claude_desktop_config.json
{"mcpServers": {"mcp-nexus": {"command": "npx", "args": ["-y", "@anthropic-ai/mcp-proxy", "https://your-worker.workers.dev/mcp"], "env": {"MCP_HEADERS": "Authorization: Bearer YOUR_CLIENT_TOKEN"}}}}

Try it

Search for the latest developments in AI regulation using Tavily.
Find local coffee shops in downtown Seattle using Brave Search.
Extract the main points from this URL: [insert URL] using Tavily.
Perform a research report on the current state of renewable energy.

Frequently Asked Questions

What are the key features of MCP Nexus?

Zero-cost hosting on Cloudflare Workers free tier. D1 Database for persistent storage. Encrypted API keys with Web Crypto API. Automatic API key rotation for Tavily and Brave. Full web interface for managing keys and tokens.

What can I use MCP Nexus for?

Centralizing multiple search API keys for team or personal use. Automating web research tasks with persistent search history. Building a secure, managed search proxy for Claude Desktop. Managing search API usage logs and settings via an admin dashboard.

How do I install MCP Nexus?

Install MCP Nexus by running: https://deploy.workers.cloudflare.com/?url=https://github.com/ykq007/mcp-nexus/tree/main/packages/worker

What MCP clients work with MCP Nexus?

MCP Nexus works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Nexus docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare