Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Opendrive Server

БесплатноНе проверен

Enables querying OpenDRIVE road network files through structured MCP tools for summarizing maps, listing roads and lanes, converting coordinates, and validating

GitHubEmbed

Описание

Enables querying OpenDRIVE road network files through structured MCP tools for summarizing maps, listing roads and lanes, converting coordinates, and validating files.

README

opendrive-mcp-server exposes deterministic OpenDRIVE inspection tools through the Model Context Protocol (MCP). It is designed for agents and applications that need structured road-network queries without asking an LLM to parse or edit .xodr XML directly.

The first-stage backend is pageldev/libOpenDRIVE, called through small C++ CLI tools. The default backend is the real libOpenDRIVE-backed cli backend; mock output is not valid acceptance evidence.

This project is not affiliated with the original libOpenDRIVE project unless stated otherwise.

What It Does

  • Opens OpenDRIVE files with libOpenDRIVE.
  • Lists roads and lanes.
  • Converts OpenDRIVE road coordinates to world coordinates.
  • Runs basic parse and road/lane sanity checks.
  • Returns machine-readable JSON through MCP tools.
  • Writes trace records to runs/<run_id>/trace.jsonl.

What It Does Not Do

  • It does not edit OpenDRIVE XML.
  • It does not provide an OpenDRIVE XML generation reference for LLMs.
  • It does not accept free-form natural-language map modification requests.
  • It does not generate OpenSCENARIO.
  • It does not contain scenario-specific business logic.
  • It does not call LLMs inside the MCP server.

Requirements

  • Python 3.11+
  • CMake with a C++17 compiler
  • pageldev/libOpenDRIVE available at third_party/libOpenDRIVE
  • Optional for local acceptance: Ollama with a local Qwen model

Install

python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"

Fetch the first-stage backend. If you cloned this repository with submodules:

git submodule update --init --recursive

If you are working from a source archive without submodule metadata:

git clone https://github.com/pageldev/libOpenDRIVE third_party/libOpenDRIVE

Build the libOpenDRIVE-backed CLI tools:

cmake -S . -B build
cmake --build build

The build creates:

  • build/cpp/opendrive_tools/odr-summary
  • build/cpp/opendrive_tools/odr-list-roads
  • build/cpp/opendrive_tools/odr-list-lanes
  • build/cpp/opendrive_tools/odr-get-xyz
  • build/cpp/opendrive_tools/odr-validate-basic

Run The MCP Server

python -m opendrive_mcp.server --mcp

Example MCP client configuration:

{
  "mcpServers": {
    "opendrive": {
      "command": "python",
      "args": ["-m", "opendrive_mcp.server", "--mcp"],
      "cwd": "/path/to/opendrive-mcp-server"
    }
  }
}

Available Tools

  • summarize_map: summarize road count, junction count, and total road length.
  • list_roads: list road IDs, names, lengths, and junction IDs.
  • list_lanes: list lanes for one road.
  • get_xyz: convert road_id, s, t, h to world x, y, z.
  • validate_basic: run basic parse and road/lane sanity checks.

See docs/mcp_tools.md for schemas and example responses.

Command-Line Examples

python -m opendrive_mcp.server summarize_map third_party/libOpenDRIVE/tests/test.xodr
python -m opendrive_mcp.server list_roads third_party/libOpenDRIVE/tests/test.xodr
python -m opendrive_mcp.server list_lanes third_party/libOpenDRIVE/tests/test.xodr 17
python -m opendrive_mcp.server get_xyz third_party/libOpenDRIVE/tests/test.xodr 17 2.1 1.0 0.0
python -m opendrive_mcp.server validate_basic third_party/libOpenDRIVE/tests/test.xodr

Backend Configuration

The default backend is cli.

To point the Python adapter at a custom CLI directory:

export OPENDRIVE_MCP_CLI_DIR=/path/to/opendrive-tools

For diagnostics only, the mock backend can be selected explicitly:

export OPENDRIVE_MCP_BACKEND=mock

Mock results are not accepted for real backend validation.

Test

.venv/bin/python -m pytest
.venv/bin/python -m ruff check .
.venv/bin/python -m compileall src tests scripts

Local MCP acceptance with Ollama/Qwen:

export OLLAMA_MODEL=qwen2.5:7b
.venv/bin/python scripts/ollama_mcp_acceptance.py

See docs/local_acceptance.md for details.

Documentation

  • docs/mcp_tools.md: MCP tool schemas and examples.
  • docs/architecture.md: high-level architecture.
  • docs/libopendrive_backend.md: backend integration notes.
  • docs/supported_opendrive_subset.md: supported OpenDRIVE assumptions.
  • docs/traceability.md: trace record behavior.
  • docs/local_acceptance.md: local Ollama/Qwen acceptance path.
  • docs/tool_admission_policy.md: maintainer policy for adding tools.
  • CONTRIBUTING.md: contribution and validation rules.

License

This repository is Apache-2.0. pageldev/libOpenDRIVE is also Apache-2.0 licensed.

from github.com/Dvorak/opendrive-mcp

Установка Opendrive Server

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/Dvorak/opendrive-mcp

FAQ

Opendrive Server MCP бесплатный?

Да, Opendrive Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Opendrive Server?

Нет, Opendrive Server работает без API-ключей и переменных окружения.

Opendrive Server — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Opendrive Server в Claude Desktop, Claude Code или Cursor?

Открой Opendrive Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Opendrive Server with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development