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.0
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.0.tar.gz | 69.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yudeshi1314520_mcp_dd_simulation-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.3 kB
Release files / yudeshi1314520_mcp_dd_simulation-0.2.0.tar.gz
| Download URL | yudeshi1314520_mcp_dd_simulation-0.2.0.tar.gz |
|---|---|
| Size | 69.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21bc75d939fa466b79e6b9f27a5348bdcc6ba05f9f4bf68105dfa9f713dc1f25
|
|
BLAKE2b-256 checksum How to use checksums |
6a4d93fadb5f06a6cde5d85259244c589d10ea9d103b140c2cc5a78f2c411af3
|
| 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.0-py3-none-any.whl
| Download URL | yudeshi1314520_mcp_dd_simulation-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57d115eed967d0d078772bb5d1af25d4ad70250323ffc4d0983f80160ee5a2d7
|
|
BLAKE2b-256 checksum How to use checksums |
0d403f37fe0bf5b9ebfd9d3862731a39e512346737dd3b16d5b1f061b96a4a96
|
| 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}
|