Skip to main content
Glama
kevinwuhoo

Google Maps Geocoding MCP Server

by kevinwuhoo
README.md
# Google Maps Geocoding MCP Server

[![NPM Version](https://img.shields.io/npm/v/google-maps-geocoding-mcp?style=flat&color=blue)](https://www.npmjs.com/package/google-maps-geocoding-mcp)
[![NPM Downloads](https://img.shields.io/npm/dw/google-maps-geocoding-mcp?style=flat&color=green)](https://www.npmjs.com/package/google-maps-geocoding-mcp)
[![License](https://img.shields.io/npm/l/google-maps-geocoding-mcp?style=flat&color=blue)](https://github.com/kevinwuhoo/google-maps-geocoding-mcp/blob/main/LICENSE)
[![Node.js Version](https://img.shields.io/node/v/google-maps-geocoding-mcp?style=flat&color=green)](https://nodejs.org/)
[![GitHub Stars](https://img.shields.io/github/stars/kevinwuhoo/google-maps-geocoding-mcp?style=flat&color=yellow)](https://github.com/kevinwuhoo/google-maps-geocoding-mcp)
[![GitHub Issues](https://img.shields.io/github/issues/kevinwuhoo/google-maps-geocoding-mcp?style=flat&color=red)](https://github.com/kevinwuhoo/google-maps-geocoding-mcp/issues)

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides access to Google Maps Geocoding API. This server enables LLM clients like Claude Desktop and Cursor to perform address geocoding, reverse geocoding, and place ID lookups. The aim of this MCP is _only_ the Geocoding API. This is because there isn't great support for connecting to many MCP servers yet in most tools.

## Features

- πŸ—ΊοΈ **Forward Geocoding**: Convert addresses to coordinates
- πŸ“ **Reverse Geocoding**: Convert coordinates to addresses
- 🏒 **Place Geocoding**: Convert Google Place IDs to addresses
- 🌍 **Multi-language Support**: Get results in different languages
- 🎯 **Advanced Filtering**: Filter by result types, location types, and components
- πŸš€ **Built on Official SDK**: Uses Google's official [`@googlemaps/google-maps-services-js`](https://github.com/googlemaps/google-maps-services-js) library will full TypeScript support

## Prerequisites

1. **Google Maps API Key**: Get one from the [Google Cloud Console](https://console.cloud.google.com/google/maps-apis/credentials)
2. **Node.js**: Version 18 or higher
3. **Claude Desktop** or **Cursor** (or another MCP-compatible client)

## Setup with MCP Clients

### Claude Desktop

Edit your Claude Desktop config file:

| Platform    | Config File Location                                              |
| ----------- | ----------------------------------------------------------------- |
| **macOS**   | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| **Windows** | `%APPDATA%\Claude\claude_desktop_config.json`                     |

```json
{
  "mcpServers": {
    "google-maps-geocoding": {
      "command": "npx",
      "args": ["google-maps-geocoding-mcp"],
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

Then restart Claude Desktop and ask Claude to geocode an address!

### Cursor

Add to your Cursor settings (Settings β†’ Extensions β†’ MCP Servers):

```json
{
  "mcp.servers": [
    {
      "name": "google-maps-geocoding",
      "command": "npx",
      "args": ["google-maps-geocoding-mcp"],
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_api_key_here"
      }
    }
  ]
}
```

Test the integration using the AI chat!

## Usage Examples

### Forward Geocoding (Address β†’ Coordinates)

Ask your AI client:

> "Geocode the address '1600 Amphitheatre Parkway, Mountain View, CA'"

### Reverse Geocoding (Coordinates β†’ Address)

Ask your AI client:

> "What address is at coordinates 37.4224764, -122.0842499?"

### Place Geocoding (Place ID β†’ Address)

Ask your AI client:

> "Get the address for Google Place ID 'ChIJd8BlQ2BZwokRAFUEcm_qrcA'"

### Advanced Usage

**With component filtering:**

> "Find 'Main Street' in San Francisco, CA, US"

**With language preferences:**

> "Geocode 'Champs-Γ‰lysΓ©es' in French"

**With regional biasing:**

> "Find restaurants near coordinates 37.7749, -122.4194 in the US region"

### Common Issues

**MCP Server not connecting:**

- Verify Node.js version is 18+
- Check your MCP client configuration

**API key errors:**

- Verify your API key is correct
- Check that the Geocoding API is enabled in Google Cloud Console
- Ensure API key restrictions allow your usage

### Debug Mode

Enable debug logging by setting:

```bash
LOG_LEVEL=debug npx google-maps-geocoding-mcp
```

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, guidelines, and how to submit changes.

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: geocode_forward handles addresses to coordinates, geocode_place converts Place IDs to addresses, and geocode_reverse does coordinates to addresses. There is no overlap or ambiguity between these three operations.

Naming Consistency5/5

All tool names follow a consistent 'geocode_' prefix with descriptive suffixes (forward, place, reverse), using snake_case uniformly. This pattern is predictable and enhances readability.

Tool Count5/5

With 3 tools, the server is well-scoped for geocoding operations, covering the essential forward, reverse, and Place ID conversions. Each tool earns its place without being excessive or insufficient for the domain.

Completeness5/5

The tool set provides complete coverage for the Google Maps Geocoding domain, including forward geocoding, reverse geocoding, and Place ID resolution. There are no obvious gaps, as these are the core operations offered by the API.

Maintenance

ActivityInactive
ResponsivenessNo issues