Token导航 LogoToken导航TokenDH.com
Osm Tools logo
地图位置未说明官方级别未说明来源级核验

Osm Tools

MCP Server

提供地理编码、反向地理编码、POI搜索和路径计算功能的地理信息服务工具。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
地理编码TypeScriptClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

BUZDOLAPCI

提供方

BUZDOLAPCI

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

osm工具

OpenStreetMap MCP服务器提供地理编码、反向地理编码、POI搜索和路由功能。

特性

  • 地理编码:正向地理编码-按地址/地名搜索
  • 逆地理编码:从坐标中获取地址
  • POI搜索:使用天桥API搜索兴趣点
  • 路线:使用OSRM计算两点之间的路线

安装

npm install
npm run build

用法

作为MCP服务器(stdio)

npm start
# or
node dist/cli.js --transport stdio

作为HTTP服务器

node dist/cli.js --transport http --port 3000

配置

可以通过环境变量或命令行参数设置配置:

环境变量CLI标志默认值描述
OSM_TRANSPORT--transportstdio运输方式: stdiohttp
OSM_HTTP_PORT--port3000HTTP服务器端口
OSM_USER_AGENT-osm-tools-mcp/1.0.0API请求的用户代理
OSM_THROTTLE_MS-1000API请求之间的延迟(ms)
OSM_NOMINATIM_URL-https://nominatim.openstreetmap.orgAPI名称URL
OSM_OVERPASS_URL-https://overpass-api.de/api/interpreter天桥API URL
OSM_OSRM_URL-https://router.project-osrm.orgOSRM API URL

工具

地理编码

正向地理编码:通过地址或地名搜索位置。

输入:

{
  "query": "Empire State Building, New York",
  "bbox": [-74.1, 40.7, -73.9, 40.8],
  "country": "US"
}

输出:

{
  "ok": true,
  "data": [
    {
      "lat": 40.7484,
      "lon": -73.9857,
      "display_name": "Empire State Building, 350, 5th Avenue, Manhattan, New York, NY 10118, USA",
      "type": "attraction",
      "importance": 0.825,
      "place_id": 123456
    }
  ],
  "meta": {
    "source": "nominatim",
    "retrieved_at": "2024-01-15T12:00:00.000Z",
    "pagination": { "next_cursor": null },
    "warnings": []
  }
}

反向geocode

反向地理编码:从坐标中获取地址。

输入:

{
  "lat": 40.7484,
  "lon": -73.9857
}

输出:

{
  "ok": true,
  "data": {
    "lat": 40.7484,
    "lon": -73.9857,
    "display_name": "Empire State Building, 350, 5th Avenue, Manhattan, New York, NY 10118, USA",
    "address": {
      "house_number": "350",
      "road": "5th Avenue",
      "city": "New York",
      "state": "New York",
      "postcode": "10118",
      "country": "United States",
      "country_code": "us"
    },
    "place_id": 123456
  },
  "meta": {
    "source": "nominatim",
    "retrieved_at": "2024-01-15T12:00:00.000Z",
    "pagination": { "next_cursor": null },
    "warnings": []
  }
}

poi_search

使用OpenStreetMap天桥API搜索兴趣点。

输入(使用bbox):

{
  "center_or_bbox": {
    "bbox": [40.7, -74.1, 40.8, -73.9]
  },
  "tags": {
    "amenity": "restaurant",
    "cuisine": "italian"
  },
  "limit": 10
}

输入(带中心点,半径1km):

{
  "center_or_bbox": {
    "center": [40.7484, -73.9857]
  },
  "tags": {
    "amenity": "cafe"
  }
}

输出:

{
  "ok": true,
  "data": [
    {
      "id": 123456789,
      "name": "Little Italy Restaurant",
      "lat": 40.7195,
      "lon": -73.9973,
      "tags": {
        "amenity": "restaurant",
        "cuisine": "italian",
        "name": "Little Italy Restaurant"
      },
      "type": "node"
    }
  ],
  "meta": {
    "source": "overpass",
    "retrieved_at": "2024-01-15T12:00:00.000Z",
    "pagination": { "next_cursor": null },
    "warnings": []
  }
}

路线

使用OSRM计算两点之间的路线。

输入:

{
  "start": [40.7128, -74.006],
  "end": [40.7484, -73.9857],
  "mode": "walking"
}

输出:

{
  "ok": true,
  "data": {
    "distance_km": 4.2,
    "duration_minutes": 52,
    "geometry": "encoded_polyline_string",
    "steps": [
      {
        "instruction": "Depart",
        "distance_m": 150,
        "duration_s": 108,
        "name": "Broadway"
      },
      {
        "instruction": "Turn right",
        "distance_m": 500,
        "duration_s": 360,
        "name": "5th Avenue"
      },
      {
        "instruction": "Arrive at destination",
        "distance_m": 0,
        "duration_s": 0,
        "name": ""
      }
    ],
    "summary": "Broadway, 5th Avenue"
  },
  "meta": {
    "source": "osrm",
    "retrieved_at": "2024-01-15T12:00:00.000Z",
    "pagination": { "next_cursor": null },
    "warnings": []
  }
}

MCP客户端配置

克劳德桌面版

添加到您的Claude Desktop配置中:

{
  "mcpServers": {
    "osm-tools": {
      "command": "node",
      "args": ["/path/to/osm-tools/dist/cli.js"]
    }
  }
}

API使用策略

此服务器使用公共OpenStreetMap API。请尊重他们的使用政策:

  • 提名:每秒最多1个请求,包括适当的用户代理
  • 天桥:注意查询的复杂性和频率
  • OSRM:公共演示服务器有速率限制

服务器内置了节流功能(请求之间的默认间隔为1000ms),以符合这些策略。

发展

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Watch mode for development
npm run dev

测试

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

许可证

麻省理工学院

目录标签

目录标签

地理编码TypeScriptClaude本地部署反向地理编码POI搜索路径计算OpenStreetMap

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP