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.9.0): United States, Canada, Germany, France, Italy, Spain, Australia, Mexico, Netherlands, Brazil, Serbia.

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 (32 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.6.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.6.0
File Size Uploaded Provenance Actions
gridpin_mcp-0.6.0.tar.gz 21.9 kB With provenance Details for gridpin_mcp-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 39.7 kB

Release files / gridpin_mcp-0.6.0.tar.gz

Download URL gridpin_mcp-0.6.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c0a7d505e6d798f84c6f2c54760960781b70738b8417cab301518c4ecb50850
BLAKE2b-256 checksum
How to use checksums
bfaf303fc8a9fc2a71f1b641511bd24f2717f22226983faddf5e14bd3668b7ff
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 13, 2026.

Transparency log

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

Download URL gridpin_mcp-0.6.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a3698a993bee549ffb31368683bd42a8ea2cd9b55b60d5b5c71c944536677e9
BLAKE2b-256 checksum
How to use checksums
39ff75ad1910c47c3f002fed1036eea0e0fe1da2b49ab17f0a74f80f9b0cb90a
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 13, 2026.

Transparency log

Security for gridpin-mcp 0.6.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.6.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 13, 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