@shyzus/mcp-geocrafter 1.0.5 β†’ 1.2.2

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 +66 -86
  2. package/package.json +19 -6
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding - Powered by Nominatim API (OpenStreetMap).
4
4
 
5
- [![Deploy Status](https://github.com/Shyzkanza/mcp-location/actions/workflows/deploy.yml/badge.svg)](https://github.com/Shyzkanza/mcp-location/actions/workflows/deploy.yml)
6
- [![npm version](https://img.shields.io/badge/npm-v1.0.5-blue)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
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
+ [![npm version](https://img.shields.io/npm/v/@shyzus/mcp-geocrafter)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/@shyzus/mcp-geocrafter?cacheSeconds=3600)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
8
8
  [![Website Status](https://img.shields.io/website?url=https%3A%2F%2Fgeocrafter.rankorr.red%2Fhealth&label=API)](https://geocrafter.rankorr.red/health)
9
- ![Node](https://img.shields.io/badge/node-18%2B-green)
9
+ ![Node](https://img.shields.io/badge/node-20%2B-green)
10
10
  ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)
11
- ![MCP](https://img.shields.io/badge/MCP-2025--06--18-orange)
11
+ ![MCP](https://img.shields.io/badge/MCP-2025--11--25-orange)
12
12
  ![ChatGPT](https://img.shields.io/badge/ChatGPT-Apps%20SDK-purple)
13
13
 
14
14
  ---
@@ -161,9 +161,24 @@ npx @modelcontextprotocol/inspector node dist/index.js
161
161
 
162
162
  ---
163
163
 
164
- ## πŸ“± Deployment and Development
164
+ ## πŸ§ͺ Tests
165
+
166
+ ```bash
167
+ # Run tests
168
+ npm test
165
169
 
166
- > **πŸ”’ CI/CD secrets configuration:** To automatically deploy to a VPS with GitHub Actions and Portainer, see [SECRETS.md](SECRETS.md) for GitHub secrets configuration.
170
+ # Watch mode
171
+ npm run test:watch
172
+ ```
173
+
174
+ 63 tests across 3 suites:
175
+ - `errors.test.ts` β€” Error classes, formatting, network detection (17 tests)
176
+ - `config.test.ts` β€” Environment variables, validation, singleton (20 tests)
177
+ - `displayGeoJsonMap.test.ts` β€” GeoJSON parsing, viewport, colors, output (26 tests)
178
+
179
+ ---
180
+
181
+ ## πŸ“± Deployment and Development
167
182
 
168
183
  > **πŸ’‘ To use the application in ChatGPT**, see the [πŸš€ Quick Start](#-quick-start) section above for complete instructions.
169
184
 
@@ -209,71 +224,28 @@ Follow the configuration instructions in the [πŸš€ Quick Start](#-quick-start) s
209
224
 
210
225
  > **Note**: If you just want to use the application, see the [πŸš€ Quick Start](#-quick-start) section which uses the production server already available.
211
226
 
212
- This project includes a GitHub Actions workflow that automatically deploys to a VPS with Docker and Portainer.
213
-
214
- #### **VPS Deployment with GitHub Actions**
215
-
216
- 1. **Configure GitHub secrets** according to [SECRETS.md](SECRETS.md)
217
- 2. **Push to the `main` branch**
218
- 3. GitHub Actions will automatically:
219
- - βœ… Test TypeScript code
220
- - βœ… Deploy to your VPS via Portainer
221
- - βœ… Publish to npm (if version not already published)
222
- - βœ… Check health status
227
+ #### **CI/CD Pipelines**
223
228
 
224
- #### **Version Management & Git Tags**
229
+ Two GitHub Actions workflows:
225
230
 
226
- **⚠️ IMPORTANT : Avant chaque publication npm, créer un tag Git !**
231
+ - **`ci.yml`** β€” Runs on push/PR to `main`: type check, tests, build
232
+ - **`release.yml`** β€” Runs on tag push (`*.*.*`): tests β†’ GHCR image β†’ Docker Swarm deploy β†’ health check β†’ npm publish
227
233
 
228
- **Format des tags** : `{MAJOR}.{MINOR}.{PATCH}` (sans prΓ©fixe "v")
229
- - Exemples : `1.0.0`, `1.0.1`, `1.1.0`, `2.0.0`
234
+ #### **Release Process**
230
235
 
231
- **Processus de release** :
232
-
233
- 1. **IncrΓ©menter la version** dans `package.json` :
234
- ```bash
235
- npm version patch # 1.0.0 β†’ 1.0.1
236
- npm version minor # 1.0.0 β†’ 1.1.0
237
- npm version major # 1.0.0 β†’ 2.0.0
238
- ```
239
-
240
- 2. **CrΓ©er le tag Git** correspondant :
241
- ```bash
242
- VERSION=$(node -p "require('./package.json').version")
243
- git tag -a "$VERSION" -m "Release $VERSION - {description}"
244
- ```
245
-
246
- 3. **Commit et push** (y compris les tags) :
247
- ```bash
248
- git add package.json
249
- git commit -m "chore: bump version to $VERSION"
250
- git push origin main
251
- git push origin --tags
252
- ```
253
-
254
- 4. **Le workflow GitHub Actions** publiera automatiquement sur npm si la version n'existe pas dΓ©jΓ .
255
-
256
- **Branches** :
257
- - **`main`** : Production (protΓ©gΓ©e, dΓ©ploiement automatique)
258
- - **`develop`** : DΓ©veloppement (branche de travail principale)
259
-
260
- Voir [CONTEXT.md](CONTEXT.md) pour plus de dΓ©tails sur le workflow de dΓ©veloppement.
261
-
262
- **Benefits**:
263
- - Automatic deployment on each push
264
- - Free SSL with Traefik + Let's Encrypt
265
- - Integrated health monitoring
266
- - Centralized logs
267
-
268
- #### **Other cloud platforms**
236
+ ```bash
237
+ # 1. Bump version
238
+ npm version patch # 1.0.5 β†’ 1.0.6
269
239
 
270
- You can also deploy on:
271
- - **Railway** - Automatic deployment from GitHub
272
- - **Render** - Managed service with free SSL
273
- - **Fly.io** - Edge computing with global deployment
274
- - **Google Cloud Run** - Serverless with automatic scaling
240
+ # 2. Push with tags
241
+ git push origin main --tags
242
+ ```
275
243
 
276
- See the [Apps SDK deployment guide](https://developers.openai.com/apps-sdk/deploy) for more details.
244
+ The tag push triggers `release.yml` which automatically:
245
+ - Builds & pushes the Docker image to GHCR
246
+ - Deploys to VPS via SSH + `docker stack deploy`
247
+ - Runs health check
248
+ - Publishes to npm (if version not already published)
277
249
 
278
250
  #### **Configure your server in ChatGPT**
279
251
 
@@ -376,31 +348,39 @@ Opens a web interface to test all tools.
376
348
  ```
377
349
  mcp-location/
378
350
  β”œβ”€β”€ src/
379
- β”‚ β”œβ”€β”€ config.ts # Configuration centralisΓ©e
380
- β”‚ β”œβ”€β”€ types.ts # Types TypeScript partagΓ©s
351
+ β”‚ β”œβ”€β”€ config.ts # Configuration centralisΓ©e
352
+ β”‚ β”œβ”€β”€ types.ts # Types TypeScript partagΓ©s
353
+ β”‚ β”œβ”€β”€ __tests__/
354
+ β”‚ β”‚ └── config.test.ts # Tests config
381
355
  β”‚ β”œβ”€β”€ client/
382
- β”‚ β”‚ └── nominatimClient.ts # Client API Nominatim
356
+ β”‚ β”‚ └── nominatimClient.ts # Client API Nominatim
383
357
  β”‚ β”œβ”€β”€ tools/
384
- β”‚ β”‚ β”œβ”€β”€ searchAddress.ts # Tool: adresse β†’ GPS
385
- β”‚ β”‚ β”œβ”€β”€ reverseGeocode.ts # Tool: GPS β†’ adresse
386
- β”‚ β”‚ └── displayGeoJsonMap.ts # Tool: GeoJSON β†’ widget UI
358
+ β”‚ β”‚ β”œβ”€β”€ searchAddress.ts # Tool: adresse β†’ GPS
359
+ β”‚ β”‚ β”œβ”€β”€ reverseGeocode.ts # Tool: GPS β†’ adresse
360
+ β”‚ β”‚ β”œβ”€β”€ displayGeoJsonMap.ts # Tool: GeoJSON β†’ widget UI
361
+ β”‚ β”‚ └── __tests__/
362
+ β”‚ β”‚ └── displayGeoJsonMap.test.ts
387
363
  β”‚ β”œβ”€β”€ resources/
388
- β”‚ β”‚ └── mapViewerTemplate.ts # Template HTML (text/html+skybridge) pour ChatGPT
364
+ β”‚ β”‚ └── mapViewerTemplate.ts # Template HTML pour ChatGPT
389
365
  β”‚ β”œβ”€β”€ servers/
390
- β”‚ β”‚ β”œβ”€β”€ stdio.ts # Serveur stdio (IDEs)
391
- β”‚ β”‚ └── http.ts # Serveur Streamable HTTP (ChatGPT)
366
+ β”‚ β”‚ β”œβ”€β”€ stdio.ts # Serveur stdio (IDEs)
367
+ β”‚ β”‚ └── http.ts # Serveur Streamable HTTP (ChatGPT)
392
368
  β”‚ β”œβ”€β”€ utils/
393
- β”‚ β”‚ └── errors.ts # Gestion erreurs centralisΓ©e
394
- β”‚ β”œβ”€β”€ index.ts # Entry point stdio
395
- β”‚ β”œβ”€β”€ http-server.ts # Entry point HTTP
396
- β”‚ └── http-client.ts # Client npm
397
- β”œβ”€β”€ dist/ # Compiled code (generated)
398
- β”œβ”€β”€ Dockerfile # Multi-stage Docker image
399
- β”œβ”€β”€ docker-compose.yml # Stack with Traefik labels
400
- β”œβ”€β”€ .github/workflows/deploy.yml # CI/CD pipeline
401
- β”œβ”€β”€ package.json # Server dependencies
402
- β”œβ”€β”€ tsconfig.json # TypeScript config
403
- └── README.md # This file
369
+ β”‚ β”‚ β”œβ”€β”€ errors.ts # Gestion erreurs centralisΓ©e
370
+ β”‚ β”‚ └── __tests__/
371
+ β”‚ β”‚ └── errors.test.ts
372
+ β”‚ β”œβ”€β”€ index.ts # Entry point stdio
373
+ β”‚ β”œβ”€β”€ http-server.ts # Entry point HTTP
374
+ β”‚ └── http-client.ts # Client npm
375
+ β”œβ”€β”€ .github/workflows/
376
+ β”‚ β”œβ”€β”€ ci.yml # CI: tests on push/PR
377
+ β”‚ └── release.yml # Release: GHCR + deploy + npm
378
+ β”œβ”€β”€ Dockerfile # Multi-stage Docker (node:20-alpine)
379
+ β”œβ”€β”€ docker-compose.yml # Docker Swarm stack
380
+ β”œβ”€β”€ vitest.config.ts # Vitest configuration
381
+ β”œβ”€β”€ package.json
382
+ β”œβ”€β”€ tsconfig.json
383
+ └── README.md
404
384
  ```
405
385
 
406
386
  ---
@@ -514,7 +494,7 @@ See [CONTEXT.md](CONTEXT.md) for detailed architecture documentation.
514
494
 
515
495
  ```bash
516
496
  # Check that Node.js is installed
517
- node --version # Must be 18+
497
+ node --version # Must be 20+
518
498
 
519
499
  # Check that dependencies are installed
520
500
  npm install
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shyzus/mcp-geocrafter",
3
- "version": "1.0.5",
3
+ "version": "1.2.2",
4
4
  "description": "GeoCrafter - MCP server for geocoding and reverse geocoding - Powered by Nominatim API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,11 +11,22 @@
11
11
  "dist/http-client.js",
12
12
  "README.md"
13
13
  ],
14
- "keywords": ["mcp", "geocoding", "nominatim", "location", "address", "gps", "chatgpt"],
14
+ "keywords": [
15
+ "mcp",
16
+ "geocoding",
17
+ "nominatim",
18
+ "location",
19
+ "address",
20
+ "gps",
21
+ "chatgpt"
22
+ ],
15
23
  "author": "Rankorr",
16
24
  "license": "MIT",
17
25
  "engines": {
18
- "node": ">=18.0.0"
26
+ "node": ">=20.0.0"
27
+ },
28
+ "volta": {
29
+ "node": "20.19.5"
19
30
  },
20
31
  "repository": {
21
32
  "type": "git",
@@ -37,16 +48,18 @@
37
48
  "tunnel": "ngrok http ${PORT:-3000}",
38
49
  "inspect": "npx @modelcontextprotocol/inspector@latest http://localhost:${PORT:-3000}/mcp",
39
50
  "health": "curl -s http://localhost:${PORT:-3000}/health | jq .",
51
+ "test": "vitest run",
52
+ "test:watch": "vitest",
40
53
  "prepare": "npm run build"
41
54
  },
42
55
  "dependencies": {
43
- "@modelcontextprotocol/sdk": "^1.23.0"
56
+ "@modelcontextprotocol/sdk": "^1.27.1"
44
57
  },
45
58
  "devDependencies": {
46
59
  "@types/node": "^20.10.0",
47
60
  "npm-run-all": "^4.1.5",
48
61
  "tsx": "^4.7.0",
49
- "typescript": "^5.3.0"
62
+ "typescript": "^5.3.0",
63
+ "vitest": "^4.0.18"
50
64
  }
51
65
  }
52
-