Guides
for everything Geocodio
Guides
for everything Geocodio
Geocode addresses in Claude and ChatGPT
Quick Answer
You can geocode addresses in Claude, ChatGPT, and other AI assistants by connecting them to the Geocodio MCP server at https://api.geocod.io/mcp. Add the URL to your assistant, sign in to your Geocodio account to approve the connection, then ask for coordinates, congressional districts, census data, or drive times in plain language.
You can use Geocodio inside an AI assistant such as Claude or ChatGPT to geocode addresses, reverse geocode coordinates, add data such as congressional districts and census statistics, and measure drive times.
This guide walks through connecting Claude and ChatGPT, then running a real geocoding and data append task. The full reference is in the API documentation.
What is the Geocodio MCP server?
MCP stands for Model Context Protocol. It’s an open standard that lets an AI assistant use outside tools and data. The Geocodio MCP server gives your assistant three tools, so its answers use Geocodio’s address data.
| Tool | What it does | Example question |
|---|---|---|
| Geocode | Finds the latitude and longitude for an address, with any data appends (extra data such as congressional districts or census statistics) you ask for | What congressional district is 1109 N Highland St, Arlington VA in? |
| Reverse geocode | Finds the address at a set of coordinates, with any data appends you ask for | What’s the address at 38.8977, -77.0365? |
| Distance | Measures straight-line distance, or road distance and drive time, from one starting point to up to 100 destinations | Which of these five stores is closest to our warehouse? |
Geocodio hosts the server, so there is nothing to install. It covers addresses in the US, Canada, Mexico, the UK, Australia, and New Zealand.
UK access
UK lookups are available to customers after they sign the UK addendum (available for Flex and Unlimited plans). They are not available on pay-as-you-go.
What do I need to get started?
A Geocodio account. You can create one for free.
An AI assistant that supports remote MCP servers. Claude, ChatGPT, Claude Code, Codex, Cursor, and VS Code all do.
A team role that can create API keys, or an MCP key of your own. If you have neither, ask an account admin to change your role.
Note: Lookups your assistant makes are billed to your Geocodio account, the same as lookups made through the API. See how much it costs below.
How to connect Claude to Geocodio
In Claude or Claude Desktop, open Settings and go to Connectors.
Select Add custom connector.
Enter
Geocodioas the name andhttps://api.geocod.io/mcpas the URL.Select Connect. Claude opens a Geocodio sign-in page in your browser.
Follow the steps in Approve the connection in Geocodio below.
On Claude Team and Enterprise plans, an owner may need to add the connector for the organization first.
Claude Code
Add the server from your terminal, then run /mcp in Claude Code and select geocodio to sign in.
claude mcp add --transport http geocodio https://api.geocod.io/mcp
How to connect ChatGPT to Geocodio
In the ChatGPT desktop app, open Settings and go to Plugins.
Select the MCPs tab and add a custom MCP.
Enter
Geocodioas the name, choose Streamable HTTP, and enterhttps://api.geocod.io/mcpas the URL.Leave the bearer token and header fields empty, then select Save.
Select Authenticate next to Geocodio. ChatGPT opens a Geocodio sign-in page in your browser.
Follow the steps in Approve the connection in Geocodio below.
Menu names may differ
Menu names change from time to time, so check your assistant’s own help pages if a step doesn’t match what you see. The API documentation also covers Codex and other assistants.
Approve the connection in Geocodio
Claude and ChatGPT both connect through OAuth. That means you sign in to Geocodio in your browser and approve the connection there, and you never paste a key into the assistant.
Sign in to your Geocodio account on the page your assistant opened.
Choose Create a new MCP key, or pick an MCP key you already have.
If you’re creating a key, give it a name you’ll recognize later, such as
Claude, and choose its permissions.Select Authorize. You’re sent back to your assistant, and it can start using Geocodio.
Permissions can’t be changed later
An MCP key’s permissions can’t be changed after it’s created. To use different permissions, create a new MCP key and connect your assistant again.
How to connect with an MCP key instead
Some setups can’t sign in through a browser, such as a CI pipeline or an agent running on a server. For those, you can create an MCP key yourself and add it to your assistant’s configuration.
Go to the API keys page in the Geocodio dashboard.
In the MCP keys section, select Create MCP key.
Name the key, choose its permissions, and save it.
Add the key to your assistant’s configuration as a bearer token in the
Authorizationheader.
In Claude Code, for example:
claude mcp add --transport http geocodio https://api.geocod.io/mcp \
--header "Authorization: Bearer YOUR_MCP_KEY"
MCP keys start with mcp_ and are listed separately from regular API keys. An MCP key only works with the MCP server, and a regular API key only works with the Geocodio API. Keep an MCP key private, as you would a password.
Example: Geocode addresses and add congressional districts
Once your assistant is connected, ask in your own words. Your assistant decides when to use Geocodio. Here is a prompt you can copy:
Geocode these addresses with Geocodio and give me the coordinates, the accuracy type,
and the congressional district for each one, as a table:
1109 N Highland St, Arlington VA
350 5th Ave, New York, NY
233 S Wacker Dr, Chicago, IL
The assistant geocodes each address with the congressional district data append and returns results like these:
| Address | Latitude | Longitude | Accuracy type | Congressional district |
|---|---|---|---|---|
| 1109 N Highland St, Arlington, VA 22201 | 38.886672 | -77.094735 | rooftop | Virginia 8th |
| 350 5th Ave, New York, NY 10118 | 40.748377 | -73.984854 | rooftop | New York 12th |
| 233 S Wacker Dr, Chicago, IL 60606 | 41.878723 | -87.635978 | rooftop | Illinois 7th |
Geocodio filled in the ZIP code for each address and matched all three at rooftop accuracy, which means the coordinates are for the building itself. This request used 6 lookups: one for each address, plus one for each address’s congressional district.
Measure a drive time
How long is the drive from 1109 N Highland St, Arlington VA
to 1600 Pennsylvania Ave NW, Washington DC?
Geocodio returns a road distance of 3.9 miles (6.3 km) and a drive time of 547 seconds, which the assistant reports as about 9 minutes.
More prompts to try
"What timezone is 24 Sussex Drive, Ottawa, Canada in?"
"Give me the median household income for the area around 350 5th Ave, New York."
"Which county and congressional district is 40.7484, -73.9857 in?"
"Which of these clinics are within a 30-minute drive of 38.9072, -77.0369?"
"List these offices from nearest to farthest, in kilometers."
How do I get accurate results?
Give a full address. A street, city, and ZIP or postal code gives the best results.
Name the country for addresses outside the US. Write "Ottawa, Canada", not "Ottawa ON". Without one, Geocodio infers the country from the address and falls back to the US.
Check the accuracy type.
rooftopandpointare exact matches.place,county, andstatemean Geocodio couldn’t find the address and returned the center of a postal code, city, county, or state instead. See accuracy types and scores.Ask only for the data you need. Districts and census statistics return a lot of detail. Asking for many at once costs more lookups and can fill up your assistant’s memory for the conversation.
An assistant is a good fit for a handful of addresses or a one-off question. For a list of hundreds or thousands of addresses, geocode a spreadsheet instead. It’s faster, and you get every row back in a file.
How much does it cost to geocode in an AI assistant?
Lookups through an assistant cost the same as lookups through the API. On the Unlimited plan, geocoding and data appends are included, and only distance is billed. On other plans:
Each address or location is one lookup. Each type of data you ask for adds one more lookup. Asking for the congressional district and timezone of one address costs 3 lookups.
Distance is charged per starting point and destination pair. Drive times and road distances count double, and any locations you give as addresses instead of coordinates also count as lookups.
Give your assistant its own MCP key. That way, you can see how many lookups it uses on the usage page. If your plan offers usage limits, you can also set one to cap its lookups. For more on how lookups are counted, see What’s a lookup?
How to disconnect an assistant
Delete its MCP key on the API keys page. Any assistant using that key stops working right away. To switch an assistant to a different key, connect it again and pick the new key.
Useful resources
AGENTS.md, a guide for AI assistants planning larger geocoding jobs