@shyzus/mcp-geocrafter 1.0.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 +530 -0
- package/dist/http-client.js +13 -0
- package/dist/index.js +12 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
# πΊοΈ GeoCrafter - Geocoding Server for ChatGPT
|
|
2
|
+
|
|
3
|
+
GeoCrafter is a clean, modular MCP server for geocoding and reverse geocoding - Powered by Nominatim API (OpenStreetMap).
|
|
4
|
+
|
|
5
|
+
[](https://github.com/rankorr/mcp-location/actions/workflows/deploy.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
|
|
7
|
+
[](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
|
|
8
|
+
[](https://geocrafter.rankorr.red/health)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## β οΈ Disclaimer
|
|
17
|
+
|
|
18
|
+
**This project is independent and unofficial.**
|
|
19
|
+
|
|
20
|
+
- β **Not affiliated** with OpenStreetMap or Nominatim
|
|
21
|
+
- β **Not sponsored** by these organizations
|
|
22
|
+
- β
Uses **public data** from the [Nominatim API](https://nominatim.openstreetmap.org/)
|
|
23
|
+
- β
Educational and practical purpose project
|
|
24
|
+
|
|
25
|
+
Geocoding data comes from the Nominatim API, which uses OpenStreetMap data.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## π― What is it?
|
|
30
|
+
|
|
31
|
+
This application allows **ChatGPT** and other MCP clients to access geocoding services with a **clean, modular architecture** that serves as a template for future MCP servers.
|
|
32
|
+
|
|
33
|
+
### β¨ Features
|
|
34
|
+
|
|
35
|
+
- π **Address to GPS** - Convert addresses to coordinates
|
|
36
|
+
- π **GPS to Address** - Convert coordinates to addresses
|
|
37
|
+
- ποΈ **Modular Architecture** - Clean separation of concerns, reusable for future MCP servers
|
|
38
|
+
- π **Dual Mode** - Works with ChatGPT (HTTP) and IDEs (stdio)
|
|
39
|
+
- πΊοΈ **GeoJSON Map Viewer** - Render interactive maps inside ChatGPT with fullscreen controls (Apps SDK)
|
|
40
|
+
|
|
41
|
+
### π¬ Usage example
|
|
42
|
+
|
|
43
|
+
In ChatGPT, simply ask:
|
|
44
|
+
|
|
45
|
+
> "What are the coordinates of the Eiffel Tower?"
|
|
46
|
+
|
|
47
|
+
Or:
|
|
48
|
+
|
|
49
|
+
> "What is the address at coordinates 48.8566, 2.3522?"
|
|
50
|
+
|
|
51
|
+
ChatGPT will use the MCP server to get the information.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ποΈ Architecture: ChatGPT MCP App
|
|
56
|
+
|
|
57
|
+
### What is a ChatGPT App?
|
|
58
|
+
|
|
59
|
+
**ChatGPT Apps** (via [Apps SDK](https://developers.openai.com/apps-sdk)) allow you to extend ChatGPT with:
|
|
60
|
+
- **Custom tools** (call external APIs)
|
|
61
|
+
- **Real-time data** (up-to-date information)
|
|
62
|
+
|
|
63
|
+
### How does it work?
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
|
|
67
|
+
β ChatGPT β βββββββΊ β MCP Server β βββββββΊ β Nominatim β
|
|
68
|
+
β β HTTP β (Node.js) β HTTP β API β
|
|
69
|
+
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
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
|
|
74
|
+
3. **The results** are returned to ChatGPT
|
|
75
|
+
|
|
76
|
+
### MCP Protocol
|
|
77
|
+
|
|
78
|
+
MCP (Model Context Protocol) is an open standard created by Anthropic that allows LLMs to access external data and tools securely. It is used by:
|
|
79
|
+
- ChatGPT (via Apps SDK)
|
|
80
|
+
- Claude Desktop
|
|
81
|
+
- Cursor
|
|
82
|
+
- Other MCP clients
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## π Quick Start
|
|
87
|
+
|
|
88
|
+
### Use with Cursor / Claude Desktop / Warp
|
|
89
|
+
|
|
90
|
+
**The easiest way** - Install the npm client that connects to the remote server:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"mcp-geocrafter": {
|
|
96
|
+
"command": "npx",
|
|
97
|
+
"args": ["-y", "@shyzus/mcp-geocrafter"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Config file locations:**
|
|
104
|
+
- **Cursor**: `~/.cursor/mcp.json` (macOS/Linux) or `%APPDATA%\Cursor\mcp.json` (Windows)
|
|
105
|
+
- **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
106
|
+
- **Warp**: In Warp AI settings
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Use with ChatGPT
|
|
111
|
+
|
|
112
|
+
A production server is available and ready to use!
|
|
113
|
+
|
|
114
|
+
**Server URL**: `https://geocrafter.rankorr.red/mcp`
|
|
115
|
+
|
|
116
|
+
#### ChatGPT Configuration
|
|
117
|
+
|
|
118
|
+
1. **Have a ChatGPT account with subscription** (ChatGPT Plus, Team, or Enterprise)
|
|
119
|
+
2. **Open ChatGPT in your browser** β Go to **Settings** (βοΈ)
|
|
120
|
+
3. **Go to "Apps & Connectors"**
|
|
121
|
+
4. **Enable developer mode**:
|
|
122
|
+
- In **"Advanced Settings"**, enable **developer mode**
|
|
123
|
+
- Go back
|
|
124
|
+
5. **Create a new application**:
|
|
125
|
+
- The **"Create"** button now appears in the top right
|
|
126
|
+
- Click on it
|
|
127
|
+
- Fill in the form:
|
|
128
|
+
- **Name**: "GeoCrafter" (or another name)
|
|
129
|
+
- **Image**: Add an icon/image (optional)
|
|
130
|
+
- **Server URL**: `https://geocrafter.rankorr.red/mcp`
|
|
131
|
+
- **Authentication**: Select **"None"**
|
|
132
|
+
- Click **"Create"**
|
|
133
|
+
6. **The application is now available** in ChatGPT and will activate automatically when you ask ChatGPT to use it
|
|
134
|
+
|
|
135
|
+
#### Test it!
|
|
136
|
+
|
|
137
|
+
Ask a question in ChatGPT:
|
|
138
|
+
> "What are the coordinates of Paris, France?"
|
|
139
|
+
|
|
140
|
+
Or to test directly:
|
|
141
|
+
> "Use GeoCrafter to find the address at coordinates 48.8566, 2.3522"
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### For developers - Local installation
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# 1. Clone the project
|
|
149
|
+
git clone https://github.com/rankorr/mcp-location.git
|
|
150
|
+
cd mcp-location
|
|
151
|
+
|
|
152
|
+
# 2. Install dependencies
|
|
153
|
+
npm install
|
|
154
|
+
|
|
155
|
+
# 3. Build
|
|
156
|
+
npm run build
|
|
157
|
+
|
|
158
|
+
# 4. Use locally
|
|
159
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## π± Deployment and Development
|
|
165
|
+
|
|
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.
|
|
167
|
+
|
|
168
|
+
> **π‘ To use the application in ChatGPT**, see the [π Quick Start](#-quick-start) section above for complete instructions.
|
|
169
|
+
|
|
170
|
+
### Option 1: Local Testing with ngrok (For development)
|
|
171
|
+
|
|
172
|
+
#### 1. Start the HTTP server
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm run start:http
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The server starts on `http://localhost:3000`
|
|
179
|
+
|
|
180
|
+
#### 2. Expose with ngrok
|
|
181
|
+
|
|
182
|
+
In a **new terminal**:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Install ngrok if necessary
|
|
186
|
+
brew install ngrok # macOS
|
|
187
|
+
# or download from https://ngrok.com/download
|
|
188
|
+
|
|
189
|
+
# Expose port 3000
|
|
190
|
+
ngrok http 3000
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
You get a public URL like:
|
|
194
|
+
```
|
|
195
|
+
https://abc123.ngrok-free.dev
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Important**: Note the complete URL with `/mcp` at the end: `https://abc123.ngrok-free.dev/mcp`
|
|
199
|
+
|
|
200
|
+
#### 3. Configure the application in ChatGPT
|
|
201
|
+
|
|
202
|
+
Follow the configuration instructions in the [π Quick Start](#-quick-start) section, using your ngrok URL (`https://your-url.ngrok-free.dev/mcp`) instead of the production URL.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Option 2: Deploy your own server (For developers)
|
|
207
|
+
|
|
208
|
+
> **Note**: If you just want to use the application, see the [π Quick Start](#-quick-start) section which uses the production server already available.
|
|
209
|
+
|
|
210
|
+
This project includes a GitHub Actions workflow that automatically deploys to a VPS with Docker and Portainer.
|
|
211
|
+
|
|
212
|
+
#### **VPS Deployment with GitHub Actions**
|
|
213
|
+
|
|
214
|
+
1. **Configure GitHub secrets** according to [SECRETS.md](SECRETS.md)
|
|
215
|
+
2. **Push to the `main` branch**
|
|
216
|
+
3. GitHub Actions will automatically:
|
|
217
|
+
- β
Test TypeScript code
|
|
218
|
+
- β
Deploy to your VPS via Portainer
|
|
219
|
+
- β
Check health status
|
|
220
|
+
|
|
221
|
+
**Benefits**:
|
|
222
|
+
- Automatic deployment on each push
|
|
223
|
+
- Free SSL with Traefik + Let's Encrypt
|
|
224
|
+
- Integrated health monitoring
|
|
225
|
+
- Centralized logs
|
|
226
|
+
|
|
227
|
+
#### **Other cloud platforms**
|
|
228
|
+
|
|
229
|
+
You can also deploy on:
|
|
230
|
+
- **Railway** - Automatic deployment from GitHub
|
|
231
|
+
- **Render** - Managed service with free SSL
|
|
232
|
+
- **Fly.io** - Edge computing with global deployment
|
|
233
|
+
- **Google Cloud Run** - Serverless with automatic scaling
|
|
234
|
+
|
|
235
|
+
See the [Apps SDK deployment guide](https://developers.openai.com/apps-sdk/deploy) for more details.
|
|
236
|
+
|
|
237
|
+
#### **Configure your server in ChatGPT**
|
|
238
|
+
|
|
239
|
+
Once deployed:
|
|
240
|
+
1. Note your server URL: `https://your-domain.com/mcp`
|
|
241
|
+
2. Follow the instructions in [π Quick Start](#-quick-start)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## π§ͺ Local Testing (without ChatGPT)
|
|
246
|
+
|
|
247
|
+
### With Cursor (the IDE you're using)
|
|
248
|
+
|
|
249
|
+
The MCP server already works in Cursor! Ask me a question about locations and I'll use the server.
|
|
250
|
+
|
|
251
|
+
### With Claude Desktop
|
|
252
|
+
|
|
253
|
+
1. Install [Claude Desktop](https://claude.ai/download)
|
|
254
|
+
|
|
255
|
+
2. Configure in `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"mcpServers": {
|
|
260
|
+
"mcp-geocrafter": {
|
|
261
|
+
"command": "node",
|
|
262
|
+
"args": [
|
|
263
|
+
"/absolute/path/to/mcp-location/dist/index.js"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
3. Restart Claude Desktop
|
|
271
|
+
4. The MCP icon π appears in the bottom left
|
|
272
|
+
|
|
273
|
+
### With the MCP inspector
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Opens a web interface to test all tools.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## πΊοΈ GeoJSON Map Viewer (ChatGPT UI Tool)
|
|
284
|
+
|
|
285
|
+
`display_geojson_map` is a **ChatGPT-only** tool that returns an interactive Leaflet map embedded inside the conversation. It leverages the OpenAI Apps SDK widget runtime (`text/html+skybridge`) and ships with a dedicated template bundled in this repository.
|
|
286
|
+
|
|
287
|
+
### Inputs
|
|
288
|
+
|
|
289
|
+
| Parameter | Type | Required | Description |
|
|
290
|
+
|-----------|------|----------|-------------|
|
|
291
|
+
| `geojson` | `object` \| `string` | β
| GeoJSON **FeatureCollection** to render. Accepts either a parsed object (recommended) or a JSON string for compatibility with ChatGPT prompts. |
|
|
292
|
+
| `title` | `string` | β | Custom title displayed above the map. Defaults to `Carte GeoJSON`. |
|
|
293
|
+
| `description` | `string` | β | Caption shown next to the title (e.g., context or instructions). |
|
|
294
|
+
| `highlightColor` | `string` | β | Hex color (e.g., `#2563eb`) applied to outlines, fills and markers. |
|
|
295
|
+
|
|
296
|
+
### Output
|
|
297
|
+
|
|
298
|
+
- Inline widget rendered directly in ChatGPT with:
|
|
299
|
+
- **OpenStreetMap tiles + Leaflet overlay**
|
|
300
|
+
- Computed bounding box & auto-fit
|
|
301
|
+
- `Recentrer` button
|
|
302
|
+
- `Agrandir` button (toggles fullscreen inside ChatGPT, matching the requirement βoption de lβouvrir en grandβ)
|
|
303
|
+
- Lightweight `structuredContent` summary exposed to the model (feature count, geometry types, bounds)
|
|
304
|
+
- Full GeoJSON stays inside `_meta`, so it is only consumed by the widget (keeps the model prompt small)
|
|
305
|
+
|
|
306
|
+
### Example call
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"name": "display_geojson_map",
|
|
311
|
+
"arguments": {
|
|
312
|
+
"title": "Stations autour de Lyon",
|
|
313
|
+
"description": "RΓ©sultats de places_nearby sur 5 km",
|
|
314
|
+
"geojson": {
|
|
315
|
+
"type": "FeatureCollection",
|
|
316
|
+
"features": [
|
|
317
|
+
{
|
|
318
|
+
"type": "Feature",
|
|
319
|
+
"geometry": { "type": "Point", "coordinates": [4.8357, 45.7640] },
|
|
320
|
+
"properties": { "label": "Lyon Part-Dieu" }
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
> βΉοΈ The stdio server (Cursor/Claude Desktop) ignores this tool, which is fine: it is explicitly designed for ChatGPT with UI widgets.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## π Project Structure
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
mcp-location/
|
|
336
|
+
βββ src/
|
|
337
|
+
β βββ config.ts # Configuration centralisΓ©e
|
|
338
|
+
β βββ types.ts # Types TypeScript partagΓ©s
|
|
339
|
+
β βββ client/
|
|
340
|
+
β β βββ nominatimClient.ts # Client API Nominatim
|
|
341
|
+
β βββ tools/
|
|
342
|
+
β β βββ searchAddress.ts # Tool: adresse β GPS
|
|
343
|
+
β β βββ reverseGeocode.ts # Tool: GPS β adresse
|
|
344
|
+
β β βββ displayGeoJsonMap.ts # Tool: GeoJSON β widget UI
|
|
345
|
+
β βββ resources/
|
|
346
|
+
β β βββ mapViewerTemplate.ts # Template HTML (text/html+skybridge) pour ChatGPT
|
|
347
|
+
β βββ servers/
|
|
348
|
+
β β βββ stdio.ts # Serveur stdio (IDEs)
|
|
349
|
+
β β βββ http.ts # Serveur HTTP (ChatGPT)
|
|
350
|
+
β βββ utils/
|
|
351
|
+
β β βββ errors.ts # Gestion erreurs centralisΓ©e
|
|
352
|
+
β βββ index.ts # Entry point stdio
|
|
353
|
+
β βββ http-server.ts # Entry point HTTP
|
|
354
|
+
β βββ http-client.ts # Client npm
|
|
355
|
+
βββ dist/ # Compiled code (generated)
|
|
356
|
+
βββ Dockerfile # Multi-stage Docker image
|
|
357
|
+
βββ docker-compose.yml # Stack with Traefik labels
|
|
358
|
+
βββ .github/workflows/deploy.yml # CI/CD pipeline
|
|
359
|
+
βββ package.json # Server dependencies
|
|
360
|
+
βββ tsconfig.json # TypeScript config
|
|
361
|
+
βββ README.md # This file
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## π οΈ Available Commands
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# Development
|
|
370
|
+
npm run dev # Dev mode with hot-reload (stdio)
|
|
371
|
+
npm run dev:http # Dev mode HTTP server
|
|
372
|
+
|
|
373
|
+
# Production
|
|
374
|
+
npm run build # Compile TypeScript
|
|
375
|
+
npm run start # Start stdio server
|
|
376
|
+
npm run start:http # Start HTTP server (port 3000)
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## π§ Advanced Configuration
|
|
382
|
+
|
|
383
|
+
### Environment variables
|
|
384
|
+
|
|
385
|
+
Create a `.env` file:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
PORT=3000 # HTTP server port
|
|
389
|
+
NODE_ENV=production # Environment
|
|
390
|
+
NOMINATIM_BASE_URL=https://nominatim.openstreetmap.org # Optional
|
|
391
|
+
NOMINATIM_USER_AGENT=MyApp/1.0 # Optional (recommended by Nominatim)
|
|
392
|
+
CORS_ORIGIN=* # CORS origin (default: * in dev, https://chatgpt.com in prod)
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Customize the Nominatim API
|
|
396
|
+
|
|
397
|
+
The Nominatim API is public but you can:
|
|
398
|
+
1. Use a custom instance (set `NOMINATIM_BASE_URL`)
|
|
399
|
+
2. Set a custom User-Agent (recommended, set `NOMINATIM_USER_AGENT`)
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## ποΈ Architecture Details
|
|
404
|
+
|
|
405
|
+
This project serves as a **template/base** for future MCP servers with a clean, modular architecture:
|
|
406
|
+
|
|
407
|
+
### Separation of Concerns
|
|
408
|
+
|
|
409
|
+
- **`config.ts`**: Environment variables, constants, validation
|
|
410
|
+
- **`types.ts`**: Shared TypeScript interfaces
|
|
411
|
+
- **`client/`**: External API abstraction (Nominatim)
|
|
412
|
+
- **`tools/`**: Business logic (validation, transformation, formatting)
|
|
413
|
+
- **`servers/`**: MCP implementation (stdio/HTTP), reuses tools
|
|
414
|
+
- **`utils/errors.ts`**: Custom error classes, formatting
|
|
415
|
+
|
|
416
|
+
See [CONTEXT.md](CONTEXT.md) for detailed architecture documentation.
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## π Resources & Documentation
|
|
421
|
+
|
|
422
|
+
### Official documentation
|
|
423
|
+
|
|
424
|
+
- [OpenAI Apps SDK](https://developers.openai.com/apps-sdk) - Complete ChatGPT Apps guide
|
|
425
|
+
- [Apps SDK - MCP Server](https://developers.openai.com/apps-sdk/build/mcp-server) - Server config
|
|
426
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP spec
|
|
427
|
+
- [MCP SDK TypeScript](https://github.com/modelcontextprotocol/typescript-sdk) - Node.js SDK
|
|
428
|
+
- [Nominatim API](https://nominatim.org/release-docs/develop/api/Overview/) - Geocoding API docs
|
|
429
|
+
|
|
430
|
+
### Community
|
|
431
|
+
|
|
432
|
+
- [MCP Servers Repository](https://github.com/modelcontextprotocol/servers) - Official examples
|
|
433
|
+
- [OpenAI Apps Examples](https://github.com/openai/chatgpt-apps-examples) - App examples
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## π Debugging & Troubleshooting
|
|
438
|
+
|
|
439
|
+
### Server won't start
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
# Check that Node.js is installed
|
|
443
|
+
node --version # Must be 18+
|
|
444
|
+
|
|
445
|
+
# Check that dependencies are installed
|
|
446
|
+
npm install
|
|
447
|
+
|
|
448
|
+
# Full rebuild
|
|
449
|
+
npm run build
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### UI doesn't display in ChatGPT
|
|
453
|
+
|
|
454
|
+
1. **Check ngrok logs** - See if ChatGPT is making requests
|
|
455
|
+
2. **Check the server** - `http://localhost:3000/health` must respond
|
|
456
|
+
3. **Refresh the connector** in ChatGPT (Settings β Apps β Refresh)
|
|
457
|
+
4. **Check the CORS** - Allowed domains in `src/servers/http.ts`
|
|
458
|
+
|
|
459
|
+
### CORS errors
|
|
460
|
+
|
|
461
|
+
The server allows all origins in dev. In production, restrict in `src/servers/http.ts`:
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
res.setHeader('Access-Control-Allow-Origin', 'https://chatgpt.com');
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Logs
|
|
468
|
+
|
|
469
|
+
Server logs display in the terminal. For more details:
|
|
470
|
+
|
|
471
|
+
```typescript
|
|
472
|
+
console.log('MCP Request:', jsonRpcRequest.method);
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## π Use This Project as a Template
|
|
478
|
+
|
|
479
|
+
This project is a **complete template** for creating your own ChatGPT apps with a clean architecture.
|
|
480
|
+
|
|
481
|
+
### To create your own app:
|
|
482
|
+
|
|
483
|
+
1. **Duplicate this project**
|
|
484
|
+
2. **Replace the Nominatim API** with your API
|
|
485
|
+
3. **Modify the tools** in `src/tools/`
|
|
486
|
+
4. **Customize the configuration** in `src/config.ts`
|
|
487
|
+
5. **Deploy**!
|
|
488
|
+
|
|
489
|
+
### Possible app examples
|
|
490
|
+
|
|
491
|
+
- π¬ **Cinema** - Movie search and showtimes
|
|
492
|
+
- π½οΈ **Restaurants** - Reservations with menu
|
|
493
|
+
- π¨ **Hotels** - Search and availability
|
|
494
|
+
- π¦ **Delivery** - Package tracking
|
|
495
|
+
- π° **News** - Articles with integrated reader
|
|
496
|
+
- π΅ **Music** - Audio player in ChatGPT
|
|
497
|
+
- π **Analytics** - Charts and dashboards
|
|
498
|
+
|
|
499
|
+
The possibilities are endless! π
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## π License
|
|
504
|
+
|
|
505
|
+
MIT - Use freely for your personal or commercial projects.
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## π Credits & Attributions
|
|
510
|
+
|
|
511
|
+
- **Geocoding Data** - [Nominatim API](https://nominatim.openstreetmap.org/) - OpenStreetMap data
|
|
512
|
+
- **MCP Protocol** - [Anthropic](https://www.anthropic.com/)
|
|
513
|
+
- **Apps SDK** - [OpenAI](https://openai.com/)
|
|
514
|
+
|
|
515
|
+
### Data & Licenses
|
|
516
|
+
|
|
517
|
+
Geocoding data comes from the Nominatim API which uses OpenStreetMap data. This data is provided under the Open Database License (ODbL).
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## π Support
|
|
522
|
+
|
|
523
|
+
For any questions:
|
|
524
|
+
- π Check the [Apps SDK documentation](https://developers.openai.com/apps-sdk)
|
|
525
|
+
- π¬ Open an issue on GitHub
|
|
526
|
+
- π§ Contact the team
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
**Have fun with your ChatGPT app! πβ¨**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* HTTP Client pour installation npm
|
|
4
|
+
*
|
|
5
|
+
* Point d'entrΓ©e pour npx @shyzus/mcp-geocrafter
|
|
6
|
+
* DΓ©marre le serveur HTTP
|
|
7
|
+
*/
|
|
8
|
+
import { startHttpServer } from './servers/http.js';
|
|
9
|
+
startHttpServer().catch((error) => {
|
|
10
|
+
console.error('Server error:', error);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=http-client.js.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Entry point pour GeoCrafter stdio Server (IDEs)
|
|
4
|
+
*
|
|
5
|
+
* Délègue à src/servers/stdio.ts
|
|
6
|
+
*/
|
|
7
|
+
import { startStdioServer } from './servers/stdio.js';
|
|
8
|
+
startStdioServer().catch((error) => {
|
|
9
|
+
console.error('Server error:', error);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shyzus/mcp-geocrafter",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "GeoCrafter - MCP server for geocoding and reverse geocoding - Powered by Nominatim API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mcp-geocrafter": "dist/http-client.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/http-client.js",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"keywords": ["mcp", "geocoding", "nominatim", "location", "address", "gps", "chatgpt"],
|
|
15
|
+
"author": "Rankorr",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/rankorr/mcp-location"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsx watch src/index.ts",
|
|
24
|
+
"dev:http": "tsx watch src/http-server.ts",
|
|
25
|
+
"start": "node dist/index.js",
|
|
26
|
+
"start:http": "node dist/http-server.js",
|
|
27
|
+
"prepare": "npm run build"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.0.4"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.10.0",
|
|
34
|
+
"tsx": "^4.7.0",
|
|
35
|
+
"typescript": "^5.3.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|