gridpin-mcp — offline geocoding for AI agents
An MCP server that lets an agent geocode addresses with GridPin: one memory-mapped file per country, read on your machine. No API key, no rate limit, and no query leaves the machine. The only network step is downloading a country sheet once, verified against the signed GridPin release.
Countries (release v0.10.0): Australia, Brazil, Canada, France, Germany, Italy, Mexico, Netherlands, New Zealand, Poland, Serbia, Spain, United States.
Add it to an agent
Claude Code:
$ claude mcp add gridpin -- uvx gridpin-mcp
Any client that reads an mcpServers config (Claude Desktop, Cursor, ...):
{ "mcpServers": { "gridpin": { "command": "uvx", "args": ["gridpin-mcp"] } } }
To keep sheets in another directory, pass GRIDPIN_HOME in the server's own environment:
{ "mcpServers": { "gridpin": { "command": "uvx", "args": ["gridpin-mcp"],
"env": { "GRIDPIN_HOME": "/path/to/sheets" } } } }
Exporting it in your shell is not enough. Some MCP clients start the server with only a few
environment variables (clients built on the MCP Python SDK pass HOME, LOGNAME, PATH,
SHELL, TERM and USER on macOS and Linux), so GRIDPIN_HOME and XDG_CACHE_HOME from
your shell never reach it and sheets go to ~/.cache/gridpin.
A sheet of your own places (a campus, sites, depots; gridpin build --places places.csv own.bin)
is asked before the country's sheet when GRIDPIN_OWN_SHEET names it in the same env block
(GridPin engine 0.9 or later); answers from it carry the flag own_sheet.
download_sheet fetches a whole sheet in one tool call, and the larger sheets can take longer
than a client allows for one call (mcp-haystack's MCPToolset, for example, stops after 30 s
by default). Raise the client's tool timeout, or download the sheet beforehand in a terminal,
with the same GRIDPIN_HOME as the server; the tool then returns at once:
$ uvx --from gridpin-mcp gridpin-fetch fr
Step-by-step setup for agents (requirements, settings, verification): llms-install.md.
If GridPin is useful to you, a star on GitHub helps other people find it.
Tools
| Tool | What it does |
|---|---|
list_countries |
covered countries, sheet sizes, which are downloaded |
download_sheet |
fetch one country sheet (29 MB to 1.5 GB) once, verify its SHA-256; the only tool that uses the network |
geocode |
address text -> ranked candidates with lat, lon, precision, confidence |
reverse |
coordinates -> nearest indexed addresses with distance_m |
batch |
up to 1000 addresses of one country per call, in input order |
extract_addresses |
addresses written in a free text (a letter, an invoice, a model's answer), each with its span and answer; verify also lists invented ones |
Results are the same as the GridPin CLI, Python and DuckDB return. Treat street or
city precision as approximate.
Download a sheet without MCP
$ pip install gridpin-mcp
$ gridpin-fetch fr # prints the path, e.g. ~/.cache/gridpin/v0.9.0/france.bin
import gridpin
from gridpin_mcp import sheets
path = sheets.download("fr") # no-op when already downloaded
gridpin.Geocoder(str(path)).geocode("1 rue de la Paix, Paris", 1)
Sheets go to $GRIDPIN_HOME, else $XDG_CACHE_HOME/gridpin, else ~/.cache/gridpin.
Sizes and SHA-256 of every sheet are pinned in the package from the signed release
attestation; a download that does not match is discarded.
License
Apache-2.0. Sheet data: see attributions.
Metadata
Release files for gridpin-mcp 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gridpin_mcp-0.7.0.tar.gz | 32.3 kB | With provenance | Details for gridpin_mcp-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gridpin_mcp-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for gridpin_mcp-0.7.0-py3-none-any.whl |
Total release size: 58.1 kB
Release files / gridpin_mcp-0.7.0.tar.gz
| Download URL | gridpin_mcp-0.7.0.tar.gz |
|---|---|
| Size | 32.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40191dd1d251856bf6b1b14d5d8ed79bfa49bae1b4235a90424cd133961e8c1f
|
|
BLAKE2b-256 checksum How to use checksums |
e19148f0294d70d713c7d5ec17f909c4eb40a8351ea483a818a098649535c68a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 22, 2026.
Transparency logRelease files / gridpin_mcp-0.7.0-py3-none-any.whl
| Download URL | gridpin_mcp-0.7.0-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed09190a79adbeea6c4c0d09b9b2894b243285796d6ef903714ba2b1d3705006
|
|
BLAKE2b-256 checksum How to use checksums |
738420021c61a5bf46cbb1d4c8d95b7fc924a4cf6454af6ceebb3e8c258e8988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 22, 2026.
Transparency logSecurity for gridpin-mcp 0.7.0
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.
Attestation for gridpin_mcp-0.7.0.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 22, 2026.
Transparency logA 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.