UNPKG

google-search-console-mcp-js

Version:

Google Search Console MCP Server for Node.js - connect GSC data to Claude, Cursor and other MCP clients

92 lines (68 loc) 2.93 kB
# Google Search Console MCP Server (Node.js)**SOLUTION IMPLEMENTED**: Converted from Python to Pure Node.js ## What Was Fixed The original error `MCP error -32000: Connection closed` was caused by missing Python dependencies. This has been resolved by converting the entire MCP server to pure Node.js. ## Changes Made 1. **Created Node.js MCP Server** (`server.js`) - Full MCP protocol implementation using `@modelcontextprotocol/sdk` - Google Search Console API integration using `googleapis` - All original Python functionality preserved 2. **Updated Configuration** (`.roo/mcp.json`) - Changed from NPX wrapper to direct Node.js execution - Added explicit working directory path - Maintains same environment variables 3. **Added Package Management** (`package.json`) - Proper Node.js dependencies - NPM scripts for easy execution - Publishing-ready configuration ## Current Configuration Your MCP configuration is now: ```json { "mcpServers": { "gsc-search": { "command": "node", "args": ["server.js"], "cwd": "c:/Users/Admin/vs_code/google-search-console-mcp", "env": { "GOOGLE_APPLICATION_CREDENTIALS": "C:\\Users\\Admin\\vs_code\\google_api\\vscode-mcps-fc79d0a8902f.json", "GSC_SITE_URL": "sc-domain:residencesupply.com" } } } } ``` ## Validation Results**All Tests Passed**: - Node.js MCP server module loads correctly - Google APIs integration working - Credentials file validated (service account format) - All GSC data files (dimensions, metrics, filters) loaded - Environment variables properly configured ## Available Tools The server provides these MCP tools: 1. **`list_gsc_sites`** - List all verified sites in GSC 2. **`list_available_dimensions`** - Show available GSC dimensions 3. **`list_available_metrics`** - Show available GSC metrics 4. **`get_search_analytics`** - Get search performance data 5. **`get_sitemaps`** - List submitted sitemaps 6. **`submit_sitemap`** - Submit new sitemap 7. **`delete_sitemap`** - Remove sitemap ## Testing the Connection To verify the fix worked: 1. **Restart your MCP client** (Claude Desktop, Cursor, etc.) 2. **Test a simple command** like "list my GSC sites" 3. **Try getting search data** like "show me top queries from last week" ## No More Python Required - ❌ No Python installation needed - ❌ No pip packages to install - ❌ No Python path issues - ✅ Pure Node.js solution - ✅ Easy deployment and maintenance ## Support If you encounter any issues: 1. Run `node test-server.js` to validate setup 2. Check MCP client logs for detailed error messages 3. Verify credentials file permissions and format 4. Ensure site URL matches your GSC property exactly The server is now production-ready and should resolve your connection issues completely.