@shyzus/mcp-geocrafter 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
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/rankorr/mcp-location/actions/workflows/deploy.yml/badge.svg)](https://github.com/rankorr/mcp-location/actions/workflows/deploy.yml)
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
6
  [![npm version](https://img.shields.io/badge/npm-v1.0.0-blue)](https://www.npmjs.com/package/@shyzus/mcp-geocrafter)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/@shyzus/mcp-geocrafter)](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)
@@ -1,13 +1,62 @@
1
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);
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
+ const SERVER_URL = process.argv[2] || 'https://geocrafter.rankorr.red/mcp';
6
+ // Proxy HTTP MCP server to stdio for Cursor
7
+ const server = new Server({
8
+ name: 'geocrafter-http-proxy',
9
+ version: '1.0.1',
10
+ }, {
11
+ capabilities: {
12
+ tools: {},
13
+ resources: {},
14
+ },
12
15
  });
16
+ // Forward all requests to HTTP server
17
+ async function forwardRequest(method, params) {
18
+ const response = await fetch(SERVER_URL, {
19
+ method: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ },
23
+ body: JSON.stringify({
24
+ jsonrpc: '2.0',
25
+ id: Date.now(),
26
+ method,
27
+ params,
28
+ }),
29
+ });
30
+ if (!response.ok) {
31
+ throw new Error(`HTTP error! status: ${response.status}`);
32
+ }
33
+ const data = await response.json();
34
+ if (data.error) {
35
+ throw new Error(data.error.message);
36
+ }
37
+ return data.result;
38
+ }
39
+ // List tools
40
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
41
+ return await forwardRequest('tools/list');
42
+ });
43
+ // Call tool
44
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
45
+ return await forwardRequest('tools/call', request.params);
46
+ });
47
+ // List resources
48
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
49
+ return await forwardRequest('resources/list');
50
+ });
51
+ // Read resource
52
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
53
+ return await forwardRequest('resources/read', request.params);
54
+ });
55
+ // Start stdio transport
56
+ async function main() {
57
+ const transport = new StdioServerTransport();
58
+ await server.connect(transport);
59
+ console.error(`HTTP proxy connected to ${SERVER_URL}`);
60
+ }
61
+ main().catch(console.error);
13
62
  //# sourceMappingURL=http-client.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shyzus/mcp-geocrafter",
3
- "version": "1.0.0",
3
+ "version": "1.0.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",
@@ -14,9 +14,12 @@
14
14
  "keywords": ["mcp", "geocoding", "nominatim", "location", "address", "gps", "chatgpt"],
15
15
  "author": "Rankorr",
16
16
  "license": "MIT",
17
+ "engines": {
18
+ "node": ">=18.0.0"
19
+ },
17
20
  "repository": {
18
21
  "type": "git",
19
- "url": "https://github.com/rankorr/mcp-location"
22
+ "url": "https://github.com/Shyzkanza/mcp-location"
20
23
  },
21
24
  "scripts": {
22
25
  "build": "tsc",