Get My Location
About
Get My Location is an MCP (Model Context Protocol) server that obtains a user’s precise geographic location by opening a browser for manual permission authorization. It is designed for AI assistants or applications that need real‑time latitude/longitude coordinates, works…
Details
- Author
- mcpchina
- Downloads
- 167
- Categories
- Media
Jump to
- Obtains precise location via browser geolocation API
- Automatically opens the browser for user permission
- Polls location data; 60‑second timeout if no response
- Cross‑platform (Windows, macOS, Linux)
- Returns latitude and longitude as a JSON object
- No external API keys or configuration files needed
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Get My LocationCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install the server by running npx -y @mcpcn/mcp-get-location and add it to your MCP client’s configuration under the mcpServers key. No environment variables are required. After configuration, call the get_location tool – the server will automatically open a browser, ask you to grant location permission, poll for the position for up to 60 seconds, and return the coordinates.
get_location
Get user location information, this tool can obtain the latitude and longitude of the user's location
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"get my location": {
"get-location": {
"command": "npx",
"args": [
"-y",
"@mcpcn/mcp-get-location"
],
"env": []
}
}
}
}
McpServers
{
"get-location": {
"command": "npx",
"args": [
"-y",
"@mcpcn/mcp-get-location"
],
"env": []
}
}
MCP Location Server
一个基于 MCP (Model Context Protocol) 的位置获取服务器,通过浏览器授权获取用户精确位置信息。
功能特性
- 🌍 通过浏览器获取用户精确位置(网络定位)
- 🔄 自动轮询位置信息,最多等待60秒
- 🌐 跨平台支持(Windows、macOS、Linux)
- 📱 自动打开浏览器进行位置授权
- 📍 返回经纬度坐标信息
使用场景举例
- 我在哪儿?
- 天气怎么样?(配合天气mcp)
- 开车/坐地铁/坐公交去xxx怎么走?(配合地图mcp)
MCP客户端中直接使用
stido方式安装,配置如下:
{
"mcpServers": {
"get-location": {
"command": "npx",
"args": ["-y", "@mcpcn/mcp-get-location"],
"env": {}
}
}
}
可用工具
get_location
获取用户位置信息,通过浏览器授权定位。
参数: 无
返回值:
{
"latitude": 39.78463536888209,
"longitude": 116.50960396229777,
}
使用示例:
调用该工具后,系统会:
1. 自动打开浏览器
2. 引导用户授权位置权限
3. 轮询获取位置信息
4. 返回经纬度坐标
技术实现
- 基于 MCP SDK 1.12.0
- 使用 TypeScript 开发
- 通过 stdio 方式进行通信
- 支持跨平台浏览器调用
注意事项
- 需要用户在浏览器中手动授权位置权限
- 如果60秒内未获取到位置,会返回超时错误
- 确保网络连接正常,能够访问外部API
开发和调试
# 安装依赖
npm install
构建
npm run build
启动开发模式
npm start
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.
