@shyzus/mcp-geocrafter 1.4.1 β 1.5.1
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.
- package/README.md +90 -24
- package/dist/http-client.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# πΊοΈ GeoCrafter - Geocoding Server
|
|
1
|
+
# πΊοΈ GeoCrafter - Multi-Provider Geocoding MCP Server
|
|
2
2
|
|
|
3
|
-
GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding -
|
|
3
|
+
GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding with **multi-provider support** β Google Geocoding API and Photon API (OpenStreetMap). The LLM intelligently picks the best provider per query, or the user can force one.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/Shyzkanza/mcp-location/actions/workflows/ci.yml)
|
|
6
6
|
[](https://github.com/Shyzkanza/mcp-location/actions/workflows/release.yml)
|
|
@@ -11,6 +11,8 @@ GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding -
|
|
|
11
11
|

|
|
12
12
|

|
|
13
13
|

|
|
14
|
+

|
|
15
|
+

|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
@@ -18,13 +20,12 @@ GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding -
|
|
|
18
20
|
|
|
19
21
|
**This project is independent and unofficial.**
|
|
20
22
|
|
|
21
|
-
- β **Not affiliated** with OpenStreetMap, Photon or Komoot
|
|
23
|
+
- β **Not affiliated** with Google, OpenStreetMap, Photon or Komoot
|
|
22
24
|
- β **Not sponsored** by these organizations
|
|
25
|
+
- β
Uses [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding) (10k free requests/month)
|
|
23
26
|
- β
Uses **public data** from the [Photon API](https://photon.komoot.io/) (OpenStreetMap)
|
|
24
27
|
- β
Educational and practical purpose project
|
|
25
28
|
|
|
26
|
-
Geocoding data comes from the Photon API (by Komoot), which uses OpenStreetMap data with Elasticsearch-powered fuzzy matching.
|
|
27
|
-
|
|
28
29
|
---
|
|
29
30
|
|
|
30
31
|
## π― What is it?
|
|
@@ -33,14 +34,24 @@ This application allows **ChatGPT** and other MCP clients to access geocoding se
|
|
|
33
34
|
|
|
34
35
|
### β¨ Features
|
|
35
36
|
|
|
36
|
-
- π **Address to GPS** - Convert addresses to coordinates
|
|
37
|
+
- π **Address to GPS** - Convert addresses to coordinates with multi-provider support
|
|
37
38
|
- π **GPS to Address** - Convert coordinates to addresses
|
|
39
|
+
- π **Multi-Provider** - Google Geocoding API + Photon API (OpenStreetMap), selectable per request
|
|
38
40
|
- π **Geohash Encoding/Decoding** - Convert coordinates to geohash strings for location deduplication
|
|
39
41
|
- π **Distance Calculation** - Haversine formula to compute exact distance between two GPS points
|
|
40
42
|
- ποΈ **Modular Architecture** - Clean separation of concerns, reusable for future MCP servers
|
|
41
43
|
- π **Dual Mode** - Works with ChatGPT (HTTP) and IDEs (stdio)
|
|
42
44
|
- πΊοΈ **GeoJSON Map Viewer** - Render interactive maps inside ChatGPT with fullscreen controls (Apps SDK)
|
|
43
45
|
|
|
46
|
+
### π Providers
|
|
47
|
+
|
|
48
|
+
| Provider | Best for | Limitations |
|
|
49
|
+
|----------|----------|-------------|
|
|
50
|
+
| **Google** (recommended) | POIs, businesses, intent-based queries ("gare ales france") | Requires API key, 10k free/month |
|
|
51
|
+
| **Photon** | Typo-tolerant search on place/street names, no API key needed | Less accurate on POI resolution |
|
|
52
|
+
|
|
53
|
+
The LLM automatically picks the best provider based on query type, or the user can force one (e.g. "use Google", "use Photon").
|
|
54
|
+
|
|
44
55
|
### π¬ Usage examples
|
|
45
56
|
|
|
46
57
|
In ChatGPT or your IDE, simply ask:
|
|
@@ -68,15 +79,19 @@ The LLM will use the MCP server to get the information.
|
|
|
68
79
|
### How does it work?
|
|
69
80
|
|
|
70
81
|
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
β
|
|
74
|
-
|
|
82
|
+
ββββββββββββββββ
|
|
83
|
+
ββββββΊ β Google β
|
|
84
|
+
βββββββββββββββ ββββββββββββββββ β β Geocoding β
|
|
85
|
+
β ChatGPT β βββββββΊ β MCP Server β βββ€ ββββββββββββββββ
|
|
86
|
+
β / IDE β MCP β (Node.js) β β ββββββββββββββββ
|
|
87
|
+
βββββββββββββββ ββββββββββββββββ ββββββΊ β Photon β
|
|
88
|
+
β API (OSM) β
|
|
89
|
+
ββββββββββββββββ
|
|
75
90
|
```
|
|
76
91
|
|
|
77
|
-
1. **ChatGPT** calls your MCP server via the [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
78
|
-
2. **The MCP server**
|
|
79
|
-
3. **The results** are returned
|
|
92
|
+
1. **ChatGPT/IDE** calls your MCP server via the [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
93
|
+
2. **The MCP server** routes the request to the selected geocoding provider (Google or Photon)
|
|
94
|
+
3. **The results** are returned in a unified format
|
|
80
95
|
|
|
81
96
|
### MCP Protocol
|
|
82
97
|
|
|
@@ -92,7 +107,7 @@ MCP (Model Context Protocol) is an open standard created by Anthropic that allow
|
|
|
92
107
|
|
|
93
108
|
### Use with Cursor / Claude Desktop / Warp
|
|
94
109
|
|
|
95
|
-
**The easiest way** - Install the npm client that connects to the remote server:
|
|
110
|
+
**The easiest way** - Install the npm client that connects to the remote server (Google + Photon providers are both available server-side):
|
|
96
111
|
|
|
97
112
|
```json
|
|
98
113
|
{
|
|
@@ -105,6 +120,8 @@ MCP (Model Context Protocol) is an open standard created by Anthropic that allow
|
|
|
105
120
|
}
|
|
106
121
|
```
|
|
107
122
|
|
|
123
|
+
> This connects to the hosted server at `https://geocrafter.rankorr.red/mcp` which has both Google and Photon providers configured. The LLM picks the best provider per query, or the user can force one.
|
|
124
|
+
|
|
108
125
|
**Config file locations:**
|
|
109
126
|
- **Cursor**: `~/.cursor/mcp.json` (macOS/Linux) or `%APPDATA%\Cursor\mcp.json` (Windows)
|
|
110
127
|
- **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
@@ -112,6 +129,26 @@ MCP (Model Context Protocol) is an open standard created by Anthropic that allow
|
|
|
112
129
|
|
|
113
130
|
---
|
|
114
131
|
|
|
132
|
+
### Google API Key Setup
|
|
133
|
+
|
|
134
|
+
To use the Google provider, you need a Google API key. There are **two ways** to provide it:
|
|
135
|
+
|
|
136
|
+
**Option A β Server-side (env var):** Set `GOOGLE_API_KEY` on the server. All clients benefit automatically.
|
|
137
|
+
|
|
138
|
+
**Option B β Per-request (tool parameter):** Pass `apiKey` in the tool call. Useful for N8N, automation workflows, or when you don't control the server. The key is never logged or returned in responses.
|
|
139
|
+
|
|
140
|
+
**To get a key:**
|
|
141
|
+
|
|
142
|
+
1. Go to [Google Cloud Console](https://console.cloud.google.com)
|
|
143
|
+
2. Create or select a project
|
|
144
|
+
3. **APIs & Services** β **Library** β search **"Geocoding API"** β **Enable**
|
|
145
|
+
4. **APIs & Services** β **Credentials** β **Create Credentials** β **API Key**
|
|
146
|
+
5. Copy the key
|
|
147
|
+
|
|
148
|
+
> **Pricing**: First 10,000 requests/month are **free**. Beyond that, ~4.34β¬/1k requests. [Details](https://developers.google.com/maps/documentation/geocoding/usage-and-billing)
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
115
152
|
### Use with ChatGPT
|
|
116
153
|
|
|
117
154
|
A production server is available and ready to use!
|
|
@@ -176,7 +213,8 @@ npm test
|
|
|
176
213
|
npm run test:watch
|
|
177
214
|
```
|
|
178
215
|
|
|
179
|
-
|
|
216
|
+
113 tests across 7 suites:
|
|
217
|
+
- `googleClient.test.ts` β Google Geocoding API client, mapping, error handling (23 tests)
|
|
180
218
|
- `errors.test.ts` β Error classes, formatting, network detection (17 tests)
|
|
181
219
|
- `config.test.ts` β Environment variables, validation, singleton (20 tests)
|
|
182
220
|
- `displayGeoJsonMap.test.ts` β GeoJSON parsing, viewport, colors, output (26 tests)
|
|
@@ -276,6 +314,19 @@ The MCP server already works in Cursor! Ask me a question about locations and I'
|
|
|
276
314
|
|
|
277
315
|
2. Configure in `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
278
316
|
|
|
317
|
+
**Option A β Use the remote server (recommended, no API key needed):**
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"mcpServers": {
|
|
321
|
+
"mcp-geocrafter": {
|
|
322
|
+
"command": "npx",
|
|
323
|
+
"args": ["-y", "@shyzus/mcp-geocrafter"]
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Option B β Run locally with your own Google API key:**
|
|
279
330
|
```json
|
|
280
331
|
{
|
|
281
332
|
"mcpServers": {
|
|
@@ -283,7 +334,11 @@ The MCP server already works in Cursor! Ask me a question about locations and I'
|
|
|
283
334
|
"command": "node",
|
|
284
335
|
"args": [
|
|
285
336
|
"/absolute/path/to/mcp-location/dist/index.js"
|
|
286
|
-
]
|
|
337
|
+
],
|
|
338
|
+
"env": {
|
|
339
|
+
"GOOGLE_API_KEY": "your-google-api-key",
|
|
340
|
+
"GEOCODING_PROVIDER": "google"
|
|
341
|
+
}
|
|
287
342
|
}
|
|
288
343
|
}
|
|
289
344
|
}
|
|
@@ -361,7 +416,12 @@ mcp-location/
|
|
|
361
416
|
β βββ __tests__/
|
|
362
417
|
β β βββ config.test.ts # Tests config
|
|
363
418
|
β βββ client/
|
|
364
|
-
β β
|
|
419
|
+
β β βββ types.ts # GeocodingProvider interface
|
|
420
|
+
β β βββ index.ts # Provider factory/registry
|
|
421
|
+
β β βββ googleClient.ts # Google Geocoding API client
|
|
422
|
+
β β βββ photonClient.ts # Photon API client (OSM fuzzy matching)
|
|
423
|
+
β β βββ __tests__/
|
|
424
|
+
β β βββ googleClient.test.ts
|
|
365
425
|
β βββ tools/
|
|
366
426
|
β β βββ searchAddress.ts # Tool: adresse β GPS
|
|
367
427
|
β β βββ reverseGeocode.ts # Tool: GPS β adresse
|
|
@@ -451,16 +511,21 @@ Create a `.env` file:
|
|
|
451
511
|
```bash
|
|
452
512
|
PORT=3000 # HTTP server port
|
|
453
513
|
NODE_ENV=production # Environment
|
|
514
|
+
GEOCODING_PROVIDER=google # Default provider: "photon" (default) or "google"
|
|
515
|
+
GOOGLE_API_KEY=AIzaSy... # Required for Google provider (10k free requests/month)
|
|
454
516
|
PHOTON_BASE_URL=https://photon.komoot.io # Optional (default: Komoot's public instance)
|
|
455
517
|
USER_AGENT=MyApp/1.0 # Optional
|
|
456
518
|
CORS_ORIGIN=* # CORS origin (default: * in dev, https://chatgpt.com in prod)
|
|
457
519
|
```
|
|
458
520
|
|
|
459
|
-
###
|
|
521
|
+
### Providers configuration
|
|
460
522
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
523
|
+
- **Google**: Two options to provide the API key:
|
|
524
|
+
- **Server-side**: Set `GOOGLE_API_KEY` environment variable β all clients benefit automatically
|
|
525
|
+
- **Per-request**: Pass `apiKey` parameter in the tool call β for N8N, automations, or when you don't control the server
|
|
526
|
+
- **Photon**: Always available, no configuration needed. You can optionally self-host (set `PHOTON_BASE_URL`).
|
|
527
|
+
- The `provider` parameter on `search_address` and `reverse_geocode` tools lets the LLM override the default per request.
|
|
528
|
+
- The `apiKey` parameter is never logged, never stored, never returned in responses.
|
|
464
529
|
|
|
465
530
|
---
|
|
466
531
|
|
|
@@ -472,7 +537,7 @@ This project serves as a **template/base** for future MCP servers with a clean,
|
|
|
472
537
|
|
|
473
538
|
- **`config.ts`**: Environment variables, constants, validation
|
|
474
539
|
- **`types.ts`**: Shared TypeScript interfaces
|
|
475
|
-
- **`client/`**: External API abstraction (Photon)
|
|
540
|
+
- **`client/`**: External API abstraction (Google, Photon) with provider interface + factory
|
|
476
541
|
- **`tools/`**: Business logic (validation, transformation, formatting)
|
|
477
542
|
- **`servers/`**: MCP implementation (stdio/Streamable HTTP), reuses tools
|
|
478
543
|
- **`utils/`**: Custom error classes, geohash encode/decode, Haversine distance (zero dependencies)
|
|
@@ -578,13 +643,14 @@ MIT - Use freely for your personal or commercial projects.
|
|
|
578
643
|
|
|
579
644
|
## π Credits & Attributions
|
|
580
645
|
|
|
581
|
-
- **Geocoding Data** - [Photon API](https://photon.komoot.io/) by [Komoot](https://www.komoot.com/)
|
|
646
|
+
- **Geocoding Data** - [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding) and [Photon API](https://photon.komoot.io/) by [Komoot](https://www.komoot.com/) (OpenStreetMap data)
|
|
582
647
|
- **MCP Protocol** - [Anthropic](https://www.anthropic.com/)
|
|
583
648
|
- **Apps SDK** - [OpenAI](https://openai.com/)
|
|
584
649
|
|
|
585
650
|
### Data & Licenses
|
|
586
651
|
|
|
587
|
-
|
|
652
|
+
- Google Geocoding data is provided under [Google Maps Platform Terms of Service](https://cloud.google.com/maps-platform/terms)
|
|
653
|
+
- Photon/OpenStreetMap data is provided under the Open Database License (ODbL)
|
|
588
654
|
|
|
589
655
|
---
|
|
590
656
|
|
package/dist/http-client.js
CHANGED
|
@@ -6,7 +6,7 @@ const SERVER_URL = process.argv[2] || 'https://geocrafter.rankorr.red/mcp';
|
|
|
6
6
|
// Proxy HTTP MCP server to stdio for Cursor
|
|
7
7
|
const server = new McpServer({
|
|
8
8
|
name: 'geocrafter-http-proxy',
|
|
9
|
-
version: '1.0
|
|
9
|
+
version: '1.5.0',
|
|
10
10
|
});
|
|
11
11
|
// Forward all requests to HTTP server
|
|
12
12
|
async function forwardRequest(method, params) {
|
package/package.json
CHANGED