mcp-google-gsc 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"sha":"65b772d","builtAt":"2026-04-03T23:26:46.310Z"}
1
+ {"sha":"46a0362","builtAt":"2026-04-09T18:50:54.060Z"}
package/dist/index.js CHANGED
@@ -18,15 +18,26 @@ catch {
18
18
  // build-info.json not present (dev mode)
19
19
  }
20
20
  function loadConfig() {
21
+ // Try config.json (for multi-client setups)
21
22
  const configPath = join(dirname(new URL(import.meta.url).pathname), "..", "config.json");
22
- if (!existsSync(configPath)) {
23
- throw new Error(`Config file not found at ${configPath}. Copy config.example.json to config.json and fill in your credentials.`);
23
+ if (existsSync(configPath)) {
24
+ const raw = JSON.parse(readFileSync(configPath, "utf-8"));
25
+ return {
26
+ credentials_file: raw.credentials_file || process.env.GOOGLE_APPLICATION_CREDENTIALS || "",
27
+ clients: raw.clients || {},
28
+ };
29
+ }
30
+ // Fall back to env vars (single-property mode)
31
+ const credsFile = process.env.GOOGLE_APPLICATION_CREDENTIALS || "";
32
+ if (credsFile) {
33
+ return {
34
+ credentials_file: credsFile,
35
+ clients: {},
36
+ };
24
37
  }
25
- const raw = JSON.parse(readFileSync(configPath, "utf-8"));
26
- return {
27
- credentials_file: raw.credentials_file || process.env.GOOGLE_APPLICATION_CREDENTIALS || "",
28
- clients: raw.clients || {},
29
- };
38
+ throw new Error("No configuration found. Either:\n" +
39
+ " 1. Set GOOGLE_APPLICATION_CREDENTIALS env var to a service account JSON file, or\n" +
40
+ " 2. Create a config.json next to the dist/ folder (see config.example.json)");
30
41
  }
31
42
  function getClientFromWorkingDir(config, cwd) {
32
43
  for (const [key, client] of Object.entries(config.clients)) {
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "mcp-google-gsc",
3
- "version": "1.0.0",
3
+ "mcpName": "io.github.mharnett/google-gsc",
4
+ "version": "1.0.2",
4
5
  "description": "MCP server for Google Search Console API with multi-client support, search analytics, and URL inspection.",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",