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

Curvature MCP

MCP Server

一个MCP服务器,将道路曲率分析项目作为工具提供给Claude等LLM,用于搜索最适合摩托车手和驾驶爱好者的弯曲道路。

工具数

4

提示词数

0

GitHub Stars

1

资源数

0
PythonClaude位置天气Claude

安装说明

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

作者 / 组织

GeorgeSmith-Sweeper

提供方

GeorgeSmith-Sweeper

最后核验

2026/5/17 20:20

运行时

Python

快速接入

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

命令预览

python3 -m venv mcp_server/venv

详细介绍

Curvature MCP服务器

暴露的MCP服务器 曲率 道路分析作为LLM的工具

MCP(模型上下文协议)服务器,使曲率道路分析项目可作为Claude等LLM的工具。使用自然语言为摩托车手和驾驶爱好者搜索最弯曲、最曲折的道路。

![License](LICENSE) ![Python](https://www.python.org/downloads/)

🏍️ 这是什么?

此MCP服务器允许Claude和其他LLM分析OpenStreetMap中的道路曲率数据。问以下问题:

  • *“找出佛蒙特州长度至少为15公里的十大最弯曲的道路”*
  • *“搜索曲率在500到1000之间的铺砌山路”*
  • *“获取佛蒙特州100号公路的详细信息”*

Claude将使用MCP工具加载数据、搜索道路并提供详细分析。

🎯 特性

  • 加载曲率数据 从已处理的msgpack文件
  • 搜索道路 按曲率分数、长度、曲面类型和名称
  • 获取详细的道路信息 包括分段、坐标和度量
  • 列出加载的数据集 跟踪可用的数据
  • 完全异步支持 通过适当的错误处理
  • 易于集成 使用Claude Code和Claude API

🚀 快速开始

先决条件

  • Python 3.8+
  • 曲率 OSM数据处理库
  • Claude Code CLI或Claude API访问

安装

  1. 克隆此存储库:
cd ~/Documents/Programming
git clone https://github.com/GeorgeSmith-Sweeper/curvature-mcp.git
cd curvature-mcp
  1. 设置虚拟环境并安装依赖项:
python3 -m venv mcp_server/venv
mcp_server/venv/bin/pip install -r mcp_server/requirements.txt
mcp_server/venv/bin/pip install osmium  # For processing OSM data
  1. 安装曲率库(用于数据处理):
cd ~/Documents/Programming
git clone https://github.com/adamfranco/curvature.git
cd curvature
pip install -e .

准备数据

下载并处理您所在地区的OpenStreetMap数据:

# Download OSM data (example: Vermont)
curl -L -o /tmp/vermont-latest.osm.pbf \
  https://download.geofabrik.de/north-america/us/vermont-latest.osm.pbf

# Process through curvature pipeline (requires curvature library)
cd ~/Documents/Programming/curvature
python bin/curvature-collect /tmp/vermont-latest.osm.pbf | \
  python bin/curvature-pp add_segments | \
  python bin/curvature-pp add_segment_length_and_radius | \
  python bin/curvature-pp add_segment_curvature | \
  python bin/curvature-pp roll_up_curvature | \
  python bin/curvature-pp roll_up_length > /tmp/vermont-latest.msgpack

其他数据来源:

  • 美国各州: https://download.geofabrik.de/north-america/us.html
  • 全球: https://download.geofabrik.de/

使用Claude代码

服务器已在中预先配置 .claude/mcp.json.简单地说:

  1. 在Claude Code中打开此项目
  2. MCP服务器将自动加载
  3. 让克劳德使用曲率工具!

示例提示:

Load the Vermont curvature data from /tmp/vermont-latest.msgpack

Find the top 10 curviest roads in Vermont

Search for roads with curvature over 500 and at least 20km long

Get details about Vermont Route 100

与Claude API一起使用

在您的Claude API代码中配置MCP服务器:

import anthropic

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-opus-4-5",
    max_tokens=2000,
    messages=[{
        "role": "user",
        "content": "Find the curviest roads in Vermont over 15km long"
    }],
    mcp_servers=[{
        "type": "stdio",
        "command": "mcp_server/venv/bin/python",
        "args": ["-m", "mcp_server.server"],
        "env": {"PYTHONPATH": "."}
    }],
    tools=[{
        "type": "mcp_toolset",
        "mcp_server_name": "curvature"
    }],
    betas=["mcp-client-2025-11-20"]
)

🛠️ 可用工具

load_curvature_data

从msgpack文件加载已处理的曲率数据。

参数:

  • file_path (必需):.msgpack文件的绝对路径
  • data_id (可选):此数据集的标识符(默认值:“default”)

search_roads

搜索符合特定条件的道路。

参数:

  • data_id (可选):要搜索的数据集(默认值:“默认”)
  • min_curvature (可选):最小曲率分数
  • max_curvature (可选):最大曲率分数
  • min_length_km (可选):最小道路长度(km)
  • surface (可选):按表面类型过滤(例如“铺砌”、“沥青”)
  • name_contains (可选):按名称筛选(不区分大小写)
  • limit (可选):要返回的最大结果(默认值:20)

get_road_details

获取特定道路的详细信息。

参数:

  • data_id (可选):要搜索的数据集
  • road_id (可选):道路收集ID
  • name (可选):道路名称(可替代Road_id)

list_loaded_datasets

列出当前加载的所有曲率数据集及其统计信息。

📊 输出示例

正在加载数据:

{
  "status": "success",
  "data_id": "vermont",
  "collections_loaded": 134850,
  "statistics": {
    "total_collections": 134850,
    "average_curvature": 198.8,
    "max_curvature": 107938.1
  }
}

寻找弯曲的道路:

{
  "status": "success",
  "total_matches": 1021,
  "results": [
    {
      "name": "Vermont Route 100",
      "curvature": 8944.52,
      "length_km": 25.02,
      "length_mi": 15.55,
      "surface": "asphalt",
      "ways_count": 42
    }
  ]
}

🧪 测试

在没有MCP的情况下在本地测试工具:

# Test with data
PYTHONPATH=. mcp_server/venv/bin/python mcp_server/test_tools.py /tmp/vermont-latest.msgpack

# Test without data (basic functionality)
PYTHONPATH=. mcp_server/venv/bin/python mcp_server/test_tools.py

📁 项目结构

curvature-mcp/
├── .claude/
│   └── mcp.json           # Claude Code configuration
├── mcp_server/
│   ├── __init__.py        # Package init
│   ├── server.py          # Main MCP server (stdio transport)
│   ├── tools.py           # Tool definitions and implementations
│   ├── test_tools.py      # Local testing script
│   ├── requirements.txt   # Python dependencies
│   ├── venv/             # Virtual environment (gitignored)
│   └── README.md         # Detailed MCP server docs
├── README.md             # This file
├── .gitignore            # Git ignore rules
└── LICENSE               # License file

🔧 发展

添加新工具

  1. 在中创建新的工具类 mcp_server/tools.py:
class MyNewTool(CurvatureTool):
    def __init__(self):
        super().__init__(
            name="my_tool",
            description="What this tool does",
            input_schema={
                "type": "object",
                "properties": {
                    "param1": {"type": "string", "description": "..."}
                },
                "required": ["param1"]
            }
        )

    def _execute_sync(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
        # Your implementation
        return {"status": "success", "result": "..."}
  1. 添加 ALL_TOOLS 列表
  2. 测试用 test_tools.py

业绩说明

  • 正在加载数据:快速(佛蒙特州317MB加载在几秒钟内)
  • 搜索:非常快(在内存中过滤134K+个集合)
  • 记忆:随数据集大小缩放(佛蒙特州约500MB RAM)

🤝 贡献

欢迎投稿!拜托:

  1. 分叉存储库
  2. 创建要素分支
  3. 进行更改
  4. 彻底测试
  5. 提交拉取请求

📝 许可证

此项目遵循与 曲率 项目。

🙏 积分

🔗 链接

  • Curvature项目: https://github.com/adamfranco/curvature
  • MCP文件: https://modelcontextprotocol.io/
  • OpenStreetMap数据: https://download.geofabrik.de/
  • 克劳德代码: https://claude.com/claude-code

📧 支持

对于问题和疑问:

______________________________________________________________________

制作❤️ 适合摩托车手和驾驶爱好者

🤖 *生成于 克劳德代码*

目录标签

目录标签

PythonClaude位置天气道路分析本地部署LLM工具OpenStreetMap摩托车路线驾驶路线

支持客户端

Claude

接入字段

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

stdio

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

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdionone部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP