Skip to main content

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.11.0): Australia, Belgium, 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.10.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.8.0

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

Source distribution (sdist)

Source distribution for gridpin-mcp 0.8.0
File Size Uploaded Provenance Actions
gridpin_mcp-0.8.0.tar.gz 32.4 kB With provenance Details for gridpin_mcp-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gridpin-mcp 0.8.0
File Interpreter ABI Platform Actions
gridpin_mcp-0.8.0-py3-none-any.whl Python 3 none any Details for gridpin_mcp-0.8.0-py3-none-any.whl

Total release size: 58.3 kB

Release files / gridpin_mcp-0.8.0.tar.gz

Download URL gridpin_mcp-0.8.0.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a8eaa5e19853b5de1331f1d2ff0bb88316a0b54c25891247d12347119b5bba34
BLAKE2b-256 checksum
How to use checksums
4f90839324e0c58f533c63944fb66b7a35aa2253aeefd7bb0eaf9b2284c42d59
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 29, 2026.

Transparency log

Release files / gridpin_mcp-0.8.0-py3-none-any.whl

Download URL gridpin_mcp-0.8.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf58027db4dc3cea257e3fe329e9764f36e01c85d92b441cb9ccf91907bdbc0c
BLAKE2b-256 checksum
How to use checksums
f76f368b2894ca270980935a0fa98b3b9a0f1e14fd9759b0292f3222c20fd865
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 29, 2026.

Transparency log

Security for gridpin-mcp 0.8.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.

Select from 2 files

Attestation for gridpin_mcp-0.8.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 29, 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.

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