- Get My Location
Get My Location
获取用户当前的精准位置,配合天气、地图等需要基于位置提供服务的MCP时有奇效
Content
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,
}
使用示例: 调用该工具后,系统会:
- 自动打开浏览器
- 引导用户授权位置权限
- 轮询获取位置信息
- 返回经纬度坐标
技术实现
- 基于 MCP SDK 1.12.0
- 使用 TypeScript 开发
- 通过 stdio 方式进行通信
- 支持跨平台浏览器调用
注意事项
- 需要用户在浏览器中手动授权位置权限
- 如果60秒内未获取到位置,会返回超时错误
- 确保网络连接正常,能够访问外部API
开发和调试
# 安装依赖
npm install
# 构建
npm run build
# 启动开发模式
npm start
Server Config
{
"mcpServers": {
"get-location": {
"command": "npx",
"args": [
"-y",
"@mcpcn/mcp-get-location"
],
"env": {}
}
}
}Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Tavily Mcp
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.