# Opencage Geocoding MCP

> Opencage Geocoding MCP is an open-source MCP server for maps and travel. Geocoding tools for AI assistants: convert addresses to coordinates and back via OpenCage. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, macOS, Windows, Linux
- **Repository:** https://github.com/opencagedata/opencage-geocoding-mcp
- **MCP Registry name:** io.github.OpenCageData/opencage-geocoding-mcp
- **Categories:** [maps and travel](https://ai-powered.com/categories/maps-and-travel)
- **Listing updated:** 2026-11-18

## About

The README says this server connects an AI client to the OpenCage geocoding API, so a model can turn place names into latitude and longitude and turn coordinates into readable addresses. Forward and reverse lookups return location details such as timezone and currency when the query is specific enough.

A third tool reports API usage and rate limits for the account tied to the key. The package is distributed through npm and runs over stdio, and it needs an OpenCage API key set in the environment. The README points out that it suits small, ad hoc lookups; for large batches it recommends OpenCage's command-line tools or having the model write a script against the API.

It is aimed at people who already use an MCP-capable client such as Claude Desktop and want geographic lookups inside a conversation.

## Features

- **Forward geocoding:** Converts an address or place name into coordinates, with optional country, bounds, language and result limit filters.
- **Reverse geocoding:** Converts latitude and longitude into a formatted address and location annotations.
- **API usage check:** A tool that reports remaining requests and rate limit information for the account.
- **Geocoding assistant prompt:** Includes a prompt template that offers guidance on using the geocoding tools.

## Good for

- Look up coordinates for a place name while drafting a conversation or report
- Identify which region or province a set of coordinates falls in
- Check remaining OpenCage API quota before running a batch of lookups

## Install

### Claude Code (Terminal)

```sh
claude mcp add opencage-geocoding-mcp --env YOUR_API_KEY='<YOUR_API_KEY>' -- npx -y @opencage/mcp-opencage-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "opencage-geocoding-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@opencage/mcp-opencage-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "opencage-geocoding-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@opencage/mcp-opencage-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "opencage-geocoding-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@opencage/mcp-opencage-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "opencage-geocoding-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@opencage/mcp-opencage-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "opencage-geocoding-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@opencage/mcp-opencage-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

## Tools

- `geocode-forward`: Convert an address or place name to coordinates and information about that location.
- `geocode-reverse`: Convert coordinates to an address and information about that location.
- `get-opencage-info`: Check current API usage and rate limits.

## FAQ

### What API key is needed?

An OpenCage geocoding API key, set as OPENCAGE_API_KEY. The README says a free-trial key is available from the OpenCage website.

### Is it suited to large data sets?

The README says it is meant for small amounts of geocoding. For CSV files or database-scale work it recommends OpenCage's command-line tools or a script that calls the API directly.

### What does the server require to run?

Node.js version 20 or higher, plus npm install and a build step when run from source.

### Is Opencage Geocoding MCP free?

Yes. Opencage Geocoding MCP is open source, so you can use and self-host it for free.

### How do I add Opencage Geocoding MCP to Claude Code?

Run this command in your terminal: claude mcp add opencage-geocoding-mcp --env YOUR_API_KEY='<YOUR_API_KEY>' -- npx -y @opencage/mcp-opencage-server

### What are the best alternatives to Opencage Geocoding MCP?

The closest alternatives to Opencage Geocoding MCP are Opencages, Geoapify MCP by usefulapi, MapTiler MCP by usefulapi, Geohash and Census Geocoder.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Opencages](https://ai-powered.com/mcp/opencages): Opencages is a freemium MCP server for maps and travel.
- [Geoapify MCP by usefulapi](https://ai-powered.com/mcp/geoapify-mcp-by-usefulapi): Geoapify MCP by usefulapi is a freemium MCP server for maps and travel.
- [MapTiler MCP by usefulapi](https://ai-powered.com/mcp/maptiler-mcp-by-usefulapi): MapTiler MCP by usefulapi is a freemium MCP server for maps and travel.
- [Geohash](https://ai-powered.com/mcp/geohash): Geohash is a freemium MCP server for maps and travel.
- [Census Geocoder](https://ai-powered.com/mcp/census-geocoder): Census Geocoder is a freemium MCP server for analytics and data.
- [OpenGeocoding](https://ai-powered.com/mcp/opengeocoding): OpenGeocoding is a freemium MCP server for maps and travel.
- [Platform Ai](https://ai-powered.com/mcp/platform-ai): Platform Ai is an open-source MCP server for maps and travel.
- [Google Maps MCP](https://ai-powered.com/mcp/google-maps-mcp-2): Google Maps MCP is an open-source MCP server for maps and travel.

---
Source: https://ai-powered.com/mcp/opencage-geocoding-mcp
