{"id":44975972,"url":"https://github.com/k-l-lambda/search-mcp","last_synced_at":"2026-02-18T17:04:55.083Z","repository":{"id":321924794,"uuid":"1087649258","full_name":"k-l-lambda/search-mcp","owner":"k-l-lambda","description":"A MCP project for agent to search web information","archived":false,"fork":false,"pushed_at":"2025-11-01T11:07:46.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T13:07:06.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k-l-lambda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-01T10:58:58.000Z","updated_at":"2025-11-01T11:07:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/k-l-lambda/search-mcp","commit_stats":null,"previous_names":["k-l-lambda/search-mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/k-l-lambda/search-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fsearch-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fsearch-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fsearch-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fsearch-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k-l-lambda","download_url":"https://codeload.github.com/k-l-lambda/search-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k-l-lambda%2Fsearch-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29587066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T16:55:40.614Z","status":"ssl_error","status_checked_at":"2026-02-18T16:55:37.558Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-18T17:04:49.675Z","updated_at":"2026-02-18T17:04:55.064Z","avatar_url":"https://github.com/k-l-lambda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search MCP Server\n\nA web search server based on Model Context Protocol (MCP) that supports multiple search engines with automatic fallback functionality.\n\n## ✨ Features\n\n- 🔍 **Multiple Search Engine Support**\n  - SerpAPI (recommended - requires API key)\n  - Baidu\n  - Google\n  - DuckDuckGo\n  - SearXNG\n- 🔄 Automatic fallback mechanism\n- 🌐 Proxy support (automatically uses `http://localhost:1081`)\n- 📦 Fully compatible with MCP protocol\n- 🎯 Structured search results (title, link, snippet)\n\n## 📦 Installation\n\n```bash\nnpm install\nnpm run build\n```\n\n## 🚀 Usage\n\n### Option 1: Use SerpAPI (Recommended)\n\n**Why SerpAPI?**\n- ✅ Stable and reliable, no anti-scraping issues\n- ✅ Free tier: 100 searches/month\n- ✅ Supports multiple search engines (Google, Bing, Baidu, etc.)\n- ✅ Official API, fast response\n\n**Get API Key:**\n1. Visit https://serpapi.com/\n2. Register for a free account\n3. Get your API Key\n\n**Configuration:**\n```bash\n# Method 1: Use .env.local file (recommended)\ncp .env.example .env.local\n# Edit .env.local, add your API Key\n# SERPAPI_KEY=your_api_key_here\n\n# Method 2: Use environment variable\nexport SERPAPI_KEY=\"your_api_key_here\"\n```\n\n**Test Search:**\n```bash\n# Build the project\nnpm run build\n\n# Run test (automatically reads .env.local)\nnpm run dev\n# or\nnpx tsx src/test.ts\n```\n\n### Option 2: Use Open Source Engines (May Encounter Anti-Scraping)\n\nDirectly use the scraper engines implemented in the code, but may encounter:\n- 503 errors\n- CAPTCHA blocking\n- Timeout issues\n\n## 🔧 Claude Code Configuration\n\nAfter configuring `.env.local`, add MCP server to Claude Code configuration:\n\n**Recommended Configuration (using .env.local):**\n```json\n{\n  \"mcpServers\": {\n    \"search\": {\n      \"command\": \"node\",\n      \"args\": [\"/home/ubuntu/work/search-mcp/dist/index.js\"]\n    }\n  }\n}\n```\n\n**Or specify environment variables in config:**\n```json\n{\n  \"mcpServers\": {\n    \"search\": {\n      \"command\": \"node\",\n      \"args\": [\"/home/ubuntu/work/search-mcp/dist/index.js\"],\n      \"env\": {\n        \"SERPAPI_KEY\": \"your_serpapi_key_here\"\n      }\n    }\n  }\n}\n```\n\n\u003e **Tip:** Using `.env.local` file for key management is more secure and convenient.\n\n## 🛠️ Development\n\n```bash\n# Development mode\nnpm run dev\n\n# Build\nnpm run build\n\n# Run built version\nnpm start\n```\n\n## 📖 Search Tool API\n\nThe MCP server provides a `web_search` tool with the following parameters:\n\n- `query` (required): Search query string\n- `engine` (optional): Search engine to use\n  - `auto` (default): Automatically try all engines with fallback\n  - `serpapi`: Use SerpAPI (requires SERPAPI_KEY)\n  - `baidu`: Use Baidu only\n  - `google`: Use Google only\n  - `duckduckgo`: Use DuckDuckGo only\n  - `searxng`: Use SearXNG only\n- `max_results` (optional): Maximum number of results (1-50, default: 10)\n- `language` (optional): Language preference (default: \"en\")\n\n## 💡 Usage Examples\n\nCall in Claude Code:\n\n```typescript\nweb_search({\n  query: \"gold price today\",\n  engine: \"auto\",\n  max_results: 5\n})\n```\n\n## 🌍 Environment Variables\n\n- `https_proxy` / `HTTPS_PROXY`: Proxy server URL (default: http://localhost:1081)\n- `SERPAPI_KEY`: SerpAPI key (optional but highly recommended)\n\n## 📂 Project Structure\n\n```\nsearch-mcp/\n├── src/\n│   ├── index.ts              # MCP server entry point\n│   ├── search/\n│   │   ├── base.ts           # Search engine base class\n│   │   ├── serpapi.ts        # SerpAPI implementation (recommended)\n│   │   ├── baidu.ts          # Baidu search\n│   │   ├── google.ts         # Google search\n│   │   ├── duckduckgo.ts     # DuckDuckGo search\n│   │   ├── searxng.ts        # SearXNG search\n│   │   └── manager.ts        # Search manager (fallback logic)\n│   └── utils/\n│       └── http.ts           # HTTP client (proxy support)\n├── package.json\n├── tsconfig.json\n├── PLAN.md                    # Development plan\n├── SOLUTION.md                # Problem solutions\n└── README.md                  # This file\n```\n\n## ⚠️ Anti-Scraping Issues\n\nDue to strict anti-scraping measures by major search engines (Google, Baidu, DuckDuckGo), direct scraping may encounter:\n- 503 Service Unavailable\n- CAPTCHA blocking\n- IP bans\n- Request timeouts\n\n**Strongly recommend using SerpAPI**, which provides official API access without anti-scraping concerns.\n\nSee `SOLUTION.md` for alternative solutions.\n\n## 📝 License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-l-lambda%2Fsearch-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk-l-lambda%2Fsearch-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk-l-lambda%2Fsearch-mcp/lists"}