Skip to main content

langchain-mapmap

MapMap tools for LangChain agents: routing for cars, trucks, bikes and walking, truck routing with ADR dangerous-goods restrictions, geocoding, travel-time matrices, isochrones, multi-stop day planning and hosted map styling, exposed through the hosted MapMap MCP server.

The hosted server connects without a key for evaluation, under fair use. For metered volume an agent gets a card-free key in one API call (see "With a key" below). Responses may be cached, stored, indexed and used for training; the machine-readable terms are at /.well-known/agent-terms.json.

60-second quickstart

pip install langchain-mapmap langchain langchain-anthropic
import asyncio
from langchain.agents import create_agent
from langchain_mapmap import get_mapmap_tools


async def main() -> None:
    tools = await get_mapmap_tools()  # keyless connect, fair use
    agent = create_agent("anthropic:claude-sonnet-5-5", tools)
    result = await agent.ainvoke(
        {
            "messages": [
                (
                    "user",
                    "Route a 4.0 m tall truck carrying ADR tunnel-code C goods "
                    "from Dover to Birmingham. Which restrictions shaped the route?",
                )
            ]
        }
    )
    print(result["messages"][-1].content)


asyncio.run(main())

That is the whole integration: every tool the server registers (route, check_adr_tunnel, geocode, matrix, optimise_routes, search_along_route, plan_day, reachable_area, nearby_places, navigation sessions, place entrances, map-styling and local geometry tools) with their full JSON Schemas. The wrapper adapts whatever tools/list returns, so it needs no update when the server gains a tool.

Navigation sessions and place entrances

The server's tools for guiding someone to a place turn by turn, and for finding a place's doors, come through like every other tool:

Tool What it does
start_navigation Opens a navigation session from an origin to a destination; answers the session id and the first instruction. arrive_at ("point" by default, "entrance" or {place_id, entrance_kind, wheelchair}) ends it at the place's best mapped door, and the answer's arrival says which.
check_navigation_progress Sends one position fix to the session; answers where the traveller is against the route (on_route, off_route, rerouted, arrived or lost_position) and the next instruction to read out.
end_navigation Ends the session and drops what it held.
place_entrances Lists the mapped doors of one place by its id.

Inputs on the existing tools: include_entrances on nearby_places, places_in_view and geocode adds each place's entrances to the answer, and arrive_at: "entrance" on route ends the route at the best mapped door for the mode of travel instead of the middle of the building (the answer's arrival block says which door, or why none was used). The same arrive_at on start_navigation ends a session at the door, and every reroute heads for the same door; with no door that suits, arrival is applied: false with the reason and the session ends at the destination as given.

Facts an agent should pass on, because they are how the service behaves:

  • Sessions live in the gateway's memory only and do not survive a gateway restart. A session that has gone answers as not found; open a new one from where the traveller is.
  • A session expires after 2 hours idle; every progress check resets the clock.
  • A session keeps the route and the last accepted fix only: no trail of positions, and nothing about a position is written to disk or logged.
  • Entrances are doors mapped in OpenStreetMap and tied to the place on evidence; none are estimated today. An empty list means no door is tied to the place, not that it has none.

Nothing in this package changes for these tools: it adapts whatever tools/list returns, so they appear as soon as the server you connect to registers them. A runnable agent: examples/navigate_to_entrance.py.

With a key (metered volume)

tools = await get_mapmap_tools(api_key="snk_...")

Get a card-free key in one call: POST https://api.mapmap.ai/v1/keys with {"email": "you@example.com", "accept_tos": true}. Email verification upgrades the same key to 50,000 included calls a month. Prices: mapmap.ai/pricing.json.

Self-hosted

Point the wrapper at your own gateway's MCP endpoint:

tools = await get_mapmap_tools(url="https://maps.internal.example/mcp")

Synchronous code

from langchain_mapmap import get_mapmap_tools_sync

tools = get_mapmap_tools_sync()

Data rights

MapMap will never ToS-ban caching, storing, indexing or training on API responses. Content derived from OpenStreetMap remains under ODbL: credit © OpenStreetMap contributors when you republish. Full manifest: https://mapmap.ai/.well-known/agent-terms.json.

Publishing (maintainers)

Never from a laptop. .github/workflows/publish-python-packages.yml builds, tests and twine checks this package on every pull request that touches it, and publishes it to PyPI through trusted publishing (no stored token) when dispatched on main with the version typed in full:

# Dry run: build, test and twine check only
gh workflow run publish-python-packages.yml -R Mapmapai/mapmap --ref main \
  -f package=langchain-mapmap

# Publish: confirm_version must equal the version in pyproject.toml
gh workflow run publish-python-packages.yml -R Mapmapai/mapmap --ref main \
  -f package=langchain-mapmap -f confirm_version=0.1.1

For a later release, bump version in pyproject.toml (and the CHANGELOG) first: PyPI never accepts the same version twice.

Licence

MIT. The MapMap service itself is governed by https://mapmap.ai/terms.

Metadata

Release files for langchain-mapmap 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-mapmap 0.1.1
File Size Uploaded Provenance Actions
langchain_mapmap-0.1.1.tar.gz 9.3 kB With provenance Details for langchain_mapmap-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-mapmap 0.1.1
File Interpreter ABI Platform Actions
langchain_mapmap-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_mapmap-0.1.1-py3-none-any.whl

Total release size: 15.5 kB

Release files / langchain_mapmap-0.1.1.tar.gz

Download URL langchain_mapmap-0.1.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e3af5603272e1b4dae463dd50c08d776ce8c337e45a557de635d2a0ac61381
BLAKE2b-256 checksum
How to use checksums
07d56166408de9f89885d31985738d5044e82b8605c9216365bdde6e15a337e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / langchain_mapmap-0.1.1-py3-none-any.whl

Download URL langchain_mapmap-0.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da1fc68dae3389bbed72af619d477bc97f17723a2be613f1f81d1a920d6094ef
BLAKE2b-256 checksum
How to use checksums
822aa51be21acda0736d65d3c70bab68abc5363b5236e776060d7668d032a8a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for langchain-mapmap 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_mapmap-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page