GSC MCP
GSC MCP
An extensible Model Context Protocol (MCP) server for Google Site Verification and Google Search Console. It uses the MCP Streamable HTTP transport and keeps Google OAuth credentials and tokens local.
Available tools
Tool | Purpose |
| Get a FILE or META verification token for a URL-prefix site |
| Verify site ownership after the file or meta tag is live |
| Add a verified URL-prefix property |
| Submit a sitemap for a property |
| List Search Console properties |
| List submitted sitemaps and their status |
Requirements
Node.js 20 or newer
A Google Cloud OAuth Desktop client
Site Verification API and Search Console API enabled in the Google Cloud project
Setup
npm ci
cp .env.example .envFill GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in .env, then generate a strong MCP bearer token:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Put the generated value in MCP_AUTH_TOKEN, authorize Google once, and start the server:
npm run auth
npm startThe endpoints are:
MCP:
http://127.0.0.1:8787/mcpHealth:
http://127.0.0.1:8787/health
MCP requests must include Authorization: Bearer <MCP_AUTH_TOKEN>. To connect a remote MCP client, expose the local endpoint through a trusted HTTPS tunnel and keep bearer authentication enabled.
Architecture
src/index.js runtime composition
src/http-server.js HTTP transport and bearer auth
src/server.js MCP server construction
src/google-client.js reusable Google OAuth/API client
src/tools/index.js central tool registry
src/tools/google-search-console.js
Search Console tool moduleTo add another MCP capability:
Create one registrar module in
src/tools/.Export a function with the signature
registerFeatureTools(server, dependencies).Add that registrar to
src/tools/index.js.Add contract tests under
test/.
Keep API clients outside tool modules and inject them as dependencies. This keeps tools testable and prevents credentials from becoming part of the MCP layer.
Validation
npm test
npm run security:check
npm run checkCI runs the same deterministic checks on every push and pull request.
Security
.env, token*.json, client_secret*.json, private keys, dependencies, and logs are excluded from Git. The secret check scans only tracked files and fails on blocked credential filenames or high-confidence token patterns. See SECURITY.md.