静态地图渲染服务

一个基于OpenStreetMap的MCP服务器,用于渲染路线和标记并保存为PNG图像。

  • by cvsouth
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 cvsouth/staticmap-mcp

使用说明

静态地图MCP服务器

一个MCP服务器,在OpenStreetMap图块上渲染路线和标记并另存为PNG。

快速开始

添加到MCP配置中:

{
  "mcpServers": {
    "staticmap": {
      "command": "uvx",
      "args": ["staticmap-mcp"]
    }
  }
}

[!注意] 不需要API密钥。使用公共OpenStreetMap图块。

[!提示] 与配对 开路mcp 根据自然语言提示生成路线坐标,然后将其传递给staticmap-mcp以渲染地图。

可用工具

工具 说明
render_route_map 在OpenStreetMap互动程序地图上渲染路线并另存为PNG
Full tool reference

render_route_map

在OpenStreetMap互动程序地图上渲染路线并另存为PNG。

  • coordinates ([lon,lat]列表,必填):路线为[经度,纬度]对列表,例如。 [[-17.1, 28.1], [-17.2, 28.2]]
  • output_path (字符串,必填):保存PNG图像的文件路径(自动创建的父目录)
  • markers (对象列表):可选命名点,每个点都有 lon, lat,以及 label 钥匙
  • width (int):图像宽度(像素)(默认值:800)
  • height (int):图像高度(像素)(默认值:600)
  • line_color (string):路线颜色(默认值:“黑色”)
  • line_width (int):布线线宽(像素)(默认值:3)
  • basemap (字符串):贴图平铺样式-- "osm" (默认), "topo" (地形/徒步旅行), "cycle" (自行车), "humanitarian"

发展

git clone https://github.com/cvsouth/staticmap-mcp.git
cd staticmap-mcp
uv sync --dev
pytest

许可证

麻省理工学院