Efficient Search
by om-surushe
README.md
# Efficient Search
[](https://www.npmjs.com/package/@om-surushe/efficient-search)
[](https://github.com/om-surushe/EfficientSearch/actions/workflows/ci.yml)
[](LICENSE)
An MCP server that calls Google Programmable Search Engine and returns cleaned, structured search results. It decodes HTML entities, extracts available page metadata, adds a short summary, and caches equivalent requests.
## Install
```bash
npm install -g @om-surushe/efficient-search
```
You need a [Google Programmable Search Engine](https://programmablesearchengine.google.com/) and a [Google API key](https://console.cloud.google.com/apis/credentials).
Add the server to your MCP client:
```json
{
"mcpServers": {
"efficient-search": {
"command": "bunx",
"args": ["@om-surushe/efficient-search"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here",
"SEARCH_ENGINE_ID": "your_search_engine_id"
}
}
}
}
```
## Tools
| Tool | Purpose |
|---|---|
| `web_search` | Search Google with optional result-count, safety, country, and language filters |
| `clear_cache` | Remove all cached responses |
| `get_cache_stats` | Return cache size, capacity, and TTL |
Example request:
```json
{
"query": "typescript documentation",
"num": 5,
"safe": "high",
"gl": "us",
"lr": "lang_en"
}
```
Each result contains its title, URL, cleaned snippet, display host, available metadata, and a score derived from its position in Google's response. The score is not an independent relevance model.
Cache entries are separated by normalized query, result count, safety level, country, and language. The default TTL is 60 minutes.
## Configuration
| Variable | Required | Default | Purpose |
|---|---:|---:|---|
| `GOOGLE_API_KEY` | Yes | — | Google API key |
| `SEARCH_ENGINE_ID` | Yes | — | Programmable Search Engine ID |
| `CACHE_TTL_MINUTES` | No | `60` | Cache lifetime |
| `MAX_RESULTS` | No | `10` | Default result count |
Google API quotas and Programmable Search Engine coverage still apply. This package does not crawl pages or rerank Google's results.
## Development
```bash
npm ci
npm test
npm run typecheck
npm run lint
npm run build
npm run test:server
npm pack --dry-run
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for repository layout and pull-request guidance.
## Security
Keep `GOOGLE_API_KEY` and `SEARCH_ENGINE_ID` in your MCP client's environment or secret store. See [SECURITY.md](SECURITY.md) for credential guidance and private vulnerability reporting.
## License
[MIT](LICENSE) © [Om Surushe](https://github.com/om-surushe)
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues