Skip to main content
Glama

🌍 geo-mcp

一个地理空间 MCP 服务器,为 Claude(或任何 MCP 客户端)提供现实世界的定位超能力——天气、地理编码、时区和周边地点。无需任何 API 密钥。


功能介绍

通过 5 个简洁的工具将 Claude Desktop、Cursor 或任何 MCP 客户端连接到实时地理空间数据:

工具

描述

使用的 API

geocode_address

地址 → 经纬度

Nominatim (OSM)

reverse_geocode_coords

经纬度 → 地址

Nominatim (OSM)

current_weather

任意城市的实时天气

Open-Meteo

location_timezone

时区 + 本地时间

timeapi.io

places_nearby

半径内的兴趣点 (POI)

Overpass (OSM)

所有 API 均为免费且开放——无需注册、无需密钥,个人使用无速率限制困扰。


Related MCP server: Simple Weather MCP

快速开始

git clone https://github.com/yourname/geo-mcp
cd geo-mcp
pip install -r requirements.txt
python server.py

使用 Docker 运行

docker build -t geo-mcp .
docker run -p 8000:8000 geo-mcp

连接到 Claude Desktop

将以下内容添加到你的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "geo-mcp": {
      "command": "python",
      "args": ["/absolute/path/to/geo-mcp/server.py"]
    }
  }
}

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

重启 Claude Desktop——你将看到 🔨 工具图标出现。


示例提示词

连接后,尝试在 Claude 中使用这些提示词:

What's the weather like in Tokyo right now?
Find me hospitals within 500m of the Eiffel Tower.
What time is it right now in lat 35.6762, lon 139.6503?
Geocode "1600 Pennsylvania Ave NW, Washington DC"

项目结构

geo-mcp/
├── server.py              # FastMCP server + tool definitions
├── adapters/
│   ├── geocoding.py       # Nominatim geocoder
│   ├── weather.py         # Open-Meteo weather
│   ├── timezone.py        # timeapi.io timezone
│   └── places.py          # Overpass POI search
├── requirements.txt
├── Dockerfile
└── claude_desktop_config.json

工具参考

geocode_address(address: str)

{
  "display_name": "Paris, Île-de-France, France",
  "lat": 48.8566,
  "lon": 2.3522,
  "type": "city"
}

current_weather(city: str)

{
  "city": "London",
  "temperature_c": 14.2,
  "feels_like_c": 12.8,
  "humidity_pct": 76,
  "wind_speed_kmh": 18.4,
  "condition": "Partly cloudy",
  "precipitation_mm": 0.0
}

places_nearby(lat, lon, category, radius_m)

支持的类别:restaurant(餐厅)、cafe(咖啡馆)、hospital(医院)、pharmacy(药店)、school(学校)、supermarket(超市)、park(公园)、hotel(酒店)、bank(银行)、gas_station(加油站)

{
  "category": "cafe",
  "count": 8,
  "places": [
    { "name": "Monmouth Coffee", "lat": 51.513, "lon": -0.122, "opening_hours": "Mo-Fr 07:30-18:00" }
  ]
}

为什么选择这个项目

旨在演示多适配器 MCP 模式——这与生产环境车队/远程信息处理 MCP 服务器中使用的架构相同。每个适配器都具备以下特点:

  • 可独立测试

  • 易于替换(例如将 Nominatim 替换为 Google Maps,将 Open-Meteo 替换为 OpenWeather 等)

  • 使用 httpx 实现异步优先

  • 具有清晰的返回模式类型定义

这直接对应于现实世界中需要将多个供应商 API 连接到统一工具层下的 MCP 服务器任务。


扩展项目

想要添加新的数据源?创建 adapters/yourapi.py

import httpx

async def your_tool(param: str) -> dict:
    async with httpx.AsyncClient() as client:
        r = await client.get("https://api.example.com/...", timeout=10)
        r.raise_for_status()
        return r.json()

然后在 server.py 中注册它:

from adapters.yourapi import your_tool

@mcp.tool()
async def exposed_tool_name(param: str) -> dict:
    """Tool description shown to the AI."""
    return await your_tool(param)

技术栈


许可证

MIT

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that provides real-time weather data, hourly forecasts, and daily summaries using the free Open-Meteo API with no API key required. It enables users to search for weather conditions by specific coordinates or city names across multiple measurement units.
    1
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A cross-platform MCP server that provides weather forecasts by coordinates, location name, or IP address without requiring API keys. It leverages Open Meteo and OpenStreetMap to deliver fast, single-query weather lookups.
    MIT

View all related MCP servers

Related MCP Connectors

  • Geospatial MCP server for earthquake, tsunami, volcano, disaster, and FX data queries.

  • 350+ production-ready APIs through one MCP server — weather, geocoding, validation, financial data.

  • Free GeoNames MCP: countries, cities, POIs, distance & nearby. Remote HTTP + agent token signup.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FjolleI/geo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server