@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.
Files changed (2) hide show
  1. package/README.md +49 -33
  2. 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 Nominatim API (OpenStreetMap).
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
  [![CI](https://github.com/Shyzkanza/mcp-location/actions/workflows/ci.yml/badge.svg)](https://github.com/Shyzkanza/mcp-location/actions/workflows/ci.yml)
6
+ [![Release](https://github.com/Shyzkanza/mcp-location/actions/workflows/release.yml/badge.svg)](https://github.com/Shyzkanza/mcp-location/actions/workflows/release.yml)
6
7
  [![npm version](https://img.shields.io/npm/v/@shyzus/mcp-geocrafter)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
7
8
  [![npm downloads](https://img.shields.io/npm/dm/@shyzus/mcp-geocrafter?cacheSeconds=3600)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
8
9
  [![Website Status](https://img.shields.io/website?url=https%3A%2F%2Fgeocrafter.rankorr.red%2Fhealth&label=API)](https://geocrafter.rankorr.red/health)
9
10
  ![Node](https://img.shields.io/badge/node-20%2B-green)
10
11
  ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)
11
12
  ![MCP](https://img.shields.io/badge/MCP-2025--11--25-orange)
12
- ![ChatGPT](https://img.shields.io/badge/ChatGPT-Apps%20SDK-purple)
13
+ ![ChatGPT](https://img.shields.io/badge/ChatGPT-MCP-purple)
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 Nominatim
21
+ - ❌ **Not affiliated** with OpenStreetMap, Photon or Komoot
21
22
  - ❌ **Not sponsored** by these organizations
22
- - βœ… Uses **public data** from the [Nominatim API](https://nominatim.openstreetmap.org/)
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 Nominatim API, which uses OpenStreetMap data.
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 example
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
- ChatGPT will use the MCP server to get the information.
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: ChatGPT MCP App
60
+ ## πŸ—οΈ Architecture: MCP Server
56
61
 
57
- ### What is a ChatGPT App?
62
+ ### What is an MCP Server?
58
63
 
59
- **ChatGPT Apps** (via [Apps SDK](https://developers.openai.com/apps-sdk)) allow you to extend ChatGPT with:
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 β”‚ ◄─────► β”‚ Nominatim β”‚
68
- β”‚ β”‚ HTTP β”‚ (Node.js) β”‚ HTTP β”‚ API β”‚
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 Nominatim API
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
- 63 tests across 3 suites:
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
- β”‚ β”‚ └── nominatimClient.ts # Client API Nominatim
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
- β”‚ β”‚ └── displayGeoJsonMap.test.ts
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
- β”‚ β”‚ └── errors.test.ts
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
- NOMINATIM_BASE_URL=https://nominatim.openstreetmap.org # Optional
439
- NOMINATIM_USER_AGENT=MyApp/1.0 # Optional (recommended by Nominatim)
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 Nominatim API
459
+ ### Customize the Photon API
444
460
 
445
- The Nominatim API is public but you can:
446
- 1. Use a custom instance (set `NOMINATIM_BASE_URL`)
447
- 2. Set a custom User-Agent (recommended, set `NOMINATIM_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 (Nominatim)
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/errors.ts`**: Custom error classes, formatting
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
- - [Nominatim API](https://nominatim.org/release-docs/develop/api/Overview/) - Geocoding API docs
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 Nominatim API** with your API
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** - [Nominatim API](https://nominatim.openstreetmap.org/) - OpenStreetMap 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 Nominatim API which uses OpenStreetMap data. This data is provided under the Open Database License (ODbL).
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.2.3",
4
- "description": "GeoCrafter - MCP server for geocoding and reverse geocoding - Powered by Nominatim API",
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
- "nominatim",
17
+ "photon",
18
+ "geohash",
19
+ "distance",
20
+ "haversine",
18
21
  "location",
19
22
  "address",
20
23
  "gps",