mcp-google-custom-search: Instructions file for Claude Code

CLAUDE.md

mcp-google-custom-search CLAUDE.md is an instructions file for Claude Code from A1-x-Tech/mcp-google-custom-search. It costs 2,472 tokens per session, scanned A, original, MIT.

A project instruction file for an MCP server that searches the web and images through Google's Custom Search API. The server is read-only, so it cannot change search data.

In plain words
What is it for?
Use it when developing, testing, type-checking, building, or adding tools to the Google Custom Search MCP server. It also documents the API key and search-engine ID it needs.
Why use it?
It gives contributors the commands, design rules, and configuration details needed to work on the server without breaking its existing behavior.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is A1-x-Tech/mcp-google-custom-search's own configuration. It tells Claude Code how to work on mcp-google-custom-search itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-google-custom-search configures →

Reuse

Borrowing it

Nothing to install: this file belongs to A1-x-Tech/mcp-google-custom-search. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/A1-x-Tech/mcp-google-custom-search/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/A1-x-Tech/mcp-google-custom-search

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-google-custom-search CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/a1-x-tech/mcp-google-custom-search/claude-md/github.svg)](https://agentmods.dev/instructions/a1-x-tech/mcp-google-custom-search/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/a1-x-tech/mcp-google-custom-search/claude-md"><img src="https://agentmods.dev/badge/instructions/a1-x-tech/mcp-google-custom-search/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-google-custom-search CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/a1-x-tech/mcp-google-custom-search/claude-md"><img src="https://agentmods.dev/badge/instructions/a1-x-tech/mcp-google-custom-search/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,472 This file is loaded in full into every session.
When invoked 2,472 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02472 $0.02472
Opus 5 $0.01236 $0.01236
Sonnet 5 $0.00494 $0.00494
Haiku 4.5 $0.00247 $0.00247

Measured 8d ago against content hash 21de1df4c239, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

mcp-google-custom-search CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP server for the Google Custom Search JSON API (TypeScript, stdio). Read-only end to end: search (web), search_images and the raw_request escape hatch all hit the API's single GET endpoint customsearch/v1 on https://customsearch.googleapis.com. Auth is a static Google Cloud API key sent in the X-Goog-Api-Key header (no OAuth, no scopes, no token refresh) plus a Programmable Search Engine id (cx) — configured as the default engine or passed per call as engine_id. The API has no write endpoint; nothing here can modify data.

Commands

npm run dev        # run from source (tsx watch)
npm test           # unit tests + dist smoke, no network
npm run typecheck  # types for src + tests
npm run build      # emit dist/
npm run smoke      # live READ-ONLY check: one 1-result search (argv/GOOGLE_CUSTOM_SEARCH_SMOKE_QUERY)

Architecture

  • src/config.ts — env → config. Credentials: GOOGLE_CUSTOM_SEARCH_API_KEY (the key — required for anything to work) + GOOGLE_CUSTOM_SEARCH_ENGINE_ID (the default cx; addressing, not a credential — tools can override it per call); optional GOOGLE_CUSTOM_SEARCH_API_BASE, GOOGLE_CUSTOM_SEARCH_TIMEOUT_MS, GOOGLE_CUSTOM_SEARCH_MAX_RETRIES. No credentials at all is NOT an error: the fields stay undefined and the server starts degraded. An engine id without a key throws ConfigError incomplete_config (the key cannot come per call, so that install can never work). Also home to CredentialsError / MISSING_CREDENTIALS_MESSAGE (names both variables and the restart), EngineIdError / MISSING_ENGINE_ID_MESSAGE (missing cx: fix per call via engine_id or via the env var + restart) and hasCredentials() (= the key is present).
  • src/client.ts — all HTTP and all wire mapping. apiKey() throws CredentialsError before any fetch; resolveEngineId() prefers the per-call override and throws a typed EngineIdError (naming both the env var and the engine_id parameter) when neither exists; request() resolves the path against the base and rejects foreign origins (SSRF guard), sends the key in the X-Goog-Api-Key header (never the URL), fills in the configured cx when the path has none, enforces an AbortController timeout that also covers reading the body, retries 429 and 5xx/network errors with backoff honoring Retry-After in both RFC 9110 forms — delta-seconds and HTTP-date (every request is an idempotent GET — this API has no writes an ambiguous failure could duplicate) and throws GoogleCustomSearchError(status, body). buildSearchQuery() / buildImageSearchQuery() map the normalized vocabulary to the wire parameters (lr=lang_<code>, cr=country<CC>, siteSearchFilter i/e, filter 0/1, uppercase imgSize, searchType=image); normalizeSearchResponse() reduces the envelope to query/totals/cursors/items with title-url-snippet-metadata (pagemap only on request).
  • src/tools/search.tssearch, plus the shared searchInputFields() schema factory and the toSearchParams() rename that images.ts reuses. src/tools/images.tssearch_images. src/tools/raw.tsraw_request (GET only; the API has no other verbs). src/tools/util.tsok/fail, the four annotation presets (READ_ONLY/WRITE/UPDATE/DESTRUCTIVE; only READ_ONLY is in use — see conventions) shared zod schema factories (querySchema, numSchema, startSchema, languageCodeSchema, countryCodeSchema, dateRestrictSchema, engineIdSchema) and checkPageWindow (the cross-field start + num - 1 <= 100 guard the flat zod shapes cannot express — called by both search tools before the client, so an impossible window never burns a quota unit on a guaranteed 400).
  • src/index.ts — wires every register* into the McpServer. loadConfigOrDegraded() catches ConfigError, pings startup_failed (fire-and-forget) and degrades the config to "no credentials"; an unconfigured start prepends UNCONFIGURED_PREFIX — plus Configuration problem: <message> when a ConfigError was caught — to the initialize instructions, and oninitialized sends server_start for a configured install or unconfigured_start (with the reason) otherwise.
  • src/telemetry.ts — anonymous usage pings (ids/names/versions only, never queries, results or arguments; fire-and-forget, must never block or throw; opt-out ASKADS_TELEMETRY=0). server_start means "a usable install started"; unconfigured_start is a degraded start and startup_failed a malformed config caught at load — both carry a reason from a closed vocabulary (missing_credentials, incomplete_config) — never a variable's name or value.

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 138 lines · 2,472 tokens per session scan A 21de1df4c239

Subscribe to this mod's changes

mcp-google-custom-search CLAUDE.md is an instructions file published in the GitHub repository A1-x-Tech/mcp-google-custom-search (0 stars, last pushed 9d ago), licensed MIT. It adds 2,472 tokens to every session, about $0.0124 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens