Agent Search MCP
by lennney
README.md
# Agent Search MCP
> ๐ Free multi-source search for AI agents โ multi-source verification, token savings, MCP native.
[](LICENSE)
[](package.json)
[](https://modelcontextprotocol.io)
**Works with Hermes, Claude Code, Cursor, Windsurf, OpenClaw, and any MCP-compatible client.**
---
[English](#features) ยท [ไธญๆ](#็นๆง) ยท [ๅฎ่ฃ
](#quick-start) ยท [ๆๆกฃ](#documentation)
---
## Quick Start
```bash
# Option 1: npx (recommended)
npx agent-search-mcp
# Option 2: global install
npm install -g agent-search-mcp
```
### Platform Setup
<details>
<summary><b>Hermes</b></summary>
```yaml
# ~/.hermes/config.yaml
mcp_servers:
agent-search:
command: npx
args: ["agent-search-mcp"]
```
</details>
<details>
<summary><b>Claude Code</b></summary>
```json
// ~/.claude/mcp.json
{
"mcpServers": {
"agent-search": {
"command": "npx",
"args": ["agent-search-mcp"]
}
}
}
```
</details>
<details>
<summary><b>Cursor</b></summary>
```json
// .cursor/mcp.json
{
"mcpServers": {
"agent-search": {
"command": "npx",
"args": ["agent-search-mcp"]
}
}
}
```
</details>
<details>
<summary><b>Windsurf</b></summary>
```json
// ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"agent-search": {
"command": "npx",
"args": ["agent-search-mcp"]
}
}
}
```
</details>
<details>
<summary><b>OpenClaw</b></summary>
```typescript
// openclaw.config.ts
{
mcpServers: {
"agent-search": {
command: "npx",
args: ["agent-search-mcp"]
}
}
}
```
</details>
---
## Features
### ๐ Free by Default
No API key required. Uses DuckDuckGo + Sogou search engines.
| Engine | Type | API Key | Coverage |
|--------|------|---------|----------|
| DuckDuckGo | Free | โ | Global |
| Sogou | Free | โ | Chinese |
| Brave Search | Paid (Free Tier) | Optional | Global |
| Tavily | Paid (Free Tier) | Optional | Global |
### ๐ฏ Multi-Source Verification
Results are verified across multiple search engines. Each result includes a **confidence score** (1-3) based on how many engines returned it.
```json
{
"title": "Build an MCP Server",
"url": "https://example.com/mcp",
"snippet": "How to build MCP servers...",
"confidence": 2 // Verified by 2 engines
}
```
### ๐ฐ Save Tokens
Optimized output reduces token consumption by ~40-50%:
| Optimization | Savings |
|-------------|---------|
| Top-1 snippet per URL | ~25% |
| Title truncation (โค100 chars) | ~15% |
| Snippet truncation (โค200 chars) | ~15% |
| Deduplication | ~10% |
| Confidence filtering | ~10% |
### ๐ง Progressive Disclosure
Three tools, discoverable by agents:
| Tool | Purpose | When to Use |
|------|---------|-------------|
| `free_search` | Basic search | Quick questions |
| `free_search_advanced` | Filtered search | Date ranges, domains, high confidence |
| `free_extract` | URL extraction | Read full page content |
---
## Tools
### `free_search`
Basic web search with multi-source verification.
```json
{
"query": "TypeScript MCP server",
"count": 5
}
```
### `free_search_advanced`
Advanced search with filters.
```json
{
"query": "MCP server",
"count": 10,
"min_confidence": 2,
"time_range": "week",
"language": "zh",
"include_domains": ["github.com"],
"exclude_domains": ["reddit.com"]
}
```
**Parameters:**
- `min_confidence` (1-3): Only return results verified by N+ sources
- `time_range`: day, week, month, year
- `language`: auto, en, zh
- `include_domains`: Only search these domains
- `exclude_domains`: Exclude these domains
### `free_extract`
Extract full content from a URL as Markdown.
```json
{
"url": "https://example.com/article",
"max_length": 5000
}
```
---
## Resources
### `search://capabilities`
Returns a Markdown document describing all available tools and features. Agents can discover capabilities on-demand.
### `search://health`
Returns JSON with health status of each search provider:
```json
[
{
"provider": "duckduckgo",
"lastSuccess": 1719000000000,
"errorCount": 0,
"avgLatency": 450,
"isHealthy": true
}
]
```
---
## Configuration
### Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| `BRAVE_API_KEY` | Brave Search API key (2000 free/month) | No |
| `TAVILY_API_KEY` | Tavily API key (1000 free/month) | No |
| `LOG_LEVEL` | Log level (info, debug) | No |
**Zero config works** โ no API keys needed for basic search.
### With Paid Engines
Set environment variables to enable fallback to paid engines when free results are insufficient:
```bash
export BRAVE_API_KEY=your_key_here
export TAVILY_API_KEY=your_key_here
```
---
## Architecture
```
Agent
โ MCP Protocol (stdio)
MCP Server
โโโ Tools Layer (progressive disclosure)
โ โโโ free_search (default)
โ โโโ free_search_advanced (optional)
โ โโโ free_extract (optional)
โโโ Aggregation Layer
โ โโโ Top-1 Snippet merge
โ โโโ URL + Title dedup
โ โโโ Scoring + Confidence
โ โโโ Output truncation
โโโ Fallback Chain
โ โโโ Phase 1: Free engines (DDG + Sogou)
โ โโโ Phase 2: Paid engines (Brave + Tavily)
โโโ Infrastructure
โโโ Cache (LRU, 60s TTL)
โโโ Rate Limiter (1s per provider)
โโโ Health Tracker
โโโ SSRF Protection
```
---
## Documentation / ๆๆกฃ
| Document | Description |
|----------|-------------|
| [PRD](docs/prd.md) | Product Requirements Document |
| [Architecture](docs/architecture.md) | Technical Architecture |
| [Plan](docs/plan.md) | Implementation Plan |
| [Review Results](docs/review-results.md) | 5-Team Review Results |
| [Fork Plan](docs/fork-plan.md) | Fork & Modification Plan |
| [CHANGELOG](CHANGELOG.md) | Version History |
---
## Development
```bash
# Clone
git clone https://github.com/lennney/agent-search-mcp.git
cd agent-search-mcp
# Install
npm install
# Build
npm run build
# Test
npm test
# Run
npm start
```
---
## License
[Apache License 2.0](LICENSE)
Based on [open-websearch](https://github.com/Aas-ee/open-websearch) by Aas-ee.
```
Copyright 2025 Open-WebSearch MCP Server Contributors
Based on open-websearch by Aas-ee (Apache 2.0).
Modified by Agent Search MCP Contributors.
Copyright 2026 Agent Search MCP Contributors
```
---
## Contributing
Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
---
## Keywords
MCP server, Model Context Protocol, AI agent search, free web search, multi-source search, DuckDuckGo MCP, Sogou search, token optimization, Hermes MCP, Claude Code MCP, Cursor MCP, AI tool, web search for agents, search aggregation, confidence scoring
TDQS
A4.3/5.0
Scored across 3 tools
Disambiguation5/5
Each tool has a distinctly different purpose: basic search (free_search), advanced search with filters (free_search_advanced), and content extraction from URLs (free_extract). No overlap.
Naming Consistency4/5
All tools share the 'free_' prefix. While 'free_search' and 'free_search_advanced' follow a noun-modifier pattern, 'free_extract' uses a verb form, creating a minor inconsistency.
Tool Count5/5
Three tools cover the essential functionality of a search server (search, advanced search, and content extraction) without redundancy or excess.
Completeness4/5
Core needs are met, but advanced features like pagination, result count control, or batch operations are absent, which could be limiting for complex workflows.