一个轻量级的 MCP 服务器,它能够依据你当前的 IP 地址,精准告知你的确切位置。该服务器由 ipapi.co 提供支持。
WhereAmI MCP 服务器是一款轻量级工具,借助 IP 地址就能精准定位你的位置。下面为你介绍如何快速搭建并使用该服务器。
location://{type} 拉取特定数据(例如 IP、国家、城市)。get_location() 生成全面的位置报告。mcp 和 httpx。pipgit clone https://github.com/kukapay/whereami-mcp.git
cd whereami-mcp
pip install mcp httpx
mcp install whereami_mcp.py --name "WhereAmI"
python whereami_mcp.py
mcp dev whereami_mcp.py
location://{type}根据 {type} 返回特定的位置信息。
ip、country、country_code、region、city、latitude、longitude、timezone、isp、asn@location://ip → "8.8.8.8"@location://city → "Mountain View"@location://country → "United States"get_location()生成详细的 Markdown 表格格式的地理位置数据。
| Field | Value |
|----------------|-------------------|
| IP | 8.8.8.8 |
| Country | United States |
| Country Code | US |
| Region | California |
| City | Mountain View |
| Latitude | 37.4223 |
| Longitude | -122.0848 |
| Timezone | America/Los_Angeles |
| ISP | GOOGLE |
| ASN | AS15169 |
where_am_i_prompt预定义查询:“请告诉我基于我当前的 IP 地址的位置。”触发 get_location()。
mcp install whereami_mcp.py --name "WhereAmI"
@location://ip”@location://city,@location://country”get_location()本项目采用 MIT 许可证。