Quickstart
MapRouter gives your app map tiles, geocoding, autocomplete and time zones from OpenStreetMap data, with one key and prepaid credits. There is no card to add: you get 10,000 free credits every day.
With your coding agent
Add the MapRouter MCP server to Claude Code:
claude mcp add --transport http maprouter https://mcp.maprouter.dev/mcp
Then ask for what you want:
> add a map with our three store locations
The first time, your browser opens so you can sign in with GitHub and allow the agent. The agent then creates your keys, writes the env lines, geocodes the addresses and adds the map code. It can read your usage and lower budgets, but it can never add credits or raise a cap. See MCP server for other clients.
By hand
- Sign in with GitHub and create a publishable key
(
mr_pk_…) with your site’s origin, for examplehttps://shop.example. - Add MapLibre and point it at a MapRouter style:
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.9.0/dist/maplibre-gl.css" />
<div id="map" style="height: 480px"></div>
<script src="https://unpkg.com/maplibre-gl@5.9.0/dist/maplibre-gl.js"></script>
<script>
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.maprouter.dev/v1/styles/survey.json?key=mr_pk_YOUR_KEY',
center: [-0.1571, 51.5226],
zoom: 14,
});
</script>
- To look up addresses, call the API from your server with a secret key (
mr_sk_…):
curl -H "Authorization: Bearer $MAPROUTER_SECRET_KEY" \
"https://api.maprouter.dev/v1/geocode?q=221B+Baker+Street,+London&limit=1"
Publishable keys work from the origins you list and from localhost on any port, so you can
develop without changing anything.
What it costs
Each response says what it cost and what is left, in the X-MR-Credits-Used and
X-MR-Balance headers. A map view is about 20 credits, a geocode 10. When your balance
reaches zero, requests return 402 insufficient_credits and nothing more is charged. See
credits and caps and pricing.
Attribution
Keep the map’s attribution control visible. OpenStreetMap’s licence requires the credit “© OpenStreetMap contributors” wherever its data is shown. See attribution.