mcp-dd-simulation
MCP Server for DD Unity 6-DOF ballistic simulation.
通过 MCP 协议调用 DD_Unity.exe 弹道仿真引擎,支持 Claude Code、Claude Desktop 等任何兼容 MCP 的 AI 客户端。
服务提供三个工具:
get_sim_spec:返回参数规范、经验规则和示例请求。preview_sim:校验仿真设计并补全默认参数,不启动仿真。run_sim:读取指定 JSON 文件,校验参数并执行弹道仿真。
前置条件
- 将
DD_Unity.exe放在本地(需包含--run-once模式) - 设置环境变量
DD_UNITY_EXE_PATH指向 EXE 路径
安装
uv sync
uv run mcp-dd-simulation
默认使用 stdio。如需独立 HTTP 服务:
uv run mcp-dd-simulation --transport streamable-http
默认地址为 http://127.0.0.1:8000/mcp。可用环境变量:
MCP_HOST、MCP_PORT、MCP_TRANSPORT
Claude Code 配置
在 .claude.json 或项目的 .mcp.json 中添加:
{
"mcpServers": {
"dd-simulation": {
"command": "uvx",
"args": ["--from", "yudeshi1314520-mcp-dd-simulation", "mcp-dd-simulation"],
"env": {
"DD_UNITY_EXE_PATH": "D:\\弹道联合Unity仿真\\Unity\\DD_UnityQ\\DD_app\\DD_Unity.exe"
}
}
}
}
使用流程
建议先调用 get_sim_spec 获取参数规范;preview_sim 和 run_sim 只需传入 json_path,其值为仿真请求 JSON 文件路径。校验通过后再执行仿真。
仿真请求 JSON 示例
{
"schema_version": "1.0",
"design_conditions": {
"scenario": "intercept",
"description": "高空拦截"
},
"parameters": {
"Target": {
"target_position": [80000.0, 80000.0, -20000.0],
"target_vel": [-200.0, -200.0, 0.0]
},
"Initial": {
"Xme0": [0.0, 0.0, -7000.0],
"Vme0": [400.0, 0.0, 0.0]
}
}
}
只填必填参数即可,其余参数由默认值自动补全。
参数分组
| 分组 | 说明 |
|---|---|
| Missile | 质量、参考面积/长度、重心、惯性张量 |
| Initial | 初始位置、初始速度 |
| Target | 目标位置、目标速度(必填) |
| Guidance | 导航指令类型、导航增益、高度/速度指令 |
| Controller | P/I 控制器增益(15 个参数) |
| Simulation | 仿真时长、速度倍率、命中距离、CSV 导出 |
坐标系:NED(北-东-地),X=北,Y=东,Z=下(-Z=高度)。
Metadata
Release files for yudeshi1314520-mcp-dd-simulation 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yudeshi1314520_mcp_dd_simulation-0.2.1.tar.gz | 69.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yudeshi1314520_mcp_dd_simulation-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.8 kB
Release files / yudeshi1314520_mcp_dd_simulation-0.2.1.tar.gz
| Download URL | yudeshi1314520_mcp_dd_simulation-0.2.1.tar.gz |
|---|---|
| Size | 69.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a75f01ce19294af31687a883ca223642c8e3619d6a9ddcf89ded38df4aef177
|
|
BLAKE2b-256 checksum How to use checksums |
f04972bd97df976839fe9a28d2e6c81b437a287ba62aae1455a7d79e54e78a1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / yudeshi1314520_mcp_dd_simulation-0.2.1-py3-none-any.whl
| Download URL | yudeshi1314520_mcp_dd_simulation-0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f09a6b9ed3cc572b98b8dd008a804a2ffac65c4bfef2921a2f9ed7a32e720487
|
|
BLAKE2b-256 checksum How to use checksums |
afe276d16015ce3661236cfac66d245f45f34f537febf4276cdf7600a4243840
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|