Skip to main content
Glama
Google Maps Scraper MCP Server

Google Maps Scraper MCP Server

by cryptoken
README.md
# Google Maps Scraper MCP Server

An [MCP](https://modelcontextprotocol.io/) server that scrapes Google Maps for local business leads — names, ratings, phone numbers, addresses, websites, and coordinates — all accessible through Claude Desktop or any MCP-compatible client.

## Features

- **Natural language queries** — search anything you'd type into Google Maps (e.g., *"plumbers in Bolingbrook"*)
- **Rich data extraction** — name, rating, review count, phone, address, website, coordinates
- **Structured output** — returns both human-readable markdown and raw JSON
- **MCP integration** — works with Claude Desktop, Claude Code, and any MCP client

## Quick Start

### 1. Install

```bash
git clone https://github.com/cryptoken/Google-Maps-Scraper-MCP.git
cd Google-Maps-Scraper-MCP
npm install
npm run build
```

### 2. Configure Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "google-maps-scraper": {
      "command": "node",
      "args": ["/path/to/google-maps-scraper-mcp/dist/index.js"]
    }
  }
}
```

### 3. Use it

Ask Claude to scrape Google Maps:

```
Find me coffee shops in downtown Chicago
```

Claude will call the `scrape_google_maps` tool and return structured business data.

## Tool Reference

### `scrape_google_maps`

| Parameter    | Type   | Required | Default | Description                                  |
| ------------ | ------ | -------- | ------- | -------------------------------------------- |
| `query`      | string | Yes      | —       | Search query (e.g., *"dentists in Austin"*)  |
| `maxResults` | number | No       | 20      | Number of businesses to return (max: 60)     |

### Output

Each business includes:

```typescript
{
  name: string;
  rating: number | null;
  reviewCount: number | null;
  phone: string | null;
  address: string | null;
  website: string | null;
  coordinates: { lat: number; lng: number } | null;
  email: string | null;
  googleMapsUrl: string;
}
```

## Development

```bash
npm run dev      # Run with tsx (hot reload)
npm run build    # Compile TypeScript
npm start        # Run compiled version
```

### Testing

```bash
npx tsx test-scraper.ts
```

## How It Works

1. Opens a Chromium browser via Puppeteer
2. Navigates to Google Maps with the search query
3. Scrolls through the results panel to load listings
4. Clicks each listing and extracts business details from the detail panel
5. Parses coordinates from the URL
6. Returns structured data via MCP

## Limitations

- **Headed mode required** — headless browsers get blocked by Google's bot detection
- **Rate limiting** — keep usage reasonable (~10 searches/day without proxies)
- **DOM selectors** — Google Maps updates its UI periodically; selectors in `src/scraper.ts` may need updating
- **Email** — rarely available on Google Maps listings

## Tech Stack

- **TypeScript** — type-safe scraping logic
- **[MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk)** — Model Context Protocol server framework
- **[Puppeteer](https://pptr.dev/)** — headless Chrome automation

## License

[MIT](LICENSE)