@xevrion/gsc-mcp 0.1.0 → 0.1.1

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.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Ask your AI "why did my traffic drop?" and get an actual answer: the day it brok
12
12
  npx -y @xevrion/gsc-mcp setup
13
13
  ```
14
14
 
15
- That's the whole install. It signs you in with Google, finds the AI apps on your computer (Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Gemini CLI, Codex) and adds itself to each one.
15
+ That's the whole install: sign in with Google, click Allow. It then finds the AI apps on your computer (Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Gemini CLI, Codex) and adds itself to each one.
16
16
 
17
17
  **Just want to look first?** `npx -y @xevrion/gsc-mcp demo` adds it with a realistic made-up site, no Google account needed. Every tool works on it.
18
18
 
@@ -58,7 +58,7 @@ A drop in CTR at the same ranking usually means a new AI Overview or a weaker ti
58
58
 
59
59
  Lots of Search Console MCP servers exist. Most of them pass Google's raw JSON to the model and stop there. This one does the analysis too, and it was built after going through the issue trackers of the popular ones to see what people kept running into.
60
60
 
61
- - **Setup a non-developer can finish.** One command does everything, including adding itself to your apps. It opens each Google page for you and picks up the downloaded key on its own. If something isn't connected, your AI can start the sign-in from the chat.
61
+ - **No Google Cloud console.** Other servers make you create a Google Cloud project, an OAuth client and a JSON key first. Here you sign in with Google and click Allow. One command also adds it to your apps, and if something isn't connected, your AI can start the sign-in from the chat.
62
62
  - **Answers, not data dumps.** 21 tools, and most of them answer a question directly: drop diagnosis, quick wins, weak titles, cannibalization, content decay, indexing audits, update impact.
63
63
  - **Benchmarks from your own site.** "Expected CTR" comes from your own data, not an industry table. A site that normally gets 0.6× typical CTR won't have every page flagged, and a strong brand won't hide its weak pages.
64
64
  - **Cheap on tokens.** Output is compact tables with shared URL prefixes folded into the header, about 2.6× smaller than the raw JSON most servers return (8.6k vs 22k characters for the same 100 rows). All 21 tools together cost about 5k tokens of context, and `GSC_TOOLS` trims them further. Results always say when they were cut off.
@@ -105,7 +105,15 @@ It also ships five prompts your app can show as shortcuts: **SEO report**, **Why
105
105
  npx -y @xevrion/gsc-mcp setup
106
106
  ```
107
107
 
108
- Google requires each person to have a free "OAuth client", which is a key that lets an app ask for your permission. It lives in a Google Cloud project. That sounds heavy, but it's free and needs no billing or card, and your data still goes straight from Google to your computer. Setup opens each page for you:
108
+ Your browser opens Google sign-in. Pick your account, click **Allow**, done. gsc-mcp only asks to *read* Search Console, and the data goes straight from Google to your computer. There's no gsc-mcp server in between.
109
+
110
+ While Google is still verifying the gsc-mcp app, it shows a "Google hasn't verified this app" screen. Click **Advanced**, then **Go to gsc-mcp**. Until verification is done, the shared app is limited to 100 users in total. If you hit that limit, or would rather not use a shared app at all, use your own client (below).
111
+
112
+ You can also skip the terminal entirely: install gsc-mcp in your AI app and ask it to connect your Search Console. It opens the same sign-in page.
113
+
114
+ ### Your own Google Cloud client (optional)
115
+
116
+ For companies, heavy use, or people who'd rather not rely on a shared app: `npx -y @xevrion/gsc-mcp auth --own-client` walks you through creating your own free OAuth client. It takes about 5 minutes, needs no billing, and setup opens each page for you:
109
117
 
110
118
  1. [Create a project](https://console.cloud.google.com/projectcreate) (any name)
111
119
  2. [Turn on the Search Console API](https://console.cloud.google.com/apis/library/searchconsole.googleapis.com)
@@ -114,9 +122,7 @@ Google requires each person to have a free "OAuth client", which is a key that l
114
122
  5. [Audience](https://console.cloud.google.com/auth/audience): click **Publish app**. If you skip this, Google signs you out every 7 days.
115
123
  6. [Create a client](https://console.cloud.google.com/auth/clients/create): type **Desktop app**, then **Download JSON**
116
124
 
117
- Setup notices the file in your Downloads folder and opens Google sign-in. (On macOS your terminal may ask for permission to read Downloads. If you say no, setup lets you paste the file path instead.) Google may warn that the app is unverified. That's expected, because it's your own app: click **Advanced**, then **Go to ... (unsafe)**.
118
-
119
- A one-click "Sign in with Google" that skips all of this is on the roadmap. It needs a shared app verified by Google, which is in progress.
125
+ Setup notices the file in your Downloads folder (or paste its path) and opens Google sign-in. Set `GSC_NO_SHARED_CLIENT=1` to make sure the shared app is never used.
120
126
 
121
127
  ### Several Google accounts
122
128
 
package/dist/auth.js CHANGED
@@ -135,11 +135,24 @@ export class LazyAuth {
135
135
  this.multi = undefined;
136
136
  }
137
137
  }
138
- // Optional shared OAuth client baked in at build time, so users can skip
139
- // creating their own Google Cloud project. Empty means "bring your own".
140
- export const BUNDLED_CLIENT = process.env.GSC_BUNDLED_CLIENT_ID && process.env.GSC_BUNDLED_CLIENT_SECRET
141
- ? { client_id: process.env.GSC_BUNDLED_CLIENT_ID, client_secret: process.env.GSC_BUNDLED_CLIENT_SECRET, source: "bundled" }
142
- : null;
138
+ // The project's own Google OAuth app, so people can just sign in instead of
139
+ // creating a Google Cloud project. The values are injected into the published
140
+ // build by the release workflow (scripts/inject-client.mjs) and are not kept in
141
+ // git. Google documents that installed-app client secrets cannot be kept
142
+ // confidential; what protects users is that only they can approve access on
143
+ // Google's consent screen, and data flows straight from Google to their machine.
144
+ // Builds without them, and GSC_NO_SHARED_CLIENT=1, fall back to your own client.
145
+ const SHARED_CLIENT_ID = "159297266102-lrluoiubp6mmrfsflvreg8bve7ch51id.apps.googleusercontent.com";
146
+ const SHARED_CLIENT_SECRET = "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";
147
+ export function bundledClient() {
148
+ if (/^(1|true|yes)$/i.test(process.env.GSC_NO_SHARED_CLIENT ?? ""))
149
+ return null;
150
+ const client_id = process.env.GSC_BUNDLED_CLIENT_ID || SHARED_CLIENT_ID;
151
+ const client_secret = process.env.GSC_BUNDLED_CLIENT_SECRET || SHARED_CLIENT_SECRET;
152
+ if (client_id.startsWith("__") || client_secret.startsWith("__"))
153
+ return null;
154
+ return { client_id, client_secret, source: "gsc-mcp app" };
155
+ }
143
156
  export function readClientFile(path) {
144
157
  const data = JSON.parse(readFileSync(path, "utf8"));
145
158
  const c = data.installed ?? data.web ?? data;
@@ -188,7 +201,7 @@ export function findClient(opts = {}) {
188
201
  }
189
202
  catch { }
190
203
  }
191
- return findDownloadedClient() ?? BUNDLED_CLIENT;
204
+ return findDownloadedClient() ?? (opts.ownClient ? null : bundledClient());
192
205
  }
193
206
  export function saveClient(c) {
194
207
  mkdirSync(configDir(), { recursive: true, mode: 0o700 });
@@ -372,7 +385,9 @@ export async function login(opts) {
372
385
  const client = findClient(opts) ?? (await guidedClientSetup());
373
386
  const { authUrl, done } = await startLogin({ client, write: opts.write, profile: opts.profile, openBrowser: !opts.noBrowser });
374
387
  log(opts.noBrowser ? `\nOpen this link to sign in with Google:\n\n${authUrl}\n` : `\nSign in with Google in the browser window that just opened. If nothing opened, visit:\n\n${authUrl}\n`);
375
- log('If Google says "Google hasn\'t verified this app", click Advanced, then "Go to ... (unsafe)". It is your own app.\n');
388
+ log(client.source === "gsc-mcp app"
389
+ ? 'If Google says "Google hasn\'t verified this app", click Advanced, then "Go to gsc-mcp (unsafe)". Verification is in progress; gsc-mcp only asks to read Search Console and your data goes straight to this computer.\n'
390
+ : 'If Google says "Google hasn\'t verified this app", click Advanced, then "Go to ... (unsafe)". It is your own app.\n');
376
391
  return done;
377
392
  }
378
393
  export function logout(name = profileName()) {
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ Usage:
16
16
  gsc-mcp tools List every tool
17
17
  gsc-mcp run <tool> ... Run a tool from the terminal: gsc-mcp run find_opportunities --site example.com --limit 10
18
18
  gsc-mcp auth Sign in with Google in your browser (one time)
19
+ --own-client Use your own Google Cloud OAuth client (guided) instead of gsc-mcp's
19
20
  --client <file> OAuth client JSON downloaded from Google Cloud
20
21
  --write Also request permission to submit/remove sitemaps
21
22
  --profile <name> Save under a named profile (for several Google accounts)
@@ -44,7 +45,7 @@ async function main() {
44
45
  if (cmd === "--version" || cmd === "-v")
45
46
  return console.log(VERSION);
46
47
  if (cmd === "auth" || cmd === "login") {
47
- const res = await login({ clientFile: flag(args, "--client"), write: args.includes("--write"), profile: flag(args, "--profile"), noBrowser: args.includes("--no-browser") });
48
+ const res = await login({ clientFile: flag(args, "--client"), write: args.includes("--write"), profile: flag(args, "--profile"), noBrowser: args.includes("--no-browser"), ownClient: args.includes("--own-client") });
48
49
  console.log(`\nSigned in${res.email ? ` as ${res.email}` : ""}. Saved to ${res.path} (profile "${res.profile}").`);
49
50
  if (res.profile !== "default")
50
51
  process.env.GSC_PROFILE = res.profile;
@@ -53,7 +54,7 @@ async function main() {
53
54
  return;
54
55
  }
55
56
  if (cmd === "setup") {
56
- console.log(`\n gsc-mcp ${VERSION} setup\n Connects Google Search Console to your AI apps. Takes about 3 minutes.\n`);
57
+ console.log(`\n gsc-mcp ${VERSION} setup\n Connects Google Search Console to your AI apps. Takes about a minute.\n`);
57
58
  const hasLogin = await resolveAuth().then(() => true, () => false);
58
59
  if (hasLogin) {
59
60
  console.log("Step 1/2 Google: already connected.");
@@ -61,7 +62,7 @@ async function main() {
61
62
  }
62
63
  else {
63
64
  console.log("Step 1/2 Connect your Google account");
64
- const res = await login({ clientFile: flag(args, "--client"), write: args.includes("--write"), profile: flag(args, "--profile") });
65
+ const res = await login({ clientFile: flag(args, "--client"), write: args.includes("--write"), profile: flag(args, "--profile"), ownClient: args.includes("--own-client") });
65
66
  console.log(`\nConnected${res.email ? ` as ${res.email}` : ""}.`);
66
67
  await printSites();
67
68
  }
package/dist/tools.js CHANGED
@@ -173,7 +173,7 @@ export function registerTools(server, gsc, opts) {
173
173
  authUrl,
174
174
  "",
175
175
  `After they approve, Search Console is connected (profile "${wanted}"). Wait for the user to confirm, then retry the original request.`,
176
- `If Google warns the app is unverified, click Advanced, then "Go to ... (unsafe)". It is their own OAuth app.`,
176
+ `If Google warns the app is unverified, click Advanced, then "Go to gsc-mcp (unsafe)". gsc-mcp only asks to read Search Console, and the data goes straight to this computer.`,
177
177
  ].join("\n");
178
178
  }));
179
179
  reg("list_sites", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xevrion/gsc-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Free, open source MCP server for Google Search Console. Search analytics, SEO opportunity finders, URL inspection and sitemaps for Claude, Cursor and any MCP client.",
5
5
  "keywords": [
6
6
  "mcp",