Skip to main content
Glama
ads-mcp-readonly

ads-mcp-readonly

by porrasbrand

ads-mcp-readonly

A read-only MCP server for ad-platform data. Agents can look, never touch.

When AI agents answer questions about ad accounts, the most important feature is what they cannot do. This server gives an agent (Claude Code, Claude Desktop or any MCP client) the numbers it needs — spend, clicks, calls, conversions, leads — and makes changes impossible by design:

  1. No write tools exist. There is no tool to change a budget, a bid, a status or an ad.

  2. Free-form queries are checked before they leave the server. Only a single SELECT on an allow-listed resource passes; mutate, update, delete, create, multiple statements and unknown resources are refused. A LIMIT is enforced.

  3. The HTTP layer can only reach the search endpoint. Every Google Ads request is checked to go to …/googleAds:search — a bug elsewhere still cannot reach a …:mutate endpoint.

  4. Accounts are allow-listed. The server only reads accounts you list explicitly.

  5. Tools are annotated readOnlyHint: true, destructiveHint: false.

The pattern comes from production: I run AI agents that read clients' ad accounts every day, and the rule there is the same — read-only, enforced in code, not in the prompt.

Tools

Tool

What it returns

list_accounts

The accounts this server may read

get_campaign_performance

Per campaign: spend, clicks, calls, conversions or leads for a date range

get_account_summary

Totals across all campaigns of one account

run_readonly_query

A guarded Google Ads Query Language SELECT (google-ads provider only)

Related MCP server: Apple Ads Insights MCP

Try it in one minute (no credentials)

The default demo provider serves invented data for a fictional heating & cooling business, “Acme HVAC”, across four platforms (Google Ads, Local Services Ads, Microsoft Ads, Meta Ads).

git clone https://github.com/porrasbrand/ads-mcp-readonly && cd ads-mcp-readonly
npm install
npm test          # 23 tests, including "a write attempt never reaches the network"

Add it to Claude Code:

claude mcp add ads-readonly -- node /path/to/ads-mcp-readonly/src/index.js

Then ask: “What did Acme HVAC spend on Google Ads last week, by campaign?” — or try “Pause the Acme brand campaign” and watch it refuse.

Google Ads (experimental in v0.1)

ADS_PROVIDER=google-ads \
GOOGLE_ADS_API_VERSION=v21 \
GOOGLE_ADS_DEVELOPER_TOKEN=... \
GOOGLE_ADS_CLIENT_ID=... GOOGLE_ADS_CLIENT_SECRET=... GOOGLE_ADS_REFRESH_TOKEN=... \
GOOGLE_ADS_LOGIN_CUSTOMER_ID=123-456-7890 \
GOOGLE_ADS_ACCOUNT_IDS=111-222-3333,444-555-6666 \
node src/index.js
  • Set GOOGLE_ADS_API_VERSION to a version that is currently supported by Google.

  • For extra safety, create the OAuth refresh token for a Google Ads user with read-only access. Then even the API itself would refuse a change.

  • Status: the Google Ads provider is tested against recorded/mocked API responses only. Please open an issue if something does not match the live API.

Microsoft Ads, Local Services Ads and Meta Ads are available in the demo provider only for now.

Design notes

  • Plain JavaScript (ES modules), Node.js ≥ 20, two dependencies (@modelcontextprotocol/sdk, zod).

  • src/guard.js holds every read-only rule in one place — it is the file to review.

  • Tests use Node's built-in test runner and an in-memory MCP client.

License

MIT · Manuel Porras · manuelporras.com

Available Tools

4 tools
get_account_summaryAccount summaryC
Read-onlyIdempotent

Totals across all campaigns of one account for a date range. Read-only.

Inputs: to (required), from (required), account_id (required).

get_campaign_performanceCampaign performanceB
Read-onlyIdempotent

Spend, clicks, calls, conversions or leads per campaign for a date range. Read-only.

Inputs: to (required), from (required), account_id (required).

list_accountsList ad accountsA
Read-onlyIdempotent

Lists the ad accounts this server may read. Read-only.

Inputs: no named parameters.

run_readonly_queryRead-only GAQL queryA
Read-onlyIdempotent

Runs a Google Ads Query Language SELECT on an allow-listed resource. Anything that could change the account is refused before it leaves the server.

Inputs: query (required), account_id (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation4/5

    Three tools target clearly distinct things (account list, per-campaign metrics, account-level totals), and the read-only restriction is explicit in every description. The main overlap is run_readonly_query, a generic escape hatch that can reproduce the results of the three specialized tools, which could tempt an agent to pick it when a purpose-built tool fits better.

    Naming Consistency5/5

    All four names follow a consistent snake_case verb_noun pattern (list_accounts, get_campaign_performance, get_account_summary, run_readonly_query). Verb choice (list vs get vs run) tracks the semantics sensibly, and the read-only nature is reinforced in descriptions rather than being inconsistently baked into names.

    Tool Count5/5

    Four tools is a tightly scoped surface for a read-only reporting server, and each one maps to a distinct reporting need (discover accounts, per-campaign metrics, account rollups, ad-hoc queries). Nothing feels padded or redundant.

    Completeness4/5

    Account discovery, campaign-level performance, account totals, and an allow-listed GAQL query cover the core read-only lifecycle, and the generic query tool closes most gaps. Minor absences are dedicated tools for enumerating campaigns/ad groups or segment breakdowns, which users must reconstruct via raw GAQL.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides read access to campaign performance data from Google Ads, Meta Ads, and TikTok Ads via live API calls, enabling AI assistants to analyze and audit advertising campaigns.
      16
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only analysis of Apple Ads Platform data, allowing AI assistants to query campaign structure, keywords, search terms, and performance reports without modifying anything.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query campaign performance, metrics, audiences, and geography, and to analyze budgets, wasted spend, and account health through natural language.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude, ChatGPT, Copilot, and Cursor to read Google Ads data—campaigns, ad groups, ads, keywords, search terms, budgets, conversion actions, change history, and custom GAQL queries—through 17 read-only MCP tools. It supports OAuth-authenticated access to real accounts without requiring a developer token, keeping all operations read-only and auditable.
      58 npm
      AGPL 3.0