@mcpcn/mcp-get-location 1.1.2 → 1.1.3

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
@@ -1,84 +1,84 @@
1
- # MCP Location Server
2
-
3
- A location acquisition server based on MCP (Model Context Protocol) that obtains precise user location information through browser authorization.
4
-
5
- ## Features
6
-
7
- - 🌍 Get precise user location through browser (network positioning)
8
- - 🔄 Automatic polling for location information, up to 60 seconds
9
- - 🌐 Cross-platform support (Windows, macOS, Linux)
10
- - 📱 Automatically opens browser for location authorization
11
- - 📍 Returns latitude and longitude coordinates
12
-
13
- ## Use Case Examples
14
-
15
- - **Where am I?**
16
- - **How's the weather? (combined with weather mcp)**
17
- - **How to get to xxx by car/subway/bus? (combined with map mcp)**
18
-
19
- ## Direct Use in MCP Client
20
-
21
- For stdio installation, configure as follows:
22
-
23
- ```json
24
- {
25
- "mcpServers": {
26
- "get-location": {
27
- "command": "npx",
28
- "args": ["-y", "@mcpcn/mcp-get-location"],
29
- "env": {}
30
- }
31
- }
32
- }
33
- ```
34
-
35
- ## Available Tools
36
-
37
- ### get_location
38
-
39
- Get user location information through browser authorization.
40
-
41
- **Parameters**: None
42
-
43
- **Return Value**:
44
-
45
- ```json
46
- {
47
- "latitude": 39.78463536888209,
48
- "longitude": 116.50960396229777,
49
- }
50
- ```
51
-
52
- **Usage Example**:
53
- After calling this tool, the system will:
54
-
55
- 1. Automatically open the browser
56
- 2. Guide user to authorize location permissions
57
- 3. Poll for location information
58
- 4. Return latitude and longitude coordinates
59
-
60
- ## Technical Implementation
61
-
62
- - Based on MCP SDK 1.12.0
63
- - Developed using TypeScript
64
- - Communication via stdio
65
- - Cross-platform browser call support
66
-
67
- ## Notes
68
-
69
- - Requires user to manually authorize location permissions in browser
70
- - Returns timeout error if location is not obtained within 60 seconds
71
- - Ensure network connection is normal and can access external APIs
72
-
73
- ## Development and Debugging
74
-
75
- ```bash
76
- # Install dependencies
77
- npm install
78
-
79
- # Build
80
- npm run build
81
-
82
- # Start development mode
83
- npm start
1
+ # MCP Location Server
2
+
3
+ A location acquisition server based on MCP (Model Context Protocol) that obtains precise user location information through browser authorization.
4
+
5
+ ## Features
6
+
7
+ - 🌍 Get precise user location through browser (network positioning)
8
+ - 🔄 Automatic polling for location information, up to 60 seconds
9
+ - 🌐 Cross-platform support (Windows, macOS, Linux)
10
+ - 📱 Automatically opens browser for location authorization
11
+ - 📍 Returns latitude and longitude coordinates
12
+
13
+ ## Use Case Examples
14
+
15
+ - **Where am I?**
16
+ - **How's the weather? (combined with weather mcp)**
17
+ - **How to get to xxx by car/subway/bus? (combined with map mcp)**
18
+
19
+ ## Direct Use in MCP Client
20
+
21
+ For stdio installation, configure as follows:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "get-location": {
27
+ "command": "npx",
28
+ "args": ["-y", "@mcpcn/mcp-get-location"],
29
+ "env": {}
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Available Tools
36
+
37
+ ### get_location
38
+
39
+ Get user location information through browser authorization.
40
+
41
+ **Parameters**: None
42
+
43
+ **Return Value**:
44
+
45
+ ```json
46
+ {
47
+ "latitude": 39.78463536888209,
48
+ "longitude": 116.50960396229777,
49
+ }
50
+ ```
51
+
52
+ **Usage Example**:
53
+ After calling this tool, the system will:
54
+
55
+ 1. Automatically open the browser
56
+ 2. Guide user to authorize location permissions
57
+ 3. Poll for location information
58
+ 4. Return latitude and longitude coordinates
59
+
60
+ ## Technical Implementation
61
+
62
+ - Based on MCP SDK 1.12.0
63
+ - Developed using TypeScript
64
+ - Communication via stdio
65
+ - Cross-platform browser call support
66
+
67
+ ## Notes
68
+
69
+ - Requires user to manually authorize location permissions in browser
70
+ - Returns timeout error if location is not obtained within 60 seconds
71
+ - Ensure network connection is normal and can access external APIs
72
+
73
+ ## Development and Debugging
74
+
75
+ ```bash
76
+ # Install dependencies
77
+ npm install
78
+
79
+ # Build
80
+ npm run build
81
+
82
+ # Start development mode
83
+ npm start
84
84
  ```
package/README_CN.md CHANGED
@@ -1,84 +1,84 @@
1
- # MCP Location Server
2
-
3
- 一个基于 MCP (Model Context Protocol) 的位置获取服务器,通过浏览器授权获取用户精确位置信息。
4
-
5
- ## 功能特性
6
-
7
- - 🌍 通过浏览器获取用户精确位置(网络定位)
8
- - 🔄 自动轮询位置信息,最多等待60秒
9
- - 🌐 跨平台支持(Windows、macOS、Linux)
10
- - 📱 自动打开浏览器进行位置授权
11
- - 📍 返回经纬度坐标信息
12
-
13
- ## 使用场景举例
14
-
15
- - **我在哪儿?**
16
- - **天气怎么样?(配合天气mcp)**
17
- - **开车/坐地铁/坐公交去xxx怎么走?(配合地图mcp)**
18
-
19
- ## MCP客户端中直接使用
20
-
21
- stido方式安装,配置如下:
22
-
23
- ```json
24
- {
25
- "mcpServers": {
26
- "get-location": {
27
- "command": "npx",
28
- "args": ["-y", "@mcpcn/mcp-get-location"],
29
- "env": {}
30
- }
31
- }
32
- }
33
- ```
34
-
35
- ## 可用工具
36
-
37
- ### get_location
38
-
39
- 获取用户位置信息,通过浏览器授权定位。
40
-
41
- **参数**: 无
42
-
43
- **返回值**:
44
-
45
- ```json
46
- {
47
- "latitude": 39.78463536888209,
48
- "longitude": 116.50960396229777,
49
- }
50
- ```
51
-
52
- **使用示例**:
53
- 调用该工具后,系统会:
54
-
55
- 1. 自动打开浏览器
56
- 2. 引导用户授权位置权限
57
- 3. 轮询获取位置信息
58
- 4. 返回经纬度坐标
59
-
60
- ## 技术实现
61
-
62
- - 基于 MCP SDK 1.12.0
63
- - 使用 TypeScript 开发
64
- - 通过 stdio 方式进行通信
65
- - 支持跨平台浏览器调用
66
-
67
- ## 注意事项
68
-
69
- - 需要用户在浏览器中手动授权位置权限
70
- - 如果60秒内未获取到位置,会返回超时错误
71
- - 确保网络连接正常,能够访问外部API
72
-
73
- ## 开发和调试
74
-
75
- ```bash
76
- # 安装依赖
77
- npm install
78
-
79
- # 构建
80
- npm run build
81
-
82
- # 启动开发模式
83
- npm start
84
- ```
1
+ # MCP Location Server
2
+
3
+ 一个基于 MCP (Model Context Protocol) 的位置获取服务器,通过浏览器授权获取用户精确位置信息。
4
+
5
+ ## 功能特性
6
+
7
+ - 🌍 通过浏览器获取用户精确位置(网络定位)
8
+ - 🔄 自动轮询位置信息,最多等待60秒
9
+ - 🌐 跨平台支持(Windows、macOS、Linux)
10
+ - 📱 自动打开浏览器进行位置授权
11
+ - 📍 返回经纬度坐标信息
12
+
13
+ ## 使用场景举例
14
+
15
+ - **我在哪儿?**
16
+ - **天气怎么样?(配合天气mcp)**
17
+ - **开车/坐地铁/坐公交去xxx怎么走?(配合地图mcp)**
18
+
19
+ ## MCP客户端中直接使用
20
+
21
+ stido方式安装,配置如下:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "get-location": {
27
+ "command": "npx",
28
+ "args": ["-y", "@mcpcn/mcp-get-location"],
29
+ "env": {}
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## 可用工具
36
+
37
+ ### get_location
38
+
39
+ 获取用户位置信息,通过浏览器授权定位。
40
+
41
+ **参数**: 无
42
+
43
+ **返回值**:
44
+
45
+ ```json
46
+ {
47
+ "latitude": 39.78463536888209,
48
+ "longitude": 116.50960396229777,
49
+ }
50
+ ```
51
+
52
+ **使用示例**:
53
+ 调用该工具后,系统会:
54
+
55
+ 1. 自动打开浏览器
56
+ 2. 引导用户授权位置权限
57
+ 3. 轮询获取位置信息
58
+ 4. 返回经纬度坐标
59
+
60
+ ## 技术实现
61
+
62
+ - 基于 MCP SDK 1.12.0
63
+ - 使用 TypeScript 开发
64
+ - 通过 stdio 方式进行通信
65
+ - 支持跨平台浏览器调用
66
+
67
+ ## 注意事项
68
+
69
+ - 需要用户在浏览器中手动授权位置权限
70
+ - 如果60秒内未获取到位置,会返回超时错误
71
+ - 确保网络连接正常,能够访问外部API
72
+
73
+ ## 开发和调试
74
+
75
+ ```bash
76
+ # 安装依赖
77
+ npm install
78
+
79
+ # 构建
80
+ npm run build
81
+
82
+ # 启动开发模式
83
+ npm start
84
+ ```
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ function openBrowser(url) {
27
27
  command = `open "${url}"`;
28
28
  break;
29
29
  case 'win32': // Windows
30
- command = `start "${url}"`;
30
+ command = `start "" "${url}"`;
31
31
  break;
32
32
  default: // Linux
33
33
  command = `xdg-open "${url}"`;
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@mcpcn/mcp-get-location",
3
- "version": "1.1.2",
4
- "description": "Location MCP Server - Get precise user location information through browser authorization",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist/index.js",
8
- "README.md",
9
- "README_CN.md"
10
- ],
11
- "bin": {
12
- "mcp-get-location": "dist/index.js"
13
- },
14
- "type": "module",
15
- "scripts": {
16
- "build": "tsc",
17
- "build:tsc": "tsc",
18
- "build:dev": "tsc",
19
- "start": "node dist/index.js"
20
- },
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "keywords": [
25
- "mcp",
26
- "location",
27
- "geolocation",
28
- "coordinates",
29
- "model-context-protocol",
30
- "browser",
31
- "latitude",
32
- "longitude"
33
- ],
34
- "author": "mcpcn",
35
- "license": "MIT",
36
- "homepage": "https://github.com/mcpcn/mcp-servers#readme",
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/mcpcn/mcp-servers.git",
40
- "directory": "typescript/mcp-get-location"
41
- },
42
- "bugs": {
43
- "url": "https://github.com/mcpcn/mcp-servers/issues"
44
- },
45
- "dependencies": {
46
- "@modelcontextprotocol/sdk": "1.12.0",
47
- "node-fetch": "^3.3.2"
48
- },
49
- "devDependencies": {
50
- "@types/node": "^20.10.5",
51
- "javascript-obfuscator": "^4.1.1",
52
- "typescript": "^5.3.3"
53
- }
54
- }
1
+ {
2
+ "name": "@mcpcn/mcp-get-location",
3
+ "version": "1.1.3",
4
+ "description": "Location MCP Server - Get precise user location information through browser authorization",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist/index.js",
8
+ "README.md",
9
+ "README_CN.md"
10
+ ],
11
+ "bin": {
12
+ "mcp-get-location": "dist/index.js"
13
+ },
14
+ "type": "module",
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "build:tsc": "tsc",
18
+ "build:dev": "tsc",
19
+ "start": "node dist/index.js"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "keywords": [
25
+ "mcp",
26
+ "location",
27
+ "geolocation",
28
+ "coordinates",
29
+ "model-context-protocol",
30
+ "browser",
31
+ "latitude",
32
+ "longitude"
33
+ ],
34
+ "author": "mcpcn",
35
+ "license": "MIT",
36
+ "homepage": "https://github.com/mcpcn/mcp-servers#readme",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/mcpcn/mcp-servers.git",
40
+ "directory": "typescript/mcp-get-location"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/mcpcn/mcp-servers/issues"
44
+ },
45
+ "dependencies": {
46
+ "@modelcontextprotocol/sdk": "1.12.0",
47
+ "node-fetch": "^3.3.2"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^20.10.5",
51
+ "javascript-obfuscator": "^4.1.1",
52
+ "typescript": "^5.3.3"
53
+ }
54
+ }