@shyzus/mcp-geocrafter 1.2.3 β 1.4.0
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 +49 -33
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# πΊοΈ GeoCrafter - Geocoding Server for ChatGPT
|
|
2
2
|
|
|
3
|
-
GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding - Powered by
|
|
3
|
+
GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding - Powered by Photon API (OpenStreetMap + Elasticsearch) with fuzzy matching support.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/Shyzkanza/mcp-location/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/Shyzkanza/mcp-location/actions/workflows/release.yml)
|
|
6
7
|
[](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
|
|
7
8
|
[](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
|
|
8
9
|
[](https://geocrafter.rankorr.red/health)
|
|
9
10
|

|
|
10
11
|

|
|
11
12
|

|
|
12
|
-

|
|
13
14
|
|
|
14
15
|
---
|
|
15
16
|
|
|
@@ -17,12 +18,12 @@ GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding -
|
|
|
17
18
|
|
|
18
19
|
**This project is independent and unofficial.**
|
|
19
20
|
|
|
20
|
-
- β **Not affiliated** with OpenStreetMap or
|
|
21
|
+
- β **Not affiliated** with OpenStreetMap, Photon or Komoot
|
|
21
22
|
- β **Not sponsored** by these organizations
|
|
22
|
-
- β
Uses **public data** from the [
|
|
23
|
+
- β
Uses **public data** from the [Photon API](https://photon.komoot.io/) (OpenStreetMap)
|
|
23
24
|
- β
Educational and practical purpose project
|
|
24
25
|
|
|
25
|
-
Geocoding data comes from the
|
|
26
|
+
Geocoding data comes from the Photon API (by Komoot), which uses OpenStreetMap data with Elasticsearch-powered fuzzy matching.
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
@@ -32,31 +33,35 @@ This application allows **ChatGPT** and other MCP clients to access geocoding se
|
|
|
32
33
|
|
|
33
34
|
### β¨ Features
|
|
34
35
|
|
|
35
|
-
- π **Address to GPS** - Convert addresses to coordinates
|
|
36
|
+
- π **Address to GPS** - Convert addresses to coordinates (fuzzy matching)
|
|
36
37
|
- π **GPS to Address** - Convert coordinates to addresses
|
|
38
|
+
- π **Geohash Encoding/Decoding** - Convert coordinates to geohash strings for location deduplication
|
|
39
|
+
- π **Distance Calculation** - Haversine formula to compute exact distance between two GPS points
|
|
37
40
|
- ποΈ **Modular Architecture** - Clean separation of concerns, reusable for future MCP servers
|
|
38
41
|
- π **Dual Mode** - Works with ChatGPT (HTTP) and IDEs (stdio)
|
|
39
42
|
- πΊοΈ **GeoJSON Map Viewer** - Render interactive maps inside ChatGPT with fullscreen controls (Apps SDK)
|
|
40
43
|
|
|
41
|
-
### π¬ Usage
|
|
44
|
+
### π¬ Usage examples
|
|
42
45
|
|
|
43
|
-
In ChatGPT, simply ask:
|
|
46
|
+
In ChatGPT or your IDE, simply ask:
|
|
44
47
|
|
|
45
48
|
> "What are the coordinates of the Eiffel Tower?"
|
|
46
49
|
|
|
47
|
-
Or:
|
|
48
|
-
|
|
49
50
|
> "What is the address at coordinates 48.8566, 2.3522?"
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
> "Encode the Eiffel Tower coordinates as a geohash"
|
|
53
|
+
|
|
54
|
+
> "What's the distance between Paris and Marseille?"
|
|
55
|
+
|
|
56
|
+
The LLM will use the MCP server to get the information.
|
|
52
57
|
|
|
53
58
|
---
|
|
54
59
|
|
|
55
|
-
## ποΈ Architecture:
|
|
60
|
+
## ποΈ Architecture: MCP Server
|
|
56
61
|
|
|
57
|
-
### What is
|
|
62
|
+
### What is an MCP Server?
|
|
58
63
|
|
|
59
|
-
**
|
|
64
|
+
**MCP (Model Context Protocol)** servers allow you to extend ChatGPT and other LLMs with:
|
|
60
65
|
- **Custom tools** (call external APIs)
|
|
61
66
|
- **Real-time data** (up-to-date information)
|
|
62
67
|
|
|
@@ -64,13 +69,13 @@ ChatGPT will use the MCP server to get the information.
|
|
|
64
69
|
|
|
65
70
|
```
|
|
66
71
|
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
|
|
67
|
-
β ChatGPT β βββββββΊ β MCP Server β βββββββΊ β
|
|
68
|
-
β β HTTP β (Node.js) β HTTP β
|
|
72
|
+
β ChatGPT β βββββββΊ β MCP Server β βββββββΊ β Photon β
|
|
73
|
+
β β HTTP β (Node.js) β HTTP β API β
|
|
69
74
|
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
|
|
70
75
|
```
|
|
71
76
|
|
|
72
77
|
1. **ChatGPT** calls your MCP server via the [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
73
|
-
2. **The MCP server** fetches data from the
|
|
78
|
+
2. **The MCP server** fetches data from the Photon API (OpenStreetMap + Elasticsearch)
|
|
74
79
|
3. **The results** are returned to ChatGPT
|
|
75
80
|
|
|
76
81
|
### MCP Protocol
|
|
@@ -171,10 +176,13 @@ npm test
|
|
|
171
176
|
npm run test:watch
|
|
172
177
|
```
|
|
173
178
|
|
|
174
|
-
|
|
179
|
+
90 tests across 6 suites:
|
|
175
180
|
- `errors.test.ts` β Error classes, formatting, network detection (17 tests)
|
|
176
181
|
- `config.test.ts` β Environment variables, validation, singleton (20 tests)
|
|
177
182
|
- `displayGeoJsonMap.test.ts` β GeoJSON parsing, viewport, colors, output (26 tests)
|
|
183
|
+
- `geohash.test.ts` β Geohash encode/decode, roundtrip, precision (12 tests)
|
|
184
|
+
- `haversine.test.ts` β Haversine distance formula, edge cases, symmetry (8 tests)
|
|
185
|
+
- `calculateDistance.test.ts` β Distance tool validation, output format (7 tests)
|
|
178
186
|
|
|
179
187
|
---
|
|
180
188
|
|
|
@@ -353,13 +361,17 @@ mcp-location/
|
|
|
353
361
|
β βββ __tests__/
|
|
354
362
|
β β βββ config.test.ts # Tests config
|
|
355
363
|
β βββ client/
|
|
356
|
-
β β βββ
|
|
364
|
+
β β βββ photonClient.ts # Client API Photon (fuzzy matching)
|
|
357
365
|
β βββ tools/
|
|
358
366
|
β β βββ searchAddress.ts # Tool: adresse β GPS
|
|
359
367
|
β β βββ reverseGeocode.ts # Tool: GPS β adresse
|
|
368
|
+
β β βββ encodeGeohash.ts # Tool: GPS β geohash
|
|
369
|
+
β β βββ decodeGeohash.ts # Tool: geohash β GPS
|
|
370
|
+
β β βββ calculateDistance.ts # Tool: distance entre 2 points
|
|
360
371
|
β β βββ displayGeoJsonMap.ts # Tool: GeoJSON β widget UI
|
|
361
372
|
β β βββ __tests__/
|
|
362
|
-
β β
|
|
373
|
+
β β βββ displayGeoJsonMap.test.ts
|
|
374
|
+
β β βββ calculateDistance.test.ts
|
|
363
375
|
β βββ resources/
|
|
364
376
|
β β βββ mapViewerTemplate.ts # Template HTML pour ChatGPT
|
|
365
377
|
β βββ servers/
|
|
@@ -367,8 +379,12 @@ mcp-location/
|
|
|
367
379
|
β β βββ http.ts # Serveur Streamable HTTP (ChatGPT)
|
|
368
380
|
β βββ utils/
|
|
369
381
|
β β βββ errors.ts # Gestion erreurs centralisΓ©e
|
|
382
|
+
β β βββ geohash.ts # Encode/decode geohash (zero deps)
|
|
383
|
+
β β βββ haversine.ts # Distance Haversine (zero deps)
|
|
370
384
|
β β βββ __tests__/
|
|
371
|
-
β β
|
|
385
|
+
β β βββ errors.test.ts
|
|
386
|
+
β β βββ geohash.test.ts
|
|
387
|
+
β β βββ haversine.test.ts
|
|
372
388
|
β βββ index.ts # Entry point stdio
|
|
373
389
|
β βββ http-server.ts # Entry point HTTP
|
|
374
390
|
β βββ http-client.ts # Client npm
|
|
@@ -435,16 +451,16 @@ Create a `.env` file:
|
|
|
435
451
|
```bash
|
|
436
452
|
PORT=3000 # HTTP server port
|
|
437
453
|
NODE_ENV=production # Environment
|
|
438
|
-
|
|
439
|
-
|
|
454
|
+
PHOTON_BASE_URL=https://photon.komoot.io # Optional (default: Komoot's public instance)
|
|
455
|
+
USER_AGENT=MyApp/1.0 # Optional
|
|
440
456
|
CORS_ORIGIN=* # CORS origin (default: * in dev, https://chatgpt.com in prod)
|
|
441
457
|
```
|
|
442
458
|
|
|
443
|
-
### Customize the
|
|
459
|
+
### Customize the Photon API
|
|
444
460
|
|
|
445
|
-
The
|
|
446
|
-
1. Use a
|
|
447
|
-
2. Set a custom User-Agent (
|
|
461
|
+
The Photon API is public but you can:
|
|
462
|
+
1. Use a self-hosted Photon instance (set `PHOTON_BASE_URL`)
|
|
463
|
+
2. Set a custom User-Agent (set `USER_AGENT`)
|
|
448
464
|
|
|
449
465
|
---
|
|
450
466
|
|
|
@@ -456,10 +472,10 @@ This project serves as a **template/base** for future MCP servers with a clean,
|
|
|
456
472
|
|
|
457
473
|
- **`config.ts`**: Environment variables, constants, validation
|
|
458
474
|
- **`types.ts`**: Shared TypeScript interfaces
|
|
459
|
-
- **`client/`**: External API abstraction (
|
|
475
|
+
- **`client/`**: External API abstraction (Photon)
|
|
460
476
|
- **`tools/`**: Business logic (validation, transformation, formatting)
|
|
461
477
|
- **`servers/`**: MCP implementation (stdio/Streamable HTTP), reuses tools
|
|
462
|
-
- **`utils
|
|
478
|
+
- **`utils/`**: Custom error classes, geohash encode/decode, Haversine distance (zero dependencies)
|
|
463
479
|
|
|
464
480
|
See [CONTEXT.md](CONTEXT.md) for detailed architecture documentation.
|
|
465
481
|
|
|
@@ -479,7 +495,7 @@ See [CONTEXT.md](CONTEXT.md) for detailed architecture documentation.
|
|
|
479
495
|
- [Apps SDK - MCP Server](https://developers.openai.com/apps-sdk/build/mcp-server) - Server config
|
|
480
496
|
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP spec
|
|
481
497
|
- [MCP SDK TypeScript](https://github.com/modelcontextprotocol/typescript-sdk) - Node.js SDK
|
|
482
|
-
- [
|
|
498
|
+
- [Photon API](https://photon.komoot.io/) - Geocoding API (OpenStreetMap + Elasticsearch)
|
|
483
499
|
|
|
484
500
|
### Community
|
|
485
501
|
|
|
@@ -535,7 +551,7 @@ This project is a **complete template** for creating your own ChatGPT apps with
|
|
|
535
551
|
### To create your own app:
|
|
536
552
|
|
|
537
553
|
1. **Duplicate this project**
|
|
538
|
-
2. **Replace the
|
|
554
|
+
2. **Replace the Photon API** with your API
|
|
539
555
|
3. **Modify the tools** in `src/tools/`
|
|
540
556
|
4. **Customize the configuration** in `src/config.ts`
|
|
541
557
|
5. **Deploy**!
|
|
@@ -562,13 +578,13 @@ MIT - Use freely for your personal or commercial projects.
|
|
|
562
578
|
|
|
563
579
|
## π Credits & Attributions
|
|
564
580
|
|
|
565
|
-
- **Geocoding Data** - [
|
|
581
|
+
- **Geocoding Data** - [Photon API](https://photon.komoot.io/) by [Komoot](https://www.komoot.com/) - OpenStreetMap data
|
|
566
582
|
- **MCP Protocol** - [Anthropic](https://www.anthropic.com/)
|
|
567
583
|
- **Apps SDK** - [OpenAI](https://openai.com/)
|
|
568
584
|
|
|
569
585
|
### Data & Licenses
|
|
570
586
|
|
|
571
|
-
Geocoding data comes from the
|
|
587
|
+
Geocoding data comes from the Photon API (by Komoot) which uses OpenStreetMap data. This data is provided under the Open Database License (ODbL).
|
|
572
588
|
|
|
573
589
|
---
|
|
574
590
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shyzus/mcp-geocrafter",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "GeoCrafter - MCP server for geocoding
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "GeoCrafter - MCP server for geocoding, reverse geocoding, geohash and distance calculation - Powered by Photon API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"keywords": [
|
|
15
15
|
"mcp",
|
|
16
16
|
"geocoding",
|
|
17
|
-
"
|
|
17
|
+
"photon",
|
|
18
|
+
"geohash",
|
|
19
|
+
"distance",
|
|
20
|
+
"haversine",
|
|
18
21
|
"location",
|
|
19
22
|
"address",
|
|
20
23
|
"gps",
|