Skip to main content
Glama
Efficient Search

Efficient Search

by om-surushe

Efficient Search

npm version CI License: MIT

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

npm install -g @om-surushe/efficient-search

You need a Google Programmable Search Engine and a Google API key.

Add the server to your MCP client:

{
  "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"
      }
    }
  }
}

Related MCP server: google-serp-mcp

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:

{
  "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

npm ci
npm test
npm run typecheck
npm run lint
npm run build
npm run test:server
npm pack --dry-run

See 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 for credential guidance and private vulnerability reporting.

License

MIT © Om Surushe

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      C
      maintenance
      Enables web search and anonymous public-page retrieval through MCP, with provider-neutral selection, bounded plain-text results, and built-in auditing.
      2
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to run local web searches with automatic failover across multiple search providers and to extract public web pages as titles and Markdown content, using circuit breaking and key-redacted logging.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP clients to run searches across Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay, and other engines, returning organic results, news, images, shopping, weather, and stock data as JSON or Markdown. It also exposes per-engine parameter schemas as resources and offers optional interactive table and dashboard views.
      -