# Google Search Console, GA4, Clarity & Bing MCP Server (`muhammadafzal/gsc-ga4-clarity-mcp-server`) Actor

Google Search Console MCP server with GA4, Clarity and Bing Webmaster Tools: ask Claude, ChatGPT or Cursor about rankings, traffic, conversions and UX issues.

- **URL**: https://apify.com/muhammadafzal/gsc-ga4-clarity-mcp-server.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** MCP servers, SEO tools, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.20 / 1,000 data calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Search Console, GA4, Clarity & Bing MCP Server

Google Search Console, GA4, Clarity & Bing MCP Server is a hosted Google Search Console MCP server that also connects Google Analytics 4, Microsoft Clarity and Bing Webmaster Tools. Claude, ChatGPT, Cursor, n8n or any other MCP client can then answer questions like "which pages lost clicks this month and why" from your real data. Its 31 tools cover:

- rankings, period comparisons and hourly data;
- ready-made SEO analyses: anomalies, brand vs non-brand, content decay, search appearance and segments;
- URL inspection and sitemaps;
- GA4 reports, presets, funnels, realtime, property configuration and change history;
- Clarity UX metrics per page;
- PageSpeed scores and Core Web Vitals from real Chrome users, with your free Google API key;
- reports that join Search Console, GA4 and Clarity per page, per site, or across all your sites;
- Bing Webmaster Tools: Bing search performance, URL index status, crawl health, inbound links, keyword demand and sitemaps, with your Bing API key;
- changes you allow: sitemaps, Search Console and Bing sites, URL submissions to Bing, and GA4 annotations, key events and custom definitions.

It costs **USD 0.019 per data call** (USD 19 per 1,000, less on higher Apify plans) plus a USD 0.005 start fee per server run. Discovery and configuration tools and empty results are free.

It is for SEO specialists, marketers, agencies and site owners who want an AI assistant to read Search Console, GA4, Clarity and Bing Webmaster Tools without installing anything on their computer. It runs on Apify with your own Google, Clarity and Bing credentials, reads data only unless you turn on **Allow writes**, and runs in your own Apify account.

### What can I ask it?

| Tool | What it answers | Charged |
|---|---|---|
| `list_properties` | Which Search Console sites, GA4 properties and Clarity projects the credentials can read, and the exact fix when access is missing | Free |
| `gsc_search_analytics` | Clicks, impressions, CTR and position by query, page, country, device, date, hour, search appearance or branded classification, for web, image, video, News, Discover, Google News and Lens results, with regex filters and paging | 1 data call |
| `gsc_compare_periods` | What gained or lost clicks, impressions or position vs the previous period or year, or only the new or lost keywords | 1 data call |
| `gsc_opportunities` | Striking-distance queries (position 8-20), page-one queries with unusually low CTR, and keyword cannibalization | 1 data call |
| `gsc_insights` | Ready-made analyses: daily trend with week-over-week change and anomalous days, brand vs non-brand, named segments (sections or topics), content decay with the likely cause, and search appearance types | 1 data call |
| `gsc_inspect_urls` | Index status, coverage, last crawl, Google vs declared canonical, robots.txt and rich results for up to 20 URLs or your top pages, with a summary | 1 per URL |
| `gsc_sitemaps` | Submitted sitemaps with warnings, errors and URL counts; with writes allowed, submit or remove a sitemap (needs the `webmasters` scope) | 1 data call |
| `gsc_manage_sites` | Listed only with writes allowed. Add a Search Console property (Domain or URL prefix) to your account, or remove one. Needs the `webmasters` scope | 1 per change |
| `ga4_run_report` | Any GA4 dimensions and metrics (sessions, users, key events, revenue, engagement) with filters, sorting and a comparison range | 1 data call |
| `ga4_insights` | Up to 5 ready-made GA4 reports in one call: channels, source/medium, campaigns, Google Ads campaigns, landing pages, pages, events, key events, ecommerce items, devices, countries, new vs returning, audiences, site search, daily trend | 1 per report with data |
| `ga4_funnel_report` | Users, completion and drop-off per step of a funnel you describe (events and page paths), by device or channel, with the next pages after each step | 1 data call |
| `ga4_realtime_report` | Active users, views and events in the last 30 minutes | 1 data call |
| `ga4_metadata` | The dimension and metric names a property supports, and whether a set of fields can be combined | Free |
| `ga4_property_config` | Time zone, currency, data streams and enhanced measurement, key events, custom definitions, annotations (with their IDs), audiences, Ads/BigQuery/Firebase links, data retention and attribution settings | Free |
| `ga4_change_history` | Who changed which GA4 settings and when, with before and after values: key events, custom definitions, streams, retention, attribution, links. **Needs the `analytics.edit` scope** | 1 data call when there are changes |
| `ga4_manage` | Listed only with writes allowed. Create, update or delete annotations; create or delete key events; create or archive custom dimensions and metrics. **Needs the `analytics.edit` scope** and the Editor role | 1 per change |
| `clarity_insights` | Sessions, scroll depth, engagement time, dead clicks, rage clicks, quick backs and script errors for the last 1-3 days, by URL, device, country, source or channel, as lists or one row per page | 1 data call |
| `clarity_history` | Daily Clarity snapshots older than 3 days, from the archive described below | 1 data call |
| `page_report` | One page from Search Console, GA4 and Clarity: search queries and position, GA4 engagement and key events, Clarity rage and dead clicks | 1 per source with data |
| `pages_overview` | Your top pages joined across Search Console, GA4 and Clarity, flagged when they lose search clicks, convert poorly or frustrate users | 1 per source with data |
| `site_overview` | The whole site vs the previous period: search clicks, top pages and queries, GA4 sessions and channels, Clarity behaviour | 1 per source with data |
| `portfolio_overview` | Every site and GA4 property you can read (up to 25 each) vs the previous period, biggest drops first | 1 per property with data |
| `page_speed` | Lighthouse lab scores (performance, SEO, accessibility, best practices), LCP, CLS, TBT and the biggest savings, plus Core Web Vitals from real Chrome users (p75 LCP, INP, CLS) with weekly history, for up to 5 URLs on mobile and desktop. Needs your free Google API key | 1 per report |
| `bing_search_performance` | Bing clicks, impressions, CTR and average position per query or page, the pages for one query, the queries for one page, and daily traffic, from Bing Webmaster Tools. Needs your Bing API key | 1 data call |
| `bing_url_info` | Whether Bing has discovered up to 10 URLs, their discovery and last-crawl dates, HTTP status, Bing clicks and impressions, and optionally the pages linking to them | 1 per URL |
| `bing_crawl_health` | Pages crawled, crawl errors and crawl requests by HTTP status, pages in Bing's index and inbound links over time, and the URLs Bing reports with crawl issues | 1 data call |
| `bing_backlinks` | Your pages ranked by the inbound links Bing knows, or the linking URLs and anchor text for one page | 1 data call |
| `bing_keyword_research` | Bing search impressions (exact and broad match) for up to 5 keywords in a country and language, weekly history and related keywords. Works for any keyword | 1 per keyword with data |
| `bing_sitemaps` | Sitemaps submitted to Bing with status, URL count and last crawl; with writes allowed, submit or remove one | 1 data call |
| `bing_submit_urls` | Listed only with writes allowed. Submit up to 100 URLs to Bing for crawling, within the daily quota Bing reports, or check that quota | 1 per submission batch; quota checks free |
| `bing_manage_sites` | Listed only with writes allowed. Add a site to your Bing account (returns its verification meta tag), ask Bing to verify it, or remove it | 1 per change |

Example questions:

- "Which queries dropped the most in the last 28 days compared with the 28 days before?"
- "On which day did our search clicks fall, and was it a one-day dip or a trend?"
- "How much of our search traffic is branded? Our brand is MakerBuddy."
- "Which blog posts are decaying, and is it rankings, demand or CTR?"
- "Which new keywords did we start ranking for this month?"
- "Are our top 10 pages indexed, and does Google agree with our canonicals?"
- "Show sessions and key events by channel for last month vs the month before."
- "Where do users drop out between the pricing page, checkout and purchase, on mobile vs desktop?"
- "Which pages lose search clicks, convert poorly and get rage clicks?"
- "Which of my client sites lost the most clicks this month?"
- "Which URLs had the highest rage-click rate in the last 3 days?"
- "Why is our mobile LCP poor, and what would fix it fastest?"
- "Did anyone change our GA4 key events or retention settings last month?"
- "Which Bing queries bring us impressions, and has Bing crawled our new pages?"
- "How many Bing searches does 'arduino projects' get, and what related keywords are there?"
- With writes allowed: "Add a GA4 annotation for today's site migration and mark generate_lead as a key event." or "Submit our three new posts to Bing."

#### Choosing fewer tools

All 27 read tools are listed by default, and 31 with **Allow writes** on. To give your assistant a shorter list, add `?tools=` to the MCP URL with tool groups or tool names, for example `?tools=gsc,cross` or `?tools=ga4_insights,page_report`. The groups are:

- `gsc`: 6 Search Console tools, plus `gsc_manage_sites` with writes allowed;
- `ga4`: 7 GA4 tools, plus `ga4_manage` with writes allowed;
- `clarity`: 2 Clarity tools;
- `cross`: 4 tools that combine sources;
- `speed`: `page_speed`;
- `bing`: 6 Bing tools, plus `bing_submit_urls` and `bing_manage_sites` with writes allowed.

`list_properties` is always included. If the URL already ends in `?token=...`, append `&tools=gsc` instead. Clients that send headers can use `X-MCP-Tools`.

### How do I set it up?

Setup takes about 15 minutes, once. You need your own Google credentials for Search Console and GA4, a Clarity token for Clarity, and a Bing Webmaster API key for Bing. You can set up only the sources you use.

#### Step 1: Google credentials (Search Console and GA4)

Both options start in the [Google Cloud console](https://console.cloud.google.com/). Create or pick a project, then enable these three APIs in **APIs & Services > Library**: Google Search Console API, Google Analytics Data API, and Google Analytics Admin API.

**Option A: OAuth refresh token (recommended)**

1. In **APIs & Services > OAuth consent screen**, set up the app (External is fine for a personal Google account) and set its publishing status to **In production**. Google expires refresh tokens after 7 days while an app is in Testing. An unverified app shows a warning screen when you sign in; you can continue past it for your own account.
2. In **APIs & Services > Credentials**, create an **OAuth client ID** of type **Web application**, with `https://developers.google.com/oauthplayground` as an authorized redirect URI. Copy the client ID and client secret.
3. Open the [OAuth 2.0 Playground](https://developers.google.com/oauthplayground). In the settings (gear icon), tick **Use your own OAuth credentials** and paste the client ID and secret.
4. In the scope box, enter `https://www.googleapis.com/auth/webmasters.readonly https://www.googleapis.com/auth/analytics.readonly`, select **Authorize APIs**, and sign in with the Google account that can see your properties.
5. Select **Exchange authorization code for tokens** and copy the refresh token.
6. Your credentials JSON is:

```json
{ "client_id": "123-abc.apps.googleusercontent.com", "client_secret": "GOCSPX-...", "refresh_token": "1//0g..." }
```

The read-only scopes above cover every read tool. Change them in step 4 only for the optional features:

- Sitemap submit and remove, and adding or removing Search Console properties: use `https://www.googleapis.com/auth/webmasters` instead of `webmasters.readonly`. Search Console also needs you to be an Owner of the property (Full or Owner for sitemaps).
- GA4 change history and GA4 changes (`ga4_manage`): use `https://www.googleapis.com/auth/analytics.edit` instead of `analytics.readonly`, with the Editor or Administrator role on the property. Google requires this scope even to read change history.

If you already have separate refresh tokens for Search Console and GA4, paste both as a list, `[{...}, {...}]`. Each source uses the token Google granted its scope to, and `list_properties` shows which one.

**Option B: service account**

1. In **IAM & Admin > Service accounts**, create a service account, then create a **JSON key** for it under **Keys**.
2. Add the service account's email as a user in Search Console (**Settings > Users and permissions**) and with the **Viewer** role in GA4 (**Admin > Property access management**).
3. Your credentials JSON is the whole downloaded key file. For GA4 change history or GA4 changes, give it the Editor role instead of Viewer.

Some users report that since April 2026, Search Console and GA4 sometimes refuse to add a new service-account email with "email not found". If that happens, use Option A.

#### Step 2: Clarity token

A Clarity project admin opens the project, goes to **Settings > Data Export > Generate new API token**, and copies the token ([Microsoft's guide](https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-data-export-api)). For several projects, enter one `label=token` per line, for example `shop=eyJ...` and `blog=eyJ...`. The assistant then picks a project by its label.

#### Step 3: Google API key for page speed (optional)

`page_speed` uses Google's PageSpeed Insights API and Chrome UX Report API, which take an API key rather than the credentials above. Google does not charge for either.

1. In the [Google Cloud console](https://console.cloud.google.com/), enable the **PageSpeed Insights API** and the **Chrome UX Report API** in **APIs & Services > Library**.
2. In **APIs & Services > Credentials**, select **Create credentials > API key**.
3. Edit the key and, under **API restrictions**, allow only those two APIs. Leave **Application restrictions** at **None**, because the calls come from Apify's servers, not a browser.

Without a key, lab runs share Google's anonymous quota, which is often used up, and Core Web Vitals field data is unavailable.

#### Step 4: Bing Webmaster API key (optional)

The `bing_*` tools use the Bing Webmaster Tools API, which takes an API key. Microsoft does not charge for it.

1. Sign in to [Bing Webmaster Tools](https://www.bing.com/webmasters) and add your site. **Import from Google Search Console** brings in your verified sites and sitemaps without a separate verification.
2. Open **Settings > API Access**, accept the terms and select **Generate API Key** ([Microsoft's guide](https://learn.microsoft.com/en-us/bingwebmaster/getting-access)).

One key covers every site verified in that Bing account. Bing returns data only for verified sites, and a newly added site can take a few days to collect data.

#### Step 5: save your credentials in a task

1. Open this Actor in Apify Console and select **Save as a new task**.
2. On the task's **Input** tab, paste the Google credentials JSON, the Clarity token, the Google API key and the Bing API key. All four are secret fields: Apify stores them encrypted and passes them only to your own runs. Optionally set a default Search Console property (the Bing tools use the matching Bing site) and GA4 property ID, and turn on **Allow writes** if the assistant may change sitemaps, sites, GA4 settings or submit URLs to Bing.
3. Save, then select **Start** once. This free `checkAccess` run lists every property the credentials can read, or tells you exactly what is missing.

#### Step 6: connect your MCP client

The MCP URL is the task's server URL followed by `/mcp`. Copy it from the task's **Server** tab. Authenticate with your [Apify API token](https://console.apify.com/settings/integrations).

**Claude Code**

```bash
claude mcp add --transport http analytics https://YOUR-TASK-URL.apify.actor/mcp --header "Authorization: Bearer YOUR_APIFY_TOKEN"
```

**Cursor, VS Code and other clients with a JSON config**

```json
{
  "mcpServers": {
    "analytics": {
      "url": "https://YOUR-TASK-URL.apify.actor/mcp",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

**Clients that only take a URL** (for example claude.ai custom connectors): use `https://YOUR-TASK-URL.apify.actor/mcp?token=YOUR_APIFY_TOKEN`. Anyone with that URL can use the token, so create a [scoped token](https://docs.apify.com/platform/integrations/api#limited-permissions) that can only run this task.

**Without a task:** clients that can send headers can call the Actor's own URL (`/mcp` on the Actor's **Server** tab) and pass the credentials per request. Send `X-Google-Credentials` with the Google JSON (raw or base64) and `X-Clarity-Token` with the Clarity token. Optional headers are `X-Google-Api-Key`, `X-Bing-Api-Key`, `X-GSC-Site-URL`, `X-GA4-Property-ID` and `X-Allow-Writes: true`.

### How do I keep Clarity history longer than 3 days?

Clarity's API only returns the last 1-3 days, at most 10 calls per project per day. This Actor can archive one snapshot a day so `clarity_history` can read weeks or months back:

1. Duplicate your task, and in the copy set **Run mode** to **Archive Clarity snapshot**.
2. Schedule that task daily shortly after 00:00 UTC (**Schedules** in Apify Console).
3. Each run saves the last 24 hours for each breakdown in **Clarity archive breakdowns**. The default is whole-site, URL, device, country, channel and source plus medium: six Clarity calls a day, leaving four for live questions.

Snapshots are kept in a key-value store named `gsc-ga4-clarity-mcp-archive` in your account. Each saved snapshot is one data call. Days that were not archived cannot be recovered later, because Clarity's API does not serve them.

### How much does it cost?

You pay the events below and the platform usage of your own server runs, like any Actor that runs in your account.

| Event | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|
| Data call (primary) | USD 0.019 | USD 0.018525 | USD 0.01805 | USD 0.0152 |
| Server start (once per run) | USD 0.005 | USD 0.005 | USD 0.005 | USD 0.005 |

- A data call is one of these:
  - one tool call that returns data;
  - one URL inspected (`gsc_inspect_urls`) or checked (`bing_url_info`);
  - one keyword with data in `bing_keyword_research`;
  - one `ga4_insights` report with rows;
  - one source with data in `page_report`, `pages_overview` or `site_overview`;
  - one property with data in `portfolio_overview`;
  - one archived Clarity snapshot;
  - one `page_speed` report (one URL on one device: a lab run, field data or weekly history);
  - one `ga4_change_history` call that returns changes;
  - one change made with writes allowed: a sitemap submitted or removed, a Search Console property or Bing site added, verified or removed, one batch of URLs submitted to Bing, or a GA4 item created, updated, deleted or archived.
- `list_properties`, `ga4_metadata`, `ga4_property_config`, Bing quota checks, errors, empty results and changes that were not needed are not charged.
- Per 1,000 data calls that is USD 19 on the Free plan, USD 18.53 on Bronze, USD 18.05 on Silver and USD 15.20 on Gold and higher plans.
- Example: a session with 20 data calls costs USD 0.385 in events on the Free plan (20 x 0.019 + 0.005). A `portfolio_overview` of 10 sites and 10 GA4 properties with data is 20 data calls.
- A server run uses 256 MB and stops after 3 idle minutes (change both in the task settings). Its platform usage is billed to your account at your plan's rate. In our tests, a server run that answered a burst of calls and then stopped on idle used about USD 0.005 of platform usage.
- To cap spending, set **Max total charge** in the task's settings. When a run reaches it, tools return an error instead of data.

### What are the limits?

- **Search Console:**
  - About 16 months of history, with data about 2 days behind. The tools default to final data ending 3 days ago.
  - Hourly data covers the last 10 days.
  - Google returns at most 50,000 rows per day per search type and hides anonymised queries.
  - Discover, Google News and Lens results have no queries.
  - Google's branded classification exists only for properties with enough search volume; `gsc_insights` can split by your own brand terms instead.
  - URL Inspection allows 2,000 URLs per property per day.
  - The API cannot verify ownership, so a property added with `gsc_manage_sites` must be verified in Search Console before it shows data.
- **GA4:**
  - Each property has a daily and hourly token quota, and each report returns the remaining quota. Reports flag sampling and thresholding.
  - Funnel reports use Google's alpha funnel API, which Google may still change.
  - Path explorations and cohort reports are not available.
  - Change history and changes need the `analytics.edit` scope. Annotations use Google's alpha API.
- **Clarity:**
  - Last 1-3 days only, at most 3 breakdown dimensions, 1,000 rows and 10 calls per project per day.
  - Results are cached for an hour (three hours in the combined reports) to save calls, and the cache is used when Clarity refuses a call.
  - Session recordings and heatmaps have no public API.
- **Page speed:**
  - Each lab run takes 10-60 seconds on Google's servers, and scores vary between runs.
  - Field data needs enough Chrome traffic. Small pages fall back to origin-level data, or have none.
  - The Chrome UX Report API allows 150 queries per minute per Google Cloud project.
- **Bing Webmaster Tools:**
  - Bing reports query and page stats in weekly buckets, so those windows cover whole weeks. Daily traffic and crawl stats are per day.
  - Bing returns data only for sites verified in the account behind the key. A new site can take a few days to show data, and small sites have sparse data.
  - When weeks are combined, the average position is weighted by impressions.
  - URL submission is limited by the daily and monthly quota Bing reports for each site (100 a day on our test site). URLs over the quota are skipped, not charged.
  - Keyword data covers Bing searches only and lags a few days.
- **Write access:** off by default. With **Allow writes** on, `gsc_sitemaps`, `gsc_manage_sites`, `ga4_manage`, `bing_sitemaps`, `bing_submit_urls` and `bing_manage_sites` can change data. Removing, deleting and archiving also need `confirm: true` from the assistant, so it has to ask you first. Google refuses changes when the credentials lack the write scope.
- **Request time:** Apify allows up to 5 minutes per request. Several calls take longer than single reports:
  - comparisons on large sites, which read up to 25,000 rows per period;
  - content decay, which reads up to 12 blocks;
  - search appearance, where Google itself is slow;
  - portfolio overviews of many properties;
  - `page_speed` with several URLs on both devices.

### FAQ

**Is there a hosted Google Search Console MCP server?**
Yes, this one. Google publishes no official Search Console MCP server. This server runs on Apify, so you install nothing, and web-based assistants such as claude.ai can use it as well as desktop clients.

**Does it work with Google's own GA4 MCP server?**
It is separate. Google's GA4 server is free but you host it yourself. This Actor is hosted, adds Search Console and Clarity, and joins them per page.

**Can the assistant change or delete my data?**
Only if you turn on **Allow writes**. It can then submit or remove sitemaps in Search Console and Bing, add or remove Search Console properties and Bing sites, submit URLs to Bing, and create, change, delete or archive GA4 annotations, key events and custom definitions. Every removal needs an explicit `confirm: true`. Sitemap and property changes need the `webmasters` scope. GA4 changes, and reading GA4 change history, need the `analytics.edit` scope. With read-only Google credentials, Google itself refuses any change.

**Why does a tool say my property is not available?**
Run `list_properties`. It shows the identity Google sees (the service-account email or your Google account) and which property is missing. Add that identity to the property, or pass the property exactly as it is listed (for example `sc-domain:example.com`).

**Why do Search Console numbers differ from GA4?**
They measure different things: Search Console counts Google search clicks, GA4 counts sessions from all channels. `page_report` and `pages_overview` show both side by side for the same page.

**My assistant picks the wrong tool. Can I give it fewer?**
Yes. Add `?tools=gsc` (or `ga4`, `clarity`, `cross`, `speed`, `bing`, or tool names, comma-separated) to the MCP URL, as described in "Choosing fewer tools" above.

**Can I use it for several sites or clients?**
Yes. The Google credentials cover every property the account can read, and each tool takes a site or property. `portfolio_overview` compares up to 25 sites and 25 GA4 properties in one table. For Clarity, enter one `label=token` per project.

**Does it work with Bing Webmaster Tools?**
Yes. Add your Bing Webmaster API key (Step 4), and the `bing_*` tools read Bing search performance, URL index status, crawl health, inbound links, keyword impressions and sitemaps for the sites verified in your Bing account. With **Allow writes** on, they can also submit URLs and sitemaps to Bing.

**Do I need a Google API key?**
Only for `page_speed`. Every Search Console, GA4, Clarity and Bing tool works without one. Step 3 shows how to create a free key in a few minutes.

Last verified: 2026-11-18

# Actor input Schema

## `googleCredentialsJson` (type: `string`):

Credentials that can read your Search Console and GA4 properties: {"client_id","client_secret","refresh_token"} from your own OAuth client, or a whole service-account key file. If Search Console and GA4 use different refresh tokens, paste both as a list: \[{...},{...}]. Leave empty if you only use Clarity. NOT your Google password.

## `clarityApiToken` (type: `string`):

Data Export token from your Clarity project (Settings > Data Export > Generate new API token; project admins only). For several projects, enter one 'label=token' per line, for example 'shop=eyJ...'. Leave empty if you only use Google.

## `googleApiKey` (type: `string`):

Optional key for the page_speed tool. In the Google Cloud console enable the 'PageSpeed Insights API' and the 'Chrome UX Report API', create an API key (APIs & Services > Credentials) and restrict it to those two APIs. Without it, lab runs use Google's shared quota (often used up) and Core Web Vitals field data is unavailable. Google does not charge for these APIs.

## `bingApiKey` (type: `string`):

Optional key for the bing\_\* tools (Bing search performance, URL index status, crawl health, inbound links, keyword demand and sitemaps). In Bing Webmaster Tools open Settings > API Access, accept the terms and choose Generate API Key. One key covers every site verified in that Bing account; Bing can import verified sites from Google Search Console. Bing does not charge for the API.

## `defaultSiteUrl` (type: `string`):

Property the tools use when the assistant does not name one, for example 'sc-domain:example.com' or 'https://www.example.com/'. Optional: with a single property it is picked automatically.

## `defaultGa4PropertyId` (type: `string`):

Numeric GA4 property ID, for example '123456789' (Admin > Property details). NOT the G- measurement ID. Optional: with a single property it is picked automatically.

## `allowWrites` (type: `boolean`):

Lets the assistant change data: submit or remove sitemaps and add or remove Search Console properties (needs credentials with the full webmasters scope); create, update or delete GA4 annotations, key events and custom dimensions or metrics (needs the analytics.edit scope and the Editor role); and submit or remove Bing sitemaps, submit URLs to Bing and add, verify or remove Bing sites (needs the Bing API key). Off by default, so the server only reads data and the write tools are not listed. Deletes also need confirm: true from the assistant.

## `mode` (type: `string`):

What a normal (non-server) run does. 'checkAccess' tests the credentials and lists your properties, free. 'clarityArchive' saves the last 24 hours of Clarity data so clarity_history can read older days; schedule it daily just after 00:00 UTC.

## `clarityArchiveDimensionSets` (type: `array`):

Breakdowns saved by each clarityArchive run, one Clarity call each (Clarity allows 10 per project per day). '(none)' is the whole-site total; 'Source,Medium' combines up to three of Browser, Device, Country/Region, OS, Source, Medium, Campaign, Channel, URL.

## Actor input object example

```json
{
  "allowWrites": false,
  "mode": "checkAccess",
  "clarityArchiveDimensionSets": [
    "(none)",
    "URL",
    "Device",
    "Country/Region",
    "Channel",
    "Source,Medium"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

One record per Clarity breakdown saved by a clarityArchive run.

## `summary` (type: `string`):

Outcome, the properties and projects the credentials can read, problems with one fix each, and data calls charged.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "checkAccess"
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/gsc-ga4-clarity-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "mode": "checkAccess" }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/gsc-ga4-clarity-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "checkAccess"
}' |
apify call muhammadafzal/gsc-ga4-clarity-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/gsc-ga4-clarity-mcp-server"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0h4yGw2ZcyfjbFdnp/builds/jcOmMQOcesoczjCq6/openapi.json
