GSC MCP Server
Enables interaction with Google Search Console to query search analytics, inspect URL indexing status, and manage sitemaps. It allows users to monitor SEO performance and site health through natural language commands in MCP-compatible clients.
README
GSC MCP Server
A Model Context Protocol (MCP) server for Google Search Console. Query your search analytics, inspect URLs, and manage sitemaps directly from Claude, ChatGPT, or any MCP client.
Want a hosted solution? Ekamoira offers a fully-managed GSC MCP server with OAuth authentication, no setup required. Just connect your Google account and start querying.
Features
- Search Analytics: Query clicks, impressions, CTR, and position data with flexible filtering
- Site Management: List all your GSC properties with permission levels
- URL Inspection: Check indexing status, crawl issues, and mobile usability
- Sitemap Management: List, submit, and delete sitemaps
Quick Start
Prerequisites
- Node.js 20+
- A Google Cloud project with Search Console API enabled
- OAuth 2.0 credentials (Desktop app type)
Installation
git clone https://github.com/soumyadeep-ux/gsc-mcp-server.git
cd gsc-mcp-server
npm install
cp .env.example .env
Edit .env with your Google credentials:
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
First-Time Authentication
npm run auth
This opens your browser for Google OAuth consent and saves the token locally.
Connect to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"gsc": {
"command": "node",
"args": ["/absolute/path/to/gsc-mcp-server/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-secret"
}
}
}
}
Build and restart Claude Desktop:
npm run build
# Restart Claude Desktop
Connect to Cursor
# Add via CLI
npx cursor-mcp add gsc-mcp-server node /absolute/path/to/gsc-mcp-server/dist/index.js
Available Tools
| Tool | Description |
|---|---|
gsc.list_sites |
List all your GSC properties with permission levels |
gsc.search_analytics |
Query search performance data with filters |
gsc.inspect_url |
Check URL indexing status, crawl info, and mobile usability |
gsc.list_sitemaps |
List all submitted sitemaps with status |
gsc.submit_sitemap |
Submit a new sitemap |
gsc.delete_sitemap |
Remove a sitemap |
Example Prompts
Try these prompts in Claude:
- "List all my Search Console sites"
- "What are my top 10 keywords by clicks this month?"
- "Show me queries with more than 1000 impressions but CTR below 2%"
- "What keywords are driving traffic to my /blog page?"
- "Compare my search performance for the last 7 days vs the previous 7 days"
- "Is https://example.com/pricing indexed by Google?"
- "Check the indexing status of my homepage"
- "List all sitemaps submitted to my site"
- "Submit https://example.com/sitemap.xml to Search Console"
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
GOOGLE_CLIENT_ID |
Yes | Google OAuth 2.0 Client ID |
GOOGLE_CLIENT_SECRET |
Yes | Google OAuth 2.0 Client Secret |
GSC_SERVICE_ACCOUNT_PATH |
No | Path to service account JSON (alternative to OAuth) |
GSC_TOKEN_PATH |
No | Token storage path (default: ./token.json) |
GSC_DEFAULT_SITE |
No | Default GSC property URL |
GSC_LOG_LEVEL |
No | Log level: debug/info/warn/error (default: info) |
Service Account Authentication
For automated/server environments, you can use a service account instead of OAuth:
- Create a service account in Google Cloud Console
- Grant it access in Google Search Console (add as user)
- Download the JSON key file
- Set
GSC_SERVICE_ACCOUNT_PATHin your environment
GSC_SERVICE_ACCOUNT_PATH=/path/to/service-account.json
Development
npm run dev # Watch mode with hot reload
npm run build # Compile TypeScript
npm run lint # Check code style
npm run typecheck # Type checking
npm run test # Run tests
Testing with MCP Inspector
npm run build
npm run inspector
Alternatives
| Option | Best For | Link |
|---|---|---|
| This repo | Developers who want full control and self-hosting | You're here! |
| Ekamoira GSC MCP | Users who want zero setup, works immediately | app.ekamoira.com/tools/gsc |
Ekamoira's Hosted Solution
If you don't want to manage credentials or run your own server, Ekamoira offers:
- One-click Google OAuth connection
- No local setup or credentials management
- Works with Claude.ai, ChatGPT, Claude Desktop, and Cursor
- 30-day free trial
- Additional SEO tools beyond GSC
Troubleshooting
"Token expired" errors
rm token.json
npm run auth
"API not enabled" error
- Go to Google Cloud Console
- APIs & Services > Enable APIs
- Search for "Search Console API"
- Click Enable
"Permission denied" errors
- Verify you have access to the GSC property
- Check that OAuth scopes include
webmasters - Try re-authenticating with
npm run auth
Claude Desktop not showing tools
- Verify JSON syntax in config file
- Use absolute paths (not relative)
- Restart Claude Desktop completely
- Check logs at
~/Library/Logs/Claude/(macOS)
Contributing
Contributions are welcome! Please:
- Fork the repo
- Create a feature branch
- Make your changes
- Run
npm run lint && npm run typecheck && npm test - Submit a PR
License
MIT
Credits
Built with the Model Context Protocol SDK.
Inspired by Ekamoira, an AI-powered SEO platform.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。