### Install mcp-server-gsc Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Install the mcp-server-gsc package using npm. Ensure Node.js 18 or later is installed. ```bash npm install mcp-server-gsc ``` -------------------------------- ### Instantiate MCP Server with Credentials Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Factory function to create an MCP Server instance. Accepts credentials as a file path or JSON string. This example shows setting up the server for stdio mode with local Claude Desktop. ```typescript import { createServer } from './server.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; // --- Stdio mode (local Claude Desktop) --- const credentials = process.env.GOOGLE_APPLICATION_CREDENTIALS!; const server = createServer(credentials); const transport = new StdioServerTransport(); await server.connect(transport); // Server is now running; Claude Desktop sends JSON-RPC over stdin/stdout ``` ```jsonc // Claude Desktop config (~/.config/claude/claude_desktop_config.json) { "mcpServers": { "gsc": { "command": "npx", "args": ["-y", "mcp-server-gsc"], "env": { "GOOGLE_APPLICATION_CREDENTIALS": "/home/user/.credentials/gsc-service-account.json" } } } } ``` -------------------------------- ### Search Analytics with Quick Wins Detection Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Enable automatic detection of optimization opportunities by setting `detectQuickWins` to true and configuring parameters like `positionRange`, `minImpressions`, and `minCtr`. This example focuses on queries and pages within a specific position range and impression/CTR thresholds. ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "detectQuickWins": true, "quickWinsConfig": { "positionRange": [4, 15], "minImpressions": 500, "minCtr": 2 } } ``` -------------------------------- ### Cloudflare Workers Deployment Commands Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Example commands for health checking and making authenticated MCP calls to a Cloudflare Workers deployment. Requires MCP_API_TOKEN to be set for authenticated calls. ```bash # Health check curl https://mcp-server-gsc..workers.dev/health # {"status":"ok"} # Authenticated MCP call (if MCP_API_TOKEN is set) curl -X POST https://mcp-server-gsc..workers.dev/mcp \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "list_sites", "arguments": {} } }' ``` -------------------------------- ### Advanced Search Analytics with Regex Filtering Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Perform advanced search analytics by filtering queries using regex patterns and specifying the device type. This example retrieves page and query data for mobile devices, including queries related to 'AI', 'machine learning', or 'ML'. ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "page,query", "queryFilter": "regex:(AI|machine learning|ML)", "filterOperator": "includingRegex", "deviceFilter": "MOBILE", "rowLimit": 10000 } ``` -------------------------------- ### createServer Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Instantiates the MCP server with all eight tools registered. It accepts credentials as either a file path or a raw JSON string. ```APIDOC ## `createServer(credentials)` — Instantiate the MCP server ### Description Factory function that creates a fully-configured MCP `Server` instance with all eight tools registered. Accepts either a file path string or a raw JSON credentials string. ### Parameters - **credentials** (string) - Required - Either a file path to the credentials or a raw JSON string of the credentials. ### Usage Example (TypeScript) ```typescript import { createServer } from './server.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; // --- Stdio mode (local Claude Desktop) --- const credentials = process.env.GOOGLE_APPLICATION_CREDENTIALS!; const server = createServer(credentials); const transport = new StdioServerTransport(); await server.connect(transport); // Server is now running; Claude Desktop sends JSON-RPC over stdin/stdout ``` ### Configuration Example (Claude Desktop) ```json // Claude Desktop config (~/.config/claude/claude_desktop_config.json) { "mcpServers": { "gsc": { "command": "npx", "args": ["-y", "mcp-server-gsc"], "env": { "GOOGLE_APPLICATION_CREDENTIALS": "/home/user/.credentials/gsc-service-account.json" } } } } ``` ``` -------------------------------- ### Configure Claude Desktop for mcp-server-gsc Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Configure Claude Desktop to use the mcp-server-gsc by specifying the command, arguments, and environment variables, including the path to your Google Cloud service account credentials. ```json { "mcpServers": { "gsc": { "command": "npx", "args": ["-y", "mcp-server-gsc"], "env": { "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json" } } } } ``` -------------------------------- ### Direct Programmatic Usage of SearchConsoleService Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Demonstrates direct programmatic usage of the SearchConsoleService class in Node.js. Requires GOOGLE_APPLICATION_CREDENTIALS environment variable to be set. ```typescript import { SearchConsoleService } from './search-console.js'; // Accepts a file path or raw JSON credentials string const svc = new SearchConsoleService(process.env.GOOGLE_APPLICATION_CREDENTIALS!); ``` ```typescript // --- List all properties --- const sites = await svc.listSites(); console.log(sites.data.siteEntry); ``` ```typescript // --- Standard analytics --- const analytics = await svc.searchAnalytics('sc-domain:example.com', { startDate: '2024-01-01', endDate: '2024-03-31', dimensions: ['query', 'page'], rowLimit: 5000, }); console.log(analytics.data.rows); ``` ```typescript // --- Enhanced analytics with regex + quick wins --- const enhanced = await svc.enhancedSearchAnalytics( 'sc-domain:example.com', { startDate: '2024-01-01', endDate: '2024-03-31', dimensions: ['query', 'page'], rowLimit: 25000, }, { regexFilter: '(typescript|javascript|node)', enableQuickWins: true, quickWinsThresholds: { minImpressions: 100, maxCtr: 2.0, positionRangeMin: 4, positionRangeMax: 20, }, } ); console.log(enhanced.data.quickWins); ``` ```typescript // --- URL index inspection --- const inspection = await svc.indexInspect({ siteUrl: 'sc-domain:example.com', inspectionUrl: 'https://example.com/blog/typescript-guide', languageCode: 'en-US', }); console.log(inspection.data.inspectionResult?.indexStatusResult?.verdict); // "PASS" ``` ```typescript // --- Sitemap management --- await svc.submitSitemap({ siteUrl: 'https://example.com/', feedpath: 'https://example.com/sitemap.xml' }); const sitemaps = await svc.listSitemaps({ siteUrl: 'https://example.com/' }); console.log(sitemaps.data.sitemap); ``` -------------------------------- ### List Google Search Console Sites Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Use the `list_sites` tool to retrieve all registered properties under the authenticated service account. This is useful for understanding the scope of data available. ```json { "tool": "list_sites", "arguments": {} } ``` ```json { "siteEntry": [ { "siteUrl": "sc-domain:example.com", "permissionLevel": "siteOwner" }, { "siteUrl": "https://blog.example.com/", "permissionLevel": "siteFullUser" } ] } ``` -------------------------------- ### detect_quick_wins Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Runs a full analytics pull to identify SEO quick wins. It returns a report of queries ranked in a configurable position band with enough impressions to be worth optimizing. ```APIDOC ## `detect_quick_wins` — Standalone SEO opportunity scanner ### Description Runs a full 25,000-row analytics pull and returns only the quick wins report: queries ranked in a configurable position band (default 4–10) with enough impressions to be worth optimising. ### Arguments - **siteUrl** (string) - Required - The site URL to scan. - **startDate** (string) - Required - The start date for the analysis (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the analysis (YYYY-MM-DD). - **minImpressions** (integer) - Optional - Minimum impressions to consider an opportunity. - **maxCtr** (float) - Optional - Maximum CTR to consider an opportunity. - **positionRangeMin** (integer) - Optional - Minimum position in search results. - **positionRangeMax** (integer) - Optional - Maximum position in search results. - **estimatedClickValue** (float) - Optional - Estimated value of a click. - **conversionRate** (float) - Optional - The conversion rate. ### Request Example ```json { "tool": "detect_quick_wins", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "minImpressions": 100, "maxCtr": 2.5, "positionRangeMin": 4, "positionRangeMax": 20, "estimatedClickValue": 1.50, "conversionRate": 0.02 } } ``` ### Response Example ```json { "quickWins": [ { "query": "open source llm tools", "page": "https://example.com/tools", "currentPosition": 9.1, "impressions": 5400, "currentClicks": 54, "currentCtr": 1.00, "potentialClicks": 270, "additionalClicks": 216, "opportunity": "High", "optimizationNote": "Move from position 9.1 to improve CTR" } ], "totalOpportunities": 37, "thresholds": { "minImpressions": 100, "maxCtr": 2.5, "positionRangeMin": 4, "positionRangeMax": 20 }, "analysis": "Quick wins detection completed" } ``` ``` -------------------------------- ### Detect Quick Wins SEO Opportunities Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Use this tool to identify SEO quick wins by analyzing search queries within a specified position and impression range. Configure parameters like date range, minimum impressions, max CTR, and position range. ```jsonc { "tool": "detect_quick_wins", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "minImpressions": 100, "maxCtr": 2.5, "positionRangeMin": 4, "positionRangeMax": 20, "estimatedClickValue": 1.50, "conversionRate": 0.02 } } ``` ```jsonc // Expected response { "quickWins": [ { "query": "open source llm tools", "page": "https://example.com/tools", "currentPosition": 9.1, "impressions": 5400, "currentClicks": 54, "currentCtr": 1.00, "potentialClicks": 270, "additionalClicks": 216, "opportunity": "High", "optimizationNote": "Move from position 9.1 to improve CTR" } ], "totalOpportunities": 37, "thresholds": { "minImpressions": 100, "maxCtr": 2.5, "positionRangeMin": 4, "positionRangeMax": 20 }, "analysis": "Quick wins detection completed" } ``` -------------------------------- ### Submit New Sitemap Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Register or resubmit a sitemap URL to Google Search Console. This action prompts Google to perform a fresh crawl of the provided sitemap. ```jsonc { "tool": "submit_sitemap", "arguments": { "siteUrl": "https://example.com/", "feedpath": "https://example.com/sitemap-new-section.xml" } } ``` ```jsonc // Success response: empty body (HTTP 204 equivalent) {} ``` -------------------------------- ### submit_sitemap Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Registers or resubmits a sitemap URL to Google Search Console, initiating a new crawl. ```APIDOC ## `submit_sitemap` — Submit a new sitemap ### Description Registers or resubmits a sitemap URL to Google Search Console, prompting a fresh crawl. ### Arguments - **siteUrl** (string) - Required - The site URL. - **feedpath** (string) - Required - The path to the sitemap to submit. ### Request Example ```json { "tool": "submit_sitemap", "arguments": { "siteUrl": "https://example.com/", "feedpath": "https://example.com/sitemap-new-section.xml" } } ``` ### Response Success response: empty body (HTTP 204 equivalent) ```json {} ``` ``` -------------------------------- ### list_sites Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Lists all sites registered under the authenticated service account in Google Search Console. ```APIDOC ## list_sites ### Description Returns all sites registered under the authenticated service account in Google Search Console. ### Method Not applicable (MCP tool call) ### Endpoint Not applicable (MCP tool call) ### Parameters #### Arguments - **None** ### Request Example ```json { "tool": "list_sites", "arguments": {} } ``` ### Response #### Success Response - **siteEntry** (array) - An array of site objects, each containing `siteUrl` and `permissionLevel`. #### Response Example ```json { "siteEntry": [ { "siteUrl": "sc-domain:example.com", "permissionLevel": "siteOwner" }, { "siteUrl": "https://blog.example.com/", "permissionLevel": "siteFullUser" } ] } ``` ``` -------------------------------- ### Enhanced Search Analytics with Regex and Quick Wins Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt The `enhanced_search_analytics` tool provides high-volume data (up to 25,000 rows) and supports regex filtering for queries and pages. It can also enable automatic detection of SEO 'quick wins'. ```json { "tool": "enhanced_search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page", "rowLimit": 25000, "queryFilter": "regex:(AI|machine learning|LLM|GPT)", "filterOperator": "includingRegex" } } ``` ```json { "tool": "enhanced_search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page", "rowLimit": 25000, "enableQuickWins": true, "quickWinsThresholds": { "minImpressions": 200, "maxCtr": 3.0, "positionRangeMin": 4, "positionRangeMax": 15 } } } ``` ```json { "rows": [ /* up to 25,000 rows */ ], "quickWins": [ { "query": "best ml framework 2024", "page": "https://example.com/blog/ml-frameworks", "currentPosition": 7.4, "impressions": 8200, "currentClicks": 98, "currentCtr": 1.20, "potentialClicks": 410, "additionalClicks": 312, "opportunity": "High", "optimizationNote": "Move from position 7.4 to improve CTR" } ], "enhancedFeatures": { "regexFilterApplied": false, "quickWinsEnabled": true, "rowLimit": 25000 } } ``` -------------------------------- ### SearchConsoleService - Direct Programmatic Usage Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt The `SearchConsoleService` class can be used independently within any Node.js application for direct access to Google Search Console data. ```APIDOC ## Initialize SearchConsoleService ### Description Creates an instance of the `SearchConsoleService`. ### Constructor `new SearchConsoleService(googleCredentials)` ### Parameters - **googleCredentials** (string) - Required - Path to the Google Cloud credentials file or a raw JSON credentials string. ``` ```APIDOC ## List All Properties ### Description Retrieves a list of all properties associated with the authenticated Google account. ### Method `listSites()` ### Returns - **Promise** - A promise that resolves to an object containing site entries. - **data.siteEntry** (array) - An array of site objects, each with `siteUrl` and `permissionLevel`. ``` ```APIDOC ## Standard Analytics ### Description Fetches standard Google Search Console analytics data for a given property. ### Method `searchAnalytics(property, options)` ### Parameters - **property** (string) - Required - The Search Console property identifier (e.g., 'sc-domain:example.com'). - **options** (object) - Optional - Configuration for the analytics query. - **startDate** (string) - Required - The start date for the query (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the query (YYYY-MM-DD). - **dimensions** (array of strings) - Optional - Dimensions to include in the results (e.g., ['query', 'page']). - **rowLimit** (number) - Optional - The maximum number of rows to return. ``` ```APIDOC ## Enhanced Analytics with Regex Filter and Quick Wins ### Description Fetches enhanced Search Console analytics data, including regex filtering and an option to identify 'quick wins'. ### Method `enhancedSearchAnalytics(property, options, enhancedOptions)` ### Parameters - **property** (string) - Required - The Search Console property identifier (e.g., 'sc-domain:example.com'). - **options** (object) - Optional - Configuration for the analytics query (same as `searchAnalytics`). - **startDate** (string) - Required - The start date for the query (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the query (YYYY-MM-DD). - **dimensions** (array of strings) - Optional - Dimensions to include in the results (e.g., ['query', 'page']). - **rowLimit** (number) - Optional - The maximum number of rows to return. - **enhancedOptions** (object) - Optional - Additional options for enhanced analytics. - **regexFilter** (string) - Optional - A regular expression to filter results. - **enableQuickWins** (boolean) - Optional - Enables the 'quick wins' analysis. - **quickWinsThresholds** (object) - Optional - Thresholds for identifying quick wins. - **minImpressions** (number) - Minimum impressions for a quick win. - **maxCtr** (number) - Maximum CTR for a quick win. - **positionRangeMin** (number) - Minimum position range for a quick win. - **positionRangeMax** (number) - Maximum position range for a quick win. ``` ```APIDOC ## URL Index Inspection ### Description Inspects the indexing status of a specific URL within a given Search Console property. ### Method `indexInspect(params)` ### Parameters - **params** (object) - Required - Parameters for the inspection. - **siteUrl** (string) - Required - The Search Console property identifier (e.g., 'sc-domain:example.com'). - **inspectionUrl** (string) - Required - The URL to inspect. - **languageCode** (string) - Optional - The language code for the inspection (e.g., 'en-US'). ### Returns - **Promise** - A promise that resolves to an object containing the inspection result. - **data.inspectionResult.indexStatusResult.verdict** (string) - The indexing verdict (e.g., "PASS"). ``` ```APIDOC ## Sitemap Management ### Description Manages sitemaps for a given Search Console property, including submission and listing. ### Methods #### Submit Sitemap `submitSitemap(params)` ### Parameters for `submitSitemap` - **params** (object) - Required - Parameters for submitting a sitemap. - **siteUrl** (string) - Required - The Search Console property identifier (e.g., 'https://example.com/'). - **feedpath** (string) - Required - The URL of the sitemap to submit (e.g., 'https://example.com/sitemap.xml'). #### List Sitemaps `listSitemaps(params)` ### Parameters for `listSitemaps` - **params** (object) - Required - Parameters for listing sitemaps. - **siteUrl** (string) - Required - The Search Console property identifier (e.g., 'https://example.com/'). ### Returns for `listSitemaps` - **Promise** - A promise that resolves to an object containing sitemap information. - **data.sitemap** (array) - An array of sitemap objects. ``` -------------------------------- ### get_sitemap Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Fetches metadata and content statistics for a single sitemap URL registered on a Search Console property. ```APIDOC ## `get_sitemap` — Retrieve a specific sitemap ### Description Fetches metadata and content statistics for a single sitemap URL registered on a Search Console property. ### Arguments - **siteUrl** (string) - Required - The site URL. - **feedpath** (string) - Required - The path to the sitemap. ### Request Example ```json { "tool": "get_sitemap", "arguments": { "siteUrl": "https://example.com/", "feedpath": "https://example.com/sitemap.xml" } } ``` ### Response Example ```json { "path": "https://example.com/sitemap.xml", "lastSubmitted": "2024-03-01T00:00:00Z", "isPending": false, "isSitemapsIndex": false, "type": "sitemap", "lastDownloaded": "2024-03-15T04:10:00Z", "warnings": "0", "errors": "0", "contents": [{ "type": "web", "submitted": "320", "indexed": "318" }] } ``` ``` -------------------------------- ### Cloudflare Workers Deployment Configuration Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Configuration excerpt for deploying mcp-server-gsc to Cloudflare Workers using wrangler.toml. Secrets are managed via Cloudflare's secrets store. ```toml // wrangler.toml (excerpt) // name = "mcp-server-gsc" // main = "src/remote.ts" // compatibility_date = "2025-06-18" // // [vars] // CORS_ORIGIN = "https://my-ai-app.example.com" // // # Set secrets via: // # wrangler secret put GOOGLE_CREDENTIALS // # wrangler secret put MCP_API_TOKEN (optional bearer-auth) ``` -------------------------------- ### Retrieve Specific Sitemap Details Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Fetch metadata and content statistics for a single sitemap URL registered with a Search Console property. Requires the site URL and the sitemap's feed path. ```jsonc { "tool": "get_sitemap", "arguments": { "siteUrl": "https://example.com/", "feedpath": "https://example.com/sitemap.xml" } } ``` ```jsonc // Expected response { "path": "https://example.com/sitemap.xml", "lastSubmitted": "2024-03-01T00:00:00Z", "isPending": false, "isSitemapsIndex": false, "type": "sitemap", "lastDownloaded": "2024-03-15T04:10:00Z", "warnings": "0", "errors": "0", "contents": [{ "type": "web", "submitted": "320", "indexed": "318" }] } ``` -------------------------------- ### Inspect URL Indexability with index_inspect Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Check if a URL is indexed by Google and retrieve details about its crawl, indexing, and rich-result status. Specify the site URL, the inspection URL, and optionally a language code. ```jsonc { "tool": "index_inspect", "arguments": { "siteUrl": "sc-domain:example.com", "inspectionUrl": "https://example.com/blog/ml-guide", "languageCode": "en-US" } } ``` ```jsonc // Expected response { "inspectionResult": { "inspectionUrl": "https://example.com/blog/ml-guide", "indexStatusResult": { "verdict": "PASS", "coverageState": "Submitted and indexed", "robotsTxtState": "ALLOWED", "indexingState": "INDEXING_ALLOWED", "lastCrawlTime": "2024-03-15T08:22:00Z", "pageFetchState": "SUCCESSFUL", "googleCanonical": "https://example.com/blog/ml-guide", "userCanonical": "https://example.com/blog/ml-guide" } } } ``` -------------------------------- ### Standard Search Analytics Query Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt The `search_analytics` tool fetches performance data like clicks, impressions, CTR, and position. It supports basic date ranges and dimensions, with options for filtering by page, country, and device. ```json { "tool": "search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "rowLimit": 5000 } } ``` ```json { "tool": "search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page,date", "type": "web", "aggregationType": "byPage", "rowLimit": 10000, "pageFilter": "https://example.com/blog/", "filterOperator": "contains", "countryFilter": "USA", "deviceFilter": "MOBILE" } } ``` ```json { "rows": [ { "keys": ["machine learning tutorial", "https://example.com/blog/ml-guide"], "clicks": 1240, "impressions": 34500, "ctr": 0.0359, "position": 6.2 } ], "responseAggregationType": "byPage" } ``` -------------------------------- ### search_analytics Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Fetches clicks, impressions, CTR, and average position from Search Console for a given date range, with optional dimension breakdown and dimension filters. ```APIDOC ## search_analytics ### Description Fetches clicks, impressions, CTR, and average position from Search Console for a given date range, with optional dimension breakdown and dimension filters. ### Method Not applicable (MCP tool call) ### Endpoint Not applicable (MCP tool call) ### Parameters #### Arguments - **siteUrl** (string) - Required - The URL of the site to query. - **startDate** (string) - Required - The start date for the query (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the query (YYYY-MM-DD). - **dimensions** (string) - Optional - Comma-separated list of dimensions to break down results by (e.g., "query,page"). - **rowLimit** (integer) - Optional - The maximum number of rows to return. - **type** (string) - Optional - The type of data to query (e.g., "web"). - **aggregationType** (string) - Optional - The aggregation type for the results (e.g., "byPage"). - **pageFilter** (string) - Optional - Filters results by a specific page URL. - **filterOperator** (string) - Optional - The operator for filtering (e.g., "contains"). - **countryFilter** (string) - Optional - Filters results by country. - **deviceFilter** (string) - Optional - Filters results by device type (e.g., "MOBILE"). ### Request Example ```json // Basic query: top queries + pages for January 2024 { "tool": "search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "rowLimit": 5000 } } // Advanced: mobile traffic in the US filtered by URL prefix { "tool": "search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page,date", "type": "web", "aggregationType": "byPage", "rowLimit": 10000, "pageFilter": "https://example.com/blog/", "filterOperator": "contains", "countryFilter": "USA", "deviceFilter": "MOBILE" } } ``` ### Response #### Success Response - **rows** (array) - An array of row objects, each containing keys, clicks, impressions, CTR, and position. - **responseAggregationType** (string) - The aggregation type used for the response. #### Response Example ```json { "rows": [ { "keys": ["machine learning tutorial", "https://example.com/blog/ml-guide"], "clicks": 1240, "impressions": 34500, "ctr": 0.0359, "position": 6.2 } ], "responseAggregationType": "byPage" } ``` ``` -------------------------------- ### list_sitemaps Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Retrieves a list of all sitemaps submitted to Google Search Console for a property, including their submission status and discovery statistics. ```APIDOC ## `list_sitemaps` — List registered sitemaps ### Description Returns all sitemaps submitted to Google Search Console for a property, with submission status and discovery stats. ### Arguments - **siteUrl** (string) - Required - The site URL. - **sitemapIndex** (string) - Optional - The URL of the sitemap index file. ### Request Example ```json { "tool": "list_sitemaps", "arguments": { "siteUrl": "https://example.com/", "sitemapIndex": "https://example.com/sitemap_index.xml" } } ``` ### Response Example ```json { "sitemap": [ { "path": "https://example.com/sitemap.xml", "lastSubmitted": "2024-03-01T00:00:00Z", "isPending": false, "isSitemapsIndex": false, "type": "sitemap", "lastDownloaded": "2024-03-15T04:10:00Z", "warnings": "0", "errors": "0", "contents": [{ "type": "web", "submitted": "320", "indexed": "318" }] } ] } ``` ``` -------------------------------- ### List Registered Sitemaps Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Retrieve a list of all sitemaps submitted to Google Search Console for a given property. The response includes submission status and discovery statistics for each sitemap. ```jsonc { "tool": "list_sitemaps", "arguments": { "siteUrl": "https://example.com/", "sitemapIndex": "https://example.com/sitemap_index.xml" } } ``` ```jsonc // Expected response { "sitemap": [ { "path": "https://example.com/sitemap.xml", "lastSubmitted": "2024-03-01T00:00:00Z", "isPending": false, "isSitemapsIndex": false, "type": "sitemap", "lastDownloaded": "2024-03-15T04:10:00Z", "warnings": "0", "errors": "0", "contents": [{ "type": "web", "submitted": "320", "indexed": "318" }] } ] } ``` -------------------------------- ### Basic Search Analytics Query Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Retrieve basic search performance data including queries and pages for a specified site and date range. Supports a row limit for the number of results. ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "rowLimit": 5000 } ``` -------------------------------- ### index_inspect Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt Checks if a URL is indexed by Google and provides details on crawl, indexing, and rich-result status. ```APIDOC ## `index_inspect` — URL indexability inspection ### Description Checks whether a specific URL is indexed by Google and surfaces crawl, indexing, and rich-result status details. ### Arguments - **siteUrl** (string) - Required - The site URL. - **inspectionUrl** (string) - Required - The URL to inspect. - **languageCode** (string) - Optional - The language code for the inspection (e.g., "en-US"). ### Request Example ```json { "tool": "index_inspect", "arguments": { "siteUrl": "sc-domain:example.com", "inspectionUrl": "https://example.com/blog/ml-guide", "languageCode": "en-US" } } ``` ### Response Example ```json { "inspectionResult": { "inspectionUrl": "https://example.com/blog/ml-guide", "indexStatusResult": { "verdict": "PASS", "coverageState": "Submitted and indexed", "robotsTxtState": "ALLOWED", "indexingState": "INDEXING_ALLOWED", "lastCrawlTime": "2024-03-15T08:22:00Z", "pageFetchState": "SUCCESSFUL", "googleCanonical": "https://example.com/blog/ml-guide", "userCanonical": "https://example.com/blog/ml-guide" } } } ``` ``` -------------------------------- ### enhanced_search_analytics Source: https://context7.com/ahonn/mcp-server-gsc/llms.txt An extended version of `search_analytics` supporting up to 25,000 rows, regex-based query/page filtering, and optional automatic quick wins detection. ```APIDOC ## enhanced_search_analytics ### Description An extended version of `search_analytics` supporting up to 25,000 rows, regex-based query/page filtering, and optional automatic quick wins detection embedded in the response. ### Method Not applicable (MCP tool call) ### Endpoint Not applicable (MCP tool call) ### Parameters #### Arguments - **siteUrl** (string) - Required - The URL of the site to query. - **startDate** (string) - Required - The start date for the query (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the query (YYYY-MM-DD). - **dimensions** (string) - Optional - Comma-separated list of dimensions to break down results by (e.g., "query,page"). - **rowLimit** (integer) - Optional - The maximum number of rows to return (up to 25,000). - **queryFilter** (string) - Optional - A regex pattern to filter queries. - **pageFilter** (string) - Optional - A regex pattern to filter pages. - **filterOperator** (string) - Optional - The operator for filtering (e.g., "includingRegex"). - **enableQuickWins** (boolean) - Optional - Enables automatic quick wins detection. - **quickWinsThresholds** (object) - Optional - Thresholds for quick wins detection. - **minImpressions** (integer) - Minimum impressions for a quick win. - **maxCtr** (float) - Maximum CTR for a quick win. - **positionRangeMin** (integer) - Minimum position range for a quick win. - **positionRangeMax** (integer) - Maximum position range for a quick win. ### Request Example ```json // Regex filter: only queries that mention AI, ML, or LLM { "tool": "enhanced_search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page", "rowLimit": 25000, "queryFilter": "regex:(AI|machine learning|LLM|GPT)", "filterOperator": "includingRegex" } } // With quick wins detection enabled { "tool": "enhanced_search_analytics", "arguments": { "siteUrl": "sc-domain:example.com", "startDate": "2024-01-01", "endDate": "2024-03-31", "dimensions": "query,page", "rowLimit": 25000, "enableQuickWins": true, "quickWinsThresholds": { "minImpressions": 200, "maxCtr": 3.0, "positionRangeMin": 4, "positionRangeMax": 15 } } } ``` ### Response #### Success Response - **rows** (array) - An array of row objects, similar to `search_analytics`. - **quickWins** (array) - An array of quick win objects, detailing optimization opportunities. - **enhancedFeatures** (object) - Information about the enhanced features applied. - **regexFilterApplied** (boolean) - **quickWinsEnabled** (boolean) - **rowLimit** (integer) #### Response Example ```json { "rows": [ /* up to 25,000 rows */ ], "quickWins": [ { "query": "best ml framework 2024", "page": "https://example.com/blog/ml-frameworks", "currentPosition": 7.4, "impressions": 8200, "currentClicks": 98, "currentCtr": 1.20, "potentialClicks": 410, "additionalClicks": 312, "opportunity": "High", "optimizationNote": "Move from position 7.4 to improve CTR" } ], "enhancedFeatures": { "regexFilterApplied": false, "quickWinsEnabled": true, "rowLimit": 25000 } } ``` ``` -------------------------------- ### search_analytics Source: https://github.com/ahonn/mcp-server-gsc/blob/master/README.md Retrieves comprehensive search performance data from Google Search Console. Supports various dimensions, filters, and advanced options for detailed analysis. ```APIDOC ## search_analytics ### Description Get comprehensive search performance data from Google Search Console with enhanced analytics capabilities. ### Method POST (Assumed, as it's a tool invocation) ### Endpoint /search_analytics ### Parameters #### Required Parameters - **siteUrl** (string) - Site URL (format: `http://www.example.com/` or `sc-domain:example.com`) - **startDate** (string) - Start date (YYYY-MM-DD) - **endDate** (string) - End date (YYYY-MM-DD) #### Optional Parameters - **dimensions** (string) - Comma-separated list (`query`, `page`, `country`, `device`, `searchAppearance`, `date`) - **type** (string) - Search type (`web`, `image`, `video`, `news`, `discover`, `googleNews`) - **aggregationType** (string) - Aggregation method (`auto`, `byNewsShowcasePanel`, `byProperty`, `byPage`) - **rowLimit** (integer) - Maximum rows to return (default: 1000, max: 25000) - **dataState** (string) - Data freshness (`all` or `final`, default: `final`) #### Filter Parameters - **pageFilter** (string) - Filter by page URL (supports regex with `regex:` prefix) - **queryFilter** (string) - Filter by search query (supports regex with `regex:` prefix) - **countryFilter** (string) - Filter by country ISO 3166-1 alpha-3 code (e.g., `USA`, `CHN`) - **deviceFilter** (string) - Filter by device type (`DESKTOP`, `MOBILE`, `TABLET`) - **searchAppearanceFilter** (string) - Filter by search feature (e.g., `AMP_BLUE_LINK`, `AMP_TOP_STORIES`) - **filterOperator** (string) - Operator for filters (`equals`, `contains`, `notEquals`, `notContains`, `includingRegex`, `excludingRegex`) #### Quick Wins Detection - **detectQuickWins** (boolean) - Enable automatic detection of optimization opportunities (default: `false`) - **quickWinsConfig** (object) - Configuration for quick wins detection: - **positionRange** (array) - Position range to consider (default: `[4, 20]`) - **minImpressions** (integer) - Minimum impressions threshold (default: `100`) - **minCtr** (number) - Minimum CTR percentage (default: `1`) ### Request Example - Basic Query ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "rowLimit": 5000 } ``` ### Request Example - Advanced Filtering with Regex ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "page,query", "queryFilter": "regex:(AI|machine learning|ML)", "filterOperator": "includingRegex", "deviceFilter": "MOBILE", "rowLimit": 10000 } ``` ### Request Example - Quick Wins Detection ```json { "siteUrl": "https://example.com", "startDate": "2024-01-01", "endDate": "2024-01-31", "dimensions": "query,page", "detectQuickWins": true, "quickWinsConfig": { "positionRange": [4, 15], "minImpressions": 500, "minCtr": 2 } } ``` ### Response (Response schema not provided in source) ```