# MapRouter MCP server

> Enables AI agents to integrate maps, geocoding, and time zone data into applications using OpenStreetMap and MapLibre.

- Repository: https://github.com/maprouter-dev/maprouter-mcp
- Page: https://hostedmcp.org/servers/maprouter-dev/maprouter-mcp
- Transport: stdio, remote
- Stars: 0
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'MAPROUTER_SECRET_KEY=<YOUR_MAPROUTER_SECRET_KEY>' maprouter-mcp -- npx -y maprouter-mcp
```

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

```json
{
  "mcpServers": {
    "maprouter-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "maprouter-mcp"
      ],
      "env": {
        "MAPROUTER_SECRET_KEY": "<YOUR_MAPROUTER_SECRET_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "maprouter-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "maprouter-mcp"
      ],
      "env": {
        "MAPROUTER_SECRET_KEY": "<YOUR_MAPROUTER_SECRET_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"maprouter-mcp","type":"stdio","command":"npx","args":["-y","maprouter-mcp"],"env":{"MAPROUTER_SECRET_KEY":"<YOUR_MAPROUTER_SECRET_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "maprouter-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "maprouter-mcp"
      ],
      "env": {
        "MAPROUTER_SECRET_KEY": "<YOUR_MAPROUTER_SECRET_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add maprouter-mcp --env 'MAPROUTER_SECRET_KEY=<YOUR_MAPROUTER_SECRET_KEY>' -- npx -y maprouter-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.maprouter-mcp]
command = "npx"
args = ["-y", "maprouter-mcp"]

[mcp_servers.maprouter-mcp.env]
MAPROUTER_SECRET_KEY = "<YOUR_MAPROUTER_SECRET_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'MAPROUTER_SECRET_KEY=<YOUR_MAPROUTER_SECRET_KEY>' maprouter-mcp npx -- -y maprouter-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "maprouter-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "maprouter-mcp"
      ],
      "env": {
        "MAPROUTER_SECRET_KEY": "<YOUR_MAPROUTER_SECRET_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MAPROUTER_SECRET_KEY` | yes | yes | A secret key (mr_sk_...) from app.maprouter.dev |

## Tools (8)

- `setup_project`
- `geocode`
- `reverse_geocode`
- `autocomplete`
- `timezone`
- `get_map_snippet`
- `check_usage`
- `set_key_budget`

## FAQ

### How can I prevent unexpected costs when using MapRouter?

MapRouter is a prepaid service where agents can read usage and lower budgets, but they can never add credits or raise a budget.

### What programming frameworks can I use to generate map code?

The server can write MapLibre code specifically for HTML, React, Vue, or Svelte.

### How do I connect to the hosted version of the server?

You can add the hosted server via Claude using the HTTP transport and the provided URL.
