@disruptorganic/mcp-google-search-console 1.0.0 → 1.0.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/.env.example +19 -45
- package/README.md +0 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +10 -15
- package/dist/config/index.js.map +1 -1
- package/package.json +1 -1
package/.env.example
CHANGED
|
@@ -2,38 +2,18 @@
|
|
|
2
2
|
# Google Search Console MCP Server Configuration
|
|
3
3
|
# ============================================
|
|
4
4
|
#
|
|
5
|
-
# This file is a template for
|
|
6
|
-
# Copy this file to .env and
|
|
5
|
+
# This file is a template for optional environment variables.
|
|
6
|
+
# Copy this file to .env and customize as needed.
|
|
7
7
|
#
|
|
8
|
-
# IMPORTANT:
|
|
9
|
-
#
|
|
8
|
+
# IMPORTANT: OAuth2 credentials are now embedded in the package.
|
|
9
|
+
# You do NOT need to create your own Google Cloud project or credentials.
|
|
10
10
|
|
|
11
11
|
# =============================================================================
|
|
12
|
-
#
|
|
12
|
+
# AUTHENTICATION
|
|
13
13
|
# =============================================================================
|
|
14
14
|
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
# How to obtain OAuth2 credentials:
|
|
18
|
-
#
|
|
19
|
-
# 1. Go to Google Cloud Console: https://console.cloud.google.com/
|
|
20
|
-
# 2. Create a new project or select an existing one
|
|
21
|
-
# 3. Enable the Google Search Console API:
|
|
22
|
-
# - Navigate to "APIs & Services" > "Library"
|
|
23
|
-
# - Search for "Google Search Console API"
|
|
24
|
-
# - Click "Enable"
|
|
25
|
-
# 4. Create OAuth 2.0 credentials:
|
|
26
|
-
# - Navigate to "APIs & Services" > "Credentials"
|
|
27
|
-
# - Click "Create Credentials" > "OAuth client ID"
|
|
28
|
-
# - Choose "Desktop app" as the application type
|
|
29
|
-
# - Give it a name (e.g., "MCP GSC Server")
|
|
30
|
-
# - Click "Create"
|
|
31
|
-
# 5. Copy the Client ID and Client Secret from the dialog
|
|
32
|
-
#
|
|
33
|
-
# Format: The Client ID typically ends with .apps.googleusercontent.com
|
|
34
|
-
|
|
35
|
-
GSC_CLIENT_ID=123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com
|
|
36
|
-
GSC_CLIENT_SECRET=GOCSPX-abcdefghijklmnopqrstuvwxyz
|
|
15
|
+
# OAuth2 credentials are pre-configured and embedded in this package.
|
|
16
|
+
# No setup required - just install and authenticate on first use!
|
|
37
17
|
|
|
38
18
|
# =============================================================================
|
|
39
19
|
# OPTIONAL: Token Storage Configuration
|
|
@@ -106,36 +86,30 @@ GSC_CLIENT_SECRET=GOCSPX-abcdefghijklmnopqrstuvwxyz
|
|
|
106
86
|
# =============================================================================
|
|
107
87
|
#
|
|
108
88
|
# Quick Start:
|
|
109
|
-
# 1.
|
|
110
|
-
# 2.
|
|
111
|
-
# 3.
|
|
112
|
-
# 4. Follow the authentication flow in your browser
|
|
113
|
-
# 5. The tokens will be saved automatically
|
|
89
|
+
# 1. Install the package: claude mcp add --transport stdio google-search-console -- npx -y @disruptorganic/mcp-google-search-console
|
|
90
|
+
# 2. On first use, authenticate via browser (one-time setup)
|
|
91
|
+
# 3. Done! No additional configuration needed.
|
|
114
92
|
#
|
|
115
93
|
# First-Time Authentication Flow:
|
|
116
94
|
# When you first run the server, it will:
|
|
117
95
|
# 1. Check for existing tokens at the configured token path
|
|
118
|
-
# 2. If no tokens exist, initiate the OAuth2
|
|
96
|
+
# 2. If no tokens exist, initiate the OAuth2 authentication flow
|
|
119
97
|
# 3. Display a URL and code in the terminal
|
|
120
|
-
# 4. You visit the URL in your browser and
|
|
98
|
+
# 4. You visit the URL in your browser and authorize access
|
|
121
99
|
# 5. After authorization, tokens are saved and the server starts
|
|
122
100
|
# 6. Subsequent runs use the saved tokens (with automatic refresh)
|
|
123
101
|
#
|
|
124
102
|
# Security Best Practices:
|
|
125
|
-
# -
|
|
126
|
-
# -
|
|
127
|
-
# -
|
|
128
|
-
# - Rotate credentials if they are ever exposed
|
|
129
|
-
# - Use separate OAuth2 clients for development and production
|
|
103
|
+
# - Tokens are stored with secure file permissions (0600)
|
|
104
|
+
# - Tokens automatically refresh before expiry
|
|
105
|
+
# - Read-only access to Search Console data
|
|
130
106
|
#
|
|
131
107
|
# Troubleshooting:
|
|
132
|
-
# - "
|
|
133
|
-
# - "
|
|
134
|
-
# - "
|
|
135
|
-
# - "Token expired": The server will automatically refresh tokens if possible
|
|
136
|
-
# - "Permission denied": Check file permissions on the token storage directory
|
|
108
|
+
# - "Authentication required": Follow the browser authentication flow
|
|
109
|
+
# - "Token expired": Tokens will automatically refresh
|
|
110
|
+
# - "Permission denied": Check token file permissions at ~/.mcp-gsc/tokens.json
|
|
137
111
|
#
|
|
138
112
|
# For more information, see:
|
|
139
113
|
# - README.md
|
|
140
|
-
# - docs/
|
|
114
|
+
# - docs/USER_GUIDE.md
|
|
141
115
|
# - https://developers.google.com/webmaster-tools/v1/how-tos/authorizing
|
package/README.md
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAiDhB,CAAC;AASH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AA+ElD,eAAO,MAAM,MAAM;;;;;;CAAe,CAAC;AASnC,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAKD,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAKD,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAKD,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAUD,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzD;AAKD,wBAAgB,gBAAgB,IAAI,IAAI,CAMvC"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as os from 'os';
|
|
4
|
+
const EMBEDDED_CLIENT_ID = '34697290414-f3416jghvqmstm167lklfo1lbddnlsf4.apps.googleusercontent.com';
|
|
5
|
+
const EMBEDDED_CLIENT_SECRET = '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';
|
|
4
6
|
const configSchema = z.object({
|
|
5
|
-
clientId: z.string().min(1, '
|
|
6
|
-
clientSecret: z.string().min(1, '
|
|
7
|
+
clientId: z.string().min(1, 'Client ID is required'),
|
|
8
|
+
clientSecret: z.string().min(1, 'Client Secret is required'),
|
|
7
9
|
tokenPath: z.string().default(path.join(os.homedir(), '.mcp-gsc', 'tokens.json')),
|
|
8
10
|
redirectUri: z.string().default('urn:ietf:wg:oauth:2.0:oob'),
|
|
9
11
|
logLevel: z.enum(['error', 'warn', 'info', 'debug']).default('info'),
|
|
10
12
|
});
|
|
11
13
|
function loadConfig() {
|
|
12
14
|
const rawConfig = {
|
|
13
|
-
clientId:
|
|
14
|
-
clientSecret:
|
|
15
|
+
clientId: EMBEDDED_CLIENT_ID,
|
|
16
|
+
clientSecret: EMBEDDED_CLIENT_SECRET,
|
|
15
17
|
tokenPath: process.env.GSC_TOKEN_PATH,
|
|
16
18
|
redirectUri: process.env.GSC_REDIRECT_URI,
|
|
17
19
|
logLevel: process.env.LOG_LEVEL,
|
|
@@ -28,26 +30,19 @@ function loadConfig() {
|
|
|
28
30
|
})
|
|
29
31
|
.join('\n');
|
|
30
32
|
const errorMessage = `
|
|
31
|
-
Configuration Error:
|
|
33
|
+
Configuration Error: Invalid configuration
|
|
32
34
|
|
|
33
35
|
${missingFields}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- GSC_CLIENT_SECRET: Your Google OAuth2 Client Secret
|
|
37
|
+
OAuth2 credentials are pre-configured and embedded in this package.
|
|
38
|
+
No setup required for authentication credentials.
|
|
38
39
|
|
|
39
40
|
Optional environment variables (with defaults):
|
|
40
41
|
- GSC_TOKEN_PATH: Token storage path (default: ~/.mcp-gsc/tokens.json)
|
|
41
42
|
- GSC_REDIRECT_URI: OAuth redirect URI (default: urn:ietf:wg:oauth:2.0:oob)
|
|
42
43
|
- LOG_LEVEL: Logging level (default: info, options: error, warn, info, debug)
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
1. Go to https://console.cloud.google.com/apis/credentials
|
|
46
|
-
2. Create a new OAuth 2.0 Client ID (Desktop application type)
|
|
47
|
-
3. Enable the Google Search Console API for your project
|
|
48
|
-
4. Copy the Client ID and Client Secret
|
|
49
|
-
|
|
50
|
-
See .env.example for a complete configuration template.
|
|
45
|
+
See documentation for configuration details.
|
|
51
46
|
`.trim();
|
|
52
47
|
throw new Error(errorMessage);
|
|
53
48
|
}
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAYzB,MAAM,kBAAkB,GAAG,yEAAyE,CAAC;AACrG,MAAM,sBAAsB,GAAG,qCAAqC,CAAC;AAgBrE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAM5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;IAOpD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG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