gmaps-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gmaps_mcp-0.1.0/.env.example +8 -0
- gmaps_mcp-0.1.0/.gitignore +38 -0
- gmaps_mcp-0.1.0/LICENSE +21 -0
- gmaps_mcp-0.1.0/PKG-INFO +242 -0
- gmaps_mcp-0.1.0/README.md +215 -0
- gmaps_mcp-0.1.0/examples/openai_agents_demo.py +195 -0
- gmaps_mcp-0.1.0/pyproject.toml +49 -0
- gmaps_mcp-0.1.0/run.py +59 -0
- gmaps_mcp-0.1.0/src/google_maps_mcp/__init__.py +5 -0
- gmaps_mcp-0.1.0/src/google_maps_mcp/__main__.py +40 -0
- gmaps_mcp-0.1.0/src/google_maps_mcp/client.py +496 -0
- gmaps_mcp-0.1.0/src/google_maps_mcp/server.py +257 -0
- gmaps_mcp-0.1.0/src/google_maps_mcp/tools.py +171 -0
- gmaps_mcp-0.1.0/uv.lock +1234 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Get a key: https://console.cloud.google.com/apis/credentials
|
|
2
|
+
# Enable: Places API (New), Directions API, Geocoding API
|
|
3
|
+
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
|
|
4
|
+
|
|
5
|
+
# Only needed for HTTP mode — optional auth for remote deployments
|
|
6
|
+
MCP_API_KEY=
|
|
7
|
+
MCP_HOST=0.0.0.0
|
|
8
|
+
MCP_PORT=8000
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
env/
|
|
8
|
+
venv/
|
|
9
|
+
.venv/
|
|
10
|
+
ENV/
|
|
11
|
+
build/
|
|
12
|
+
dist/
|
|
13
|
+
*.egg-info/
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
|
|
18
|
+
# Environment
|
|
19
|
+
.env
|
|
20
|
+
.env.local
|
|
21
|
+
.env.*.local
|
|
22
|
+
|
|
23
|
+
# IDE
|
|
24
|
+
.vscode/
|
|
25
|
+
.idea/
|
|
26
|
+
*.swp
|
|
27
|
+
*.swo
|
|
28
|
+
.cursor/
|
|
29
|
+
|
|
30
|
+
# Logs
|
|
31
|
+
*.log
|
|
32
|
+
|
|
33
|
+
# OS
|
|
34
|
+
.DS_Store
|
|
35
|
+
Thumbs.db
|
|
36
|
+
|
|
37
|
+
# Local-only tests (real-API integration tests, not for public repo)
|
|
38
|
+
tests/
|
gmaps_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arthur Katcher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
gmaps_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gmaps-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Google Maps — places search, directions, geocoding. Works with Claude Desktop, Cursor, Claude Code.
|
|
5
|
+
Project-URL: Homepage, https://github.com/arthurkatcher/google-maps-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/arthurkatcher/google-maps-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/arthurkatcher/google-maps-mcp/issues
|
|
8
|
+
Author-email: Arthur Katcher <192321283+arthurkatcher@users.noreply.github.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,claude,cursor,geocoding,google-maps,mcp,model-context-protocol,places
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: mcp>=1.0.0
|
|
23
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
24
|
+
Requires-Dist: starlette>=0.37.0
|
|
25
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Google Maps MCP Server
|
|
29
|
+
|
|
30
|
+
[](https://pypi.org/project/gmaps-mcp/)
|
|
31
|
+
[](https://www.python.org/downloads/)
|
|
32
|
+
[](https://opensource.org/licenses/MIT)
|
|
33
|
+
|
|
34
|
+
A production-ready [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI agents **real Google Maps capabilities** — place search, directions, geocoding, and more. Works with Claude Desktop, Cursor, Claude Code, and any other MCP-compatible client. Supports both **stdio** (local) and **streamable HTTP** (remote) transports.
|
|
35
|
+
|
|
36
|
+
## What it does
|
|
37
|
+
|
|
38
|
+
Six tools, all hitting the real Google Maps APIs:
|
|
39
|
+
|
|
40
|
+
| Tool | What it does |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `search_places` | Text search for places — "best ramen in Tokyo", "24h pharmacy near me" |
|
|
43
|
+
| `get_place_details` | Reviews, amenities, hours, phone, website, price level |
|
|
44
|
+
| `search_nearby` | Find places within a radius of specific coordinates, filter by type |
|
|
45
|
+
| `get_directions` | Step-by-step routes (driving, walking, bicycling, transit) |
|
|
46
|
+
| `geocode` | Address or landmark → GPS coordinates |
|
|
47
|
+
| `reverse_geocode` | GPS coordinates → human-readable address |
|
|
48
|
+
|
|
49
|
+
## Quick install — Claude Desktop
|
|
50
|
+
|
|
51
|
+
Add to your `claude_desktop_config.json` (Settings → Developer → Edit Config):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"google-maps": {
|
|
57
|
+
"command": "uvx",
|
|
58
|
+
"args": ["gmaps-mcp"],
|
|
59
|
+
"env": {
|
|
60
|
+
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key_here"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Restart Claude Desktop. That's it — no cloning, no venv, no Docker. `uvx` fetches the package from PyPI on first run and caches it.
|
|
68
|
+
|
|
69
|
+
## Quick install — Cursor
|
|
70
|
+
|
|
71
|
+
Add to `~/.cursor/mcp.json`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"google-maps": {
|
|
77
|
+
"command": "uvx",
|
|
78
|
+
"args": ["gmaps-mcp"],
|
|
79
|
+
"env": {
|
|
80
|
+
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key_here"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Restart Cursor.
|
|
88
|
+
|
|
89
|
+
## Quick install — Claude Code CLI
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add google-maps \
|
|
93
|
+
-e GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here \
|
|
94
|
+
-- uvx gmaps-mcp
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Get a Google Maps API key
|
|
98
|
+
|
|
99
|
+
1. Go to [Google Cloud Console](https://console.cloud.google.com/) and create (or pick) a project.
|
|
100
|
+
2. **Enable billing** on the project — yes, it's required even for the free tier. Google gives **$200/month in free Maps credit**, which is far more than most solo-use ever consumes.
|
|
101
|
+
3. Enable these APIs in **APIs & Services → Library**:
|
|
102
|
+
- **Places API (New)** — for `search_places`, `get_place_details`, `search_nearby`
|
|
103
|
+
- **Directions API** — for `get_directions`
|
|
104
|
+
- **Geocoding API** — for `geocode`, `reverse_geocode`
|
|
105
|
+
4. Go to **APIs & Services → Credentials → + CREATE CREDENTIALS → API key**.
|
|
106
|
+
5. (Recommended) Restrict the key to just those four APIs.
|
|
107
|
+
6. Paste the key into your MCP config above.
|
|
108
|
+
|
|
109
|
+
## Try it
|
|
110
|
+
|
|
111
|
+
Once installed, in Claude Desktop / Cursor / Claude Code, ask things like:
|
|
112
|
+
|
|
113
|
+
- "Find specialty coffee shops near me in San Francisco"
|
|
114
|
+
- "How long does it take to walk from Union Square to the Ferry Building?"
|
|
115
|
+
- "What are the coordinates of the Eiffel Tower?"
|
|
116
|
+
- "What's the address at 37.8199, -122.4783?"
|
|
117
|
+
- "Show me the reviews for the top-rated ramen place in Shibuya"
|
|
118
|
+
|
|
119
|
+
The model picks the right tool automatically — you don't need to name it.
|
|
120
|
+
|
|
121
|
+
## Remote HTTP server mode
|
|
122
|
+
|
|
123
|
+
For deployment, shared usage, or A2A (agent-to-agent) scenarios, the same package also runs as a streamable HTTP server:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/arthurkatcher/google-maps-mcp
|
|
127
|
+
cd google-maps-mcp
|
|
128
|
+
uv sync
|
|
129
|
+
cp .env.example .env # edit with your API key
|
|
130
|
+
python run.py
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Server listens on `http://0.0.0.0:8000` with the MCP endpoint at `/mcp/` and a health check at `/health`. Set `MCP_API_KEY` in `.env` to require `X-API-Key` header authentication; leave it unset for dev mode.
|
|
134
|
+
|
|
135
|
+
To expose publicly:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
ngrok http 8000
|
|
139
|
+
# then point clients at https://your-ngrok-url.ngrok-free.dev/mcp/
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Tool reference
|
|
143
|
+
|
|
144
|
+
### `search_places`
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
search_places(
|
|
148
|
+
query: str, # "coffee in San Francisco"
|
|
149
|
+
max_results: int = 10 # 1-20
|
|
150
|
+
)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Returns: `query`, `total_results`, `places` (list with `name`, `address`, `phone`, `website`, `rating`, `reviews_count`, `types`, `latitude`, `longitude`, `is_open_now`, `opening_hours`, `google_maps_url`, `price_level`, `business_status`).
|
|
154
|
+
|
|
155
|
+
### `get_place_details`
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
get_place_details(
|
|
159
|
+
place_id: str # Google Place ID from a prior search
|
|
160
|
+
)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Returns everything from `search_places` plus: top 5 `reviews`, amenities (`delivery`, `dine_in`, `takeout`, `outdoor_seating`, `live_music`, `reservable`), `editorial_summary`, `payment_options`.
|
|
164
|
+
|
|
165
|
+
### `search_nearby`
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
search_nearby(
|
|
169
|
+
latitude: float, # e.g. 37.7955
|
|
170
|
+
longitude: float, # e.g. -122.3937
|
|
171
|
+
radius_meters: int = 1000, # max 50000
|
|
172
|
+
place_type: str = None, # "restaurant", "cafe", "hotel", "gas_station", ...
|
|
173
|
+
max_results: int = 10
|
|
174
|
+
)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### `get_directions`
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
get_directions(
|
|
181
|
+
origin: str, # address, landmark, or "lat,lng"
|
|
182
|
+
destination: str, # same
|
|
183
|
+
mode: str = "driving" # "driving" | "walking" | "bicycling" | "transit"
|
|
184
|
+
)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Returns total distance and duration plus step-by-step instructions.
|
|
188
|
+
|
|
189
|
+
### `geocode` / `reverse_geocode`
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
geocode(address: str) # → lat/lng
|
|
193
|
+
reverse_geocode(latitude: float, longitude: float) # → formatted address
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Pricing
|
|
197
|
+
|
|
198
|
+
Google's Maps Platform offers a **$200/month free credit** that covers:
|
|
199
|
+
- ~11,000 Places API (New) requests, or
|
|
200
|
+
- ~40,000 Geocoding API requests, or
|
|
201
|
+
- ~40,000 Directions API requests.
|
|
202
|
+
|
|
203
|
+
For solo or small-team use, you will almost never hit the cap. Past the free tier, expect ~$17 per 1000 Places requests and ~$5 per 1000 Geocoding/Directions requests. See [Google's pricing page](https://developers.google.com/maps/billing-and-pricing/pricing) for current rates.
|
|
204
|
+
|
|
205
|
+
## Development
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
git clone https://github.com/arthurkatcher/google-maps-mcp
|
|
209
|
+
cd google-maps-mcp
|
|
210
|
+
uv sync
|
|
211
|
+
cp .env.example .env # add your API key
|
|
212
|
+
|
|
213
|
+
# Run stdio mode (for local MCP clients)
|
|
214
|
+
uv run python -m google_maps_mcp
|
|
215
|
+
|
|
216
|
+
# Run HTTP mode (for remote access)
|
|
217
|
+
uv run python run.py
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Project structure
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
google-maps-mcp/
|
|
224
|
+
├── pyproject.toml
|
|
225
|
+
├── README.md
|
|
226
|
+
├── LICENSE
|
|
227
|
+
├── run.py # HTTP server entry point
|
|
228
|
+
└── src/google_maps_mcp/
|
|
229
|
+
├── __init__.py
|
|
230
|
+
├── __main__.py # stdio server entry point
|
|
231
|
+
├── client.py # Google Maps API client
|
|
232
|
+
├── tools.py # Tool wrappers
|
|
233
|
+
└── server.py # FastMCP server + HTTP middleware
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT — see [LICENSE](LICENSE).
|
|
239
|
+
|
|
240
|
+
## Credits
|
|
241
|
+
|
|
242
|
+
Built by [Arthur Katcher](https://github.com/arthurkatcher) as part of the MCP ecosystem. PRs welcome.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Google Maps MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/gmaps-mcp/)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
A production-ready [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI agents **real Google Maps capabilities** — place search, directions, geocoding, and more. Works with Claude Desktop, Cursor, Claude Code, and any other MCP-compatible client. Supports both **stdio** (local) and **streamable HTTP** (remote) transports.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
Six tools, all hitting the real Google Maps APIs:
|
|
12
|
+
|
|
13
|
+
| Tool | What it does |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `search_places` | Text search for places — "best ramen in Tokyo", "24h pharmacy near me" |
|
|
16
|
+
| `get_place_details` | Reviews, amenities, hours, phone, website, price level |
|
|
17
|
+
| `search_nearby` | Find places within a radius of specific coordinates, filter by type |
|
|
18
|
+
| `get_directions` | Step-by-step routes (driving, walking, bicycling, transit) |
|
|
19
|
+
| `geocode` | Address or landmark → GPS coordinates |
|
|
20
|
+
| `reverse_geocode` | GPS coordinates → human-readable address |
|
|
21
|
+
|
|
22
|
+
## Quick install — Claude Desktop
|
|
23
|
+
|
|
24
|
+
Add to your `claude_desktop_config.json` (Settings → Developer → Edit Config):
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"google-maps": {
|
|
30
|
+
"command": "uvx",
|
|
31
|
+
"args": ["gmaps-mcp"],
|
|
32
|
+
"env": {
|
|
33
|
+
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key_here"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Restart Claude Desktop. That's it — no cloning, no venv, no Docker. `uvx` fetches the package from PyPI on first run and caches it.
|
|
41
|
+
|
|
42
|
+
## Quick install — Cursor
|
|
43
|
+
|
|
44
|
+
Add to `~/.cursor/mcp.json`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"google-maps": {
|
|
50
|
+
"command": "uvx",
|
|
51
|
+
"args": ["gmaps-mcp"],
|
|
52
|
+
"env": {
|
|
53
|
+
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key_here"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Restart Cursor.
|
|
61
|
+
|
|
62
|
+
## Quick install — Claude Code CLI
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
claude mcp add google-maps \
|
|
66
|
+
-e GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here \
|
|
67
|
+
-- uvx gmaps-mcp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Get a Google Maps API key
|
|
71
|
+
|
|
72
|
+
1. Go to [Google Cloud Console](https://console.cloud.google.com/) and create (or pick) a project.
|
|
73
|
+
2. **Enable billing** on the project — yes, it's required even for the free tier. Google gives **$200/month in free Maps credit**, which is far more than most solo-use ever consumes.
|
|
74
|
+
3. Enable these APIs in **APIs & Services → Library**:
|
|
75
|
+
- **Places API (New)** — for `search_places`, `get_place_details`, `search_nearby`
|
|
76
|
+
- **Directions API** — for `get_directions`
|
|
77
|
+
- **Geocoding API** — for `geocode`, `reverse_geocode`
|
|
78
|
+
4. Go to **APIs & Services → Credentials → + CREATE CREDENTIALS → API key**.
|
|
79
|
+
5. (Recommended) Restrict the key to just those four APIs.
|
|
80
|
+
6. Paste the key into your MCP config above.
|
|
81
|
+
|
|
82
|
+
## Try it
|
|
83
|
+
|
|
84
|
+
Once installed, in Claude Desktop / Cursor / Claude Code, ask things like:
|
|
85
|
+
|
|
86
|
+
- "Find specialty coffee shops near me in San Francisco"
|
|
87
|
+
- "How long does it take to walk from Union Square to the Ferry Building?"
|
|
88
|
+
- "What are the coordinates of the Eiffel Tower?"
|
|
89
|
+
- "What's the address at 37.8199, -122.4783?"
|
|
90
|
+
- "Show me the reviews for the top-rated ramen place in Shibuya"
|
|
91
|
+
|
|
92
|
+
The model picks the right tool automatically — you don't need to name it.
|
|
93
|
+
|
|
94
|
+
## Remote HTTP server mode
|
|
95
|
+
|
|
96
|
+
For deployment, shared usage, or A2A (agent-to-agent) scenarios, the same package also runs as a streamable HTTP server:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/arthurkatcher/google-maps-mcp
|
|
100
|
+
cd google-maps-mcp
|
|
101
|
+
uv sync
|
|
102
|
+
cp .env.example .env # edit with your API key
|
|
103
|
+
python run.py
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Server listens on `http://0.0.0.0:8000` with the MCP endpoint at `/mcp/` and a health check at `/health`. Set `MCP_API_KEY` in `.env` to require `X-API-Key` header authentication; leave it unset for dev mode.
|
|
107
|
+
|
|
108
|
+
To expose publicly:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
ngrok http 8000
|
|
112
|
+
# then point clients at https://your-ngrok-url.ngrok-free.dev/mcp/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Tool reference
|
|
116
|
+
|
|
117
|
+
### `search_places`
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
search_places(
|
|
121
|
+
query: str, # "coffee in San Francisco"
|
|
122
|
+
max_results: int = 10 # 1-20
|
|
123
|
+
)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Returns: `query`, `total_results`, `places` (list with `name`, `address`, `phone`, `website`, `rating`, `reviews_count`, `types`, `latitude`, `longitude`, `is_open_now`, `opening_hours`, `google_maps_url`, `price_level`, `business_status`).
|
|
127
|
+
|
|
128
|
+
### `get_place_details`
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
get_place_details(
|
|
132
|
+
place_id: str # Google Place ID from a prior search
|
|
133
|
+
)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Returns everything from `search_places` plus: top 5 `reviews`, amenities (`delivery`, `dine_in`, `takeout`, `outdoor_seating`, `live_music`, `reservable`), `editorial_summary`, `payment_options`.
|
|
137
|
+
|
|
138
|
+
### `search_nearby`
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
search_nearby(
|
|
142
|
+
latitude: float, # e.g. 37.7955
|
|
143
|
+
longitude: float, # e.g. -122.3937
|
|
144
|
+
radius_meters: int = 1000, # max 50000
|
|
145
|
+
place_type: str = None, # "restaurant", "cafe", "hotel", "gas_station", ...
|
|
146
|
+
max_results: int = 10
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `get_directions`
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
get_directions(
|
|
154
|
+
origin: str, # address, landmark, or "lat,lng"
|
|
155
|
+
destination: str, # same
|
|
156
|
+
mode: str = "driving" # "driving" | "walking" | "bicycling" | "transit"
|
|
157
|
+
)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Returns total distance and duration plus step-by-step instructions.
|
|
161
|
+
|
|
162
|
+
### `geocode` / `reverse_geocode`
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
geocode(address: str) # → lat/lng
|
|
166
|
+
reverse_geocode(latitude: float, longitude: float) # → formatted address
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Pricing
|
|
170
|
+
|
|
171
|
+
Google's Maps Platform offers a **$200/month free credit** that covers:
|
|
172
|
+
- ~11,000 Places API (New) requests, or
|
|
173
|
+
- ~40,000 Geocoding API requests, or
|
|
174
|
+
- ~40,000 Directions API requests.
|
|
175
|
+
|
|
176
|
+
For solo or small-team use, you will almost never hit the cap. Past the free tier, expect ~$17 per 1000 Places requests and ~$5 per 1000 Geocoding/Directions requests. See [Google's pricing page](https://developers.google.com/maps/billing-and-pricing/pricing) for current rates.
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
git clone https://github.com/arthurkatcher/google-maps-mcp
|
|
182
|
+
cd google-maps-mcp
|
|
183
|
+
uv sync
|
|
184
|
+
cp .env.example .env # add your API key
|
|
185
|
+
|
|
186
|
+
# Run stdio mode (for local MCP clients)
|
|
187
|
+
uv run python -m google_maps_mcp
|
|
188
|
+
|
|
189
|
+
# Run HTTP mode (for remote access)
|
|
190
|
+
uv run python run.py
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Project structure
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
google-maps-mcp/
|
|
197
|
+
├── pyproject.toml
|
|
198
|
+
├── README.md
|
|
199
|
+
├── LICENSE
|
|
200
|
+
├── run.py # HTTP server entry point
|
|
201
|
+
└── src/google_maps_mcp/
|
|
202
|
+
├── __init__.py
|
|
203
|
+
├── __main__.py # stdio server entry point
|
|
204
|
+
├── client.py # Google Maps API client
|
|
205
|
+
├── tools.py # Tool wrappers
|
|
206
|
+
└── server.py # FastMCP server + HTTP middleware
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT — see [LICENSE](LICENSE).
|
|
212
|
+
|
|
213
|
+
## Credits
|
|
214
|
+
|
|
215
|
+
Built by [Arthur Katcher](https://github.com/arthurkatcher) as part of the MCP ecosystem. PRs welcome.
|