pritthwishGC/Web-search-MCP
If you are the rightful owner of Web-search-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Web Search MCP Server is a robust Model Context Protocol (MCP) server designed to enhance AI assistants with web search and page scraping capabilities.
🔍 Web Search MCP Server
A powerful Model Context Protocol (MCP) server that brings web search and page scraping capabilities to your AI assistants! 🚀
✨ Features
| Feature | Description |
|---|---|
| 🌐 Web Search | Search the web using Google via Serper API |
| 📄 Page Scraping | Extract content from any webpage using ScrapingDog |
| ⚡ Edge Deployment | Runs on Cloudflare Workers for ultra-low latency |
| 🔌 MCP Compatible | Works with Claude, Kiro, and any MCP client |
| 🔒 Secure | API keys stored as encrypted secrets |
🛠️ Tools
🔎 web_search
Search the web using Google via Serper API.
{
"query": "latest AI news",
"num_results": 10,
"search_type": "search"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | ✅ | The search query |
num_results | number | ❌ | Results count (1-100, default: 10) |
search_type | string | ❌ | search | news | images |
📄 scrape_page
Extract content from a web page.
{
"url": "https://example.com",
"render_js": true,
"premium": false
}
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | ✅ | The URL to scrape |
render_js | boolean | ❌ | Enable JavaScript rendering |
premium | boolean | ❌ | Use premium proxies |
📁 Project Structure
📦 Web-search-MCP
├── 📂 src/
│ ├── 📄 index.ts # 🚀 Main entry & router
│ ├── 📂 clients/
│ │ ├── 📄 serper.ts # 🔍 Serper API client
│ │ └── 📄 scrapingdog.ts # 🐕 ScrapingDog client
│ ├── 📂 handlers/
│ │ ├── 📄 mcp.ts # 📡 MCP JSON-RPC handler
│ │ └── 📄 sse.ts # 📺 SSE session handler
│ ├── 📂 tools/
│ │ ├── 📄 registry.ts # 📋 Tool registry
│ │ ├── 📄 web-search.ts # 🔎 Search tool
│ │ └── 📄 scrape-page.ts # 📄 Scrape tool
│ └── 📂 validators/
│ └── 📄 index.ts # ✅ Input validators
├── 📄 wrangler.toml # ⚙️ Cloudflare config
├── 📄 package.json
├── 📄 tsconfig.json
└── 📄 vitest.config.ts
📋 Prerequisites
Before you begin, ensure you have:
- ✅ Node.js 18+ installed
- ✅ Cloudflare account (Sign up free)
- ✅ Serper API Key (Get one here)
- ✅ ScrapingDog API Key (Get one here)
🚀 Quick Start
1️⃣ Clone & Install
git clone https://github.com/pritthwishGC/Web-search-MCP.git
cd Web-search-MCP
npm install
2️⃣ Configure Local Environment
Create a .dev.vars file:
SERPER_API_KEY=your_serper_api_key_here
SCRAPINGDOG_API_KEY=your_scrapingdog_api_key_here
3️⃣ Run Locally
npm run dev
🎉 Server running at http://localhost:8787
☁️ Deployment
Step 1: Login to Cloudflare
npx wrangler login
Step 2: Set Your API Secrets 🔐
npx wrangler secret put SERPER_API_KEY
# 📝 Enter your Serper API key when prompted
npx wrangler secret put SCRAPINGDOG_API_KEY
# 📝 Enter your ScrapingDog API key when prompted
Step 3: Deploy 🚀
npm run deploy
✅ Your MCP server is now live at:
https://web-search-mcp-server.<your-subdomain>.workers.dev
🔑 Updating API Keys
💻 Via CLI (Recommended)
# 🔄 Update Serper API key
npx wrangler secret put SERPER_API_KEY
# 🔄 Update ScrapingDog API key
npx wrangler secret put SCRAPINGDOG_API_KEY
🌐 Via Cloudflare Dashboard
- Go to dash.cloudflare.com
- Navigate to Workers & Pages → web-search-mcp-server
- Click Settings → Variables and Secrets
- Click ✏️ Edit next to the secret
- Enter new value and Save
💡 No redeployment needed! Secrets update immediately.
🔌 MCP Client Configuration
Add this to your MCP client config:
{
"mcpServers": {
"web-search": {
"url": "https://web-search-mcp-server.<your-subdomain>.workers.dev/mcp"
}
}
}
📍 Config File Locations
| Client | Location |
|---|---|
| 🟦 Kiro (Workspace) | .kiro/settings/mcp.json |
| 🟦 Kiro (User) | ~/.kiro/settings/mcp.json |
| 🟣 Claude Desktop | claude_desktop_config.json |
🌐 API Endpoints
| Method | Path | Description |
|---|---|---|
POST | /mcp | 📡 MCP JSON-RPC endpoint |
GET | /sse | 📺 SSE connection |
POST | /message | 💬 MCP messages (SSE) |
GET | /health | 💚 Health check |
🧪 Testing
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
📜 Scripts
| Command | Description |
|---|---|
npm run dev | 🔧 Start local dev server |
npm run deploy | 🚀 Deploy to Cloudflare |
npm test | 🧪 Run tests |
npm run test:watch | 👀 Watch mode |
🔐 Environment Variables
| Variable | Description |
|---|---|
SERPER_API_KEY | 🔍 Serper API key for Google Search |
SCRAPINGDOG_API_KEY | 🐕 ScrapingDog API key for scraping |
📄 License
MIT © pritthwishGC
Made with ❤️ for the MCP community
⭐ Star this repo if you find it useful!