How to Use Google Maps in Cursor with MCP Tools
Location data comes up more often in development than you’d expect. Store finders, delivery radius logic, address validation, test fixtures with realistic addresses. Building these features well requires real data, and looking it up manually is slow. With AgentPatch connected, Cursor can query Google Maps directly during any session.
Why This Matters
When you’re building location-aware features, the quality of your test data matters. Hard-coded addresses and made-up business names don’t catch the edge cases that real data surfaces. If Cursor can search Maps on its own, it can pull actual results while you’re working, whether that’s for testing, seeding a database, or modeling a response type.
It also helps for tasks that aren’t strictly location features. Need to verify a business exists before writing an integration? Want realistic data for a demo? Cursor can handle those lookups inline without you opening a browser tab.
Setup
The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.
Install (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Example commands your agent will use:
ap search "web search"
ap run google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
- Open Cursor Settings (Cmd+Shift+J on Mac, Ctrl+Shift+J on Windows/Linux).
- Navigate to the MCP section in the sidebar.
- Click Add new global MCP server.
- Cursor opens
~/.cursor/mcp.json. Add the AgentPatch server config:
{
"mcpServers": {
"agentpatch": {
"url": "https://agentpatch.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
- Replace
YOUR_API_KEYwith your actual key from the AgentPatch dashboard. - Save and restart Cursor. It discovers all AgentPatch tools automatically.
Example
You’re building an app that shows nearby pharmacies and need to model the response type. In Cursor’s chat, you ask:
“Search Google Maps for pharmacies near zip code 10001 and show me the results so I can model the response type.”
Cursor searches Maps through AgentPatch:
Searching Google Maps for "pharmacy near 10001"...
Results:
- Duane Reade (4.1 stars) — 300 W 34th St, New York, NY 10001
- CVS Pharmacy (3.8 stars) — 345 8th Ave, New York, NY 10001
- Rite Aid (3.9 stars) — 352 W 42nd St, New York, NY 10036
Each result includes: name, rating, address, coordinates (lat/lng).
Here's a TypeScript interface for the response:
interface PharmacyResult {
name: string;
rating: number;
address: string;
lat: number;
lng: number;
}
Cursor derived the type from real search results. That’s more reliable than guessing at a schema.
You can also use Maps data for seeding:
“Find 20 coffee shops in downtown Portland and generate a SQL insert statement I can use to seed the development database.”
Cursor searches, collects the results, and writes the SQL. Real names, real addresses, real coordinates.
Wrapping Up
Google Maps is one tool in the AgentPatch marketplace. The same MCP connection gives Cursor access to web search, news, email, image generation, and everything else available. One setup, full access. Visit agentpatch.ai to explore.