UNPKG

@weppa-cloud/mcp-search-console

Version:

MCP server for Google Search Console with growth-focused metrics

20 lines (19 loc) 644 B
import { google } from 'googleapis'; export async function createSearchConsoleClient(config) { try { const credentialsPath = config.credentialsPath || process.env.GOOGLE_APPLICATION_CREDENTIALS; // Try using googleapis built-in auth const authClient = await google.auth.getClient({ keyFile: credentialsPath, scopes: ['https://www.googleapis.com/auth/webmasters.readonly'], }); const searchconsole = google.searchconsole({ version: 'v1', auth: authClient, }); return searchconsole; } catch (error) { throw error; } }