About Get My Location
通过浏览器授权获取用户经网络定位的经纬度,适用于需要当前位置的 MCP 客户端。服务会打开浏览器请求权限,并轮询最多 60 秒以获取位置。
Key features
- 01浏览器授权获取位置
- 02自动轮询位置,最长 60 秒
- 03返回纬度和经度
- 04支持 Windows、macOS、Linux
Use cases
- 01查询当前位置
- 02将位置提供给天气服务
- 03将位置提供给地图服务以规划路线
MCP support
此 MCP 服务通过 `get_location` 工具向客户端返回用户授权后的纬度和经度。通过 stdio 与客户端通信。
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 3w ago
This tool takes no parameters.
Details
From the project READMEMCP Location Server
A location acquisition server based on MCP (Model Context Protocol) that obtains precise user location information through browser authorization.
Features
- 🌍 Get precise user location through browser (network positioning)
- 🔄 Automatic polling for location information, up to 60 seconds
- 🌐 Cross-platform support (Windows, macOS, Linux)
- 📱 Automatically opens browser for location authorization
- 📍 Returns latitude and longitude coordinates
Use Case Examples
- Where am I?
- How's the weather? (combined with weather mcp)
- How to get to xxx by car/subway/bus? (combined with map mcp)
Direct Use in MCP Client
For stdio installation, configure as follows:
{
"mcpServers": {
"get-location": {
"command": "npx",
"args": ["-y", "@mcpcn/mcp-get-location"],
"env": {}
}
}
}
Available Tools
get_location
Get user location information through browser authorization.
Parameters: None
Return Value:
{
"latitude": 39.78463536888209,
"longitude": 116.50960396229777,
}
Usage Example: After calling this tool, the system will:
- Automatically open the browser
- Guide user to authorize location permissions
- Poll for location information
- Return latitude and longitude coordinates
Technical Implementation
- Based on MCP SDK 1.12.0
- Developed using TypeScript
- Communication via stdio
- Cross-platform browser call support
Notes
- Requires user to manually authorize location permissions in browser
- Returns timeout error if location is not obtained within 60 seconds
- Ensure network connection is normal and can access external APIs
Development and Debugging
# Install dependencies
npm install
# Build
npm run build
# Start development mode
npm start
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.