opendrive-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opendrive-mcp-serversummarize map /home/user/test.xodr"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opendrive-mcp-server
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.
Related MCP server: OpenStreetMap MCP Server
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/libOpenDRIVEavailable atthird_party/libOpenDRIVEOptional 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 --recursiveIf you are working from a source archive without submodule metadata:
git clone https://github.com/pageldev/libOpenDRIVE third_party/libOpenDRIVEBuild the libOpenDRIVE-backed CLI tools:
cmake -S . -B build
cmake --build buildThe build creates:
build/cpp/opendrive_tools/odr-summarybuild/cpp/opendrive_tools/odr-list-roadsbuild/cpp/opendrive_tools/odr-list-lanesbuild/cpp/opendrive_tools/odr-get-xyzbuild/cpp/opendrive_tools/odr-validate-basic
Run The MCP Server
python -m opendrive_mcp.server --mcpExample 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: convertroad_id,s,t,hto worldx,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.xodrBackend Configuration
The default backend is cli.
To point the Python adapter at a custom CLI directory:
export OPENDRIVE_MCP_CLI_DIR=/path/to/opendrive-toolsFor diagnostics only, the mock backend can be selected explicitly:
export OPENDRIVE_MCP_BACKEND=mockMock 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 scriptsLocal MCP acceptance with Ollama/Qwen:
export OLLAMA_MODEL=qwen2.5:7b
.venv/bin/python scripts/ollama_mcp_acceptance.pySee 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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Dvorak/opendrive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server