Skip to main content
Glama

LS-PrePost-MCP

让支持 MCP 的 AI Agent 通过自然语言操作 LS-PrePost,完成 LS-DYNA 模型检查、有限范围的编辑、结果提取和出图,并返回可核查的产物与日志。

当前为公开开发仓库,版本 v0.4;v0.5 尚未完成。 主要原生证据来自 Windows LS-PrePost 4.13.4;4.10/4.8 的已验证子集见 兼容性。

能做什么

现有入口可处理独立 keyword 模型、集合和部分载荷、网格编辑、节点/实体结果、曲线及图像。带 Include 的保真编辑、接触定义、RCFORC/SECFORC 完整流程仍是缺口。下表按完整任务验收记录状态;“部分实现”应先核对 任务目录 中的限制。

类别

任务

当前状态

目标版本

前处理

P01 模型检视

部分实现

v0.5

前处理

P02 关键字卡片读改增删(Include 保真)

部分实现

v0.5

前处理

P03 材料 / 截面 / Part 创建与关联

部分实现

v0.5

前处理

P04 集合创建

部分实现

v0.5

前处理

P05 边界条件与载荷

部分实现

v0.5

前处理

P06 接触定义与初始穿透检查

部分实现

v0.5

前处理

P07 规则网格生成

部分实现

v0.6

前处理

P08 网格编辑

部分实现

v0.5

前处理

P09 模型检查

部分实现

v0.5

前处理

P10 控制与输出卡

部分实现

v0.5

前处理

P11 保存并原生重开验证

部分实现

v0.5

前处理

P12 运动副与刚体连接

部分实现

v0.5

后处理

Q01 结果概览

部分实现

v0.5

后处理

Q02 云图出图

部分实现

v0.5

后处理

Q03 场数据提取

部分实现

v0.5

后处理

Q04 工程量与失效掩码

已验收

v0.5

后处理

Q05 时程曲线(History)

部分实现

v0.5

后处理

Q06 binout / ASCII 全库曲线

部分实现

v0.5

后处理

Q07 曲线运算

部分实现

v0.5

后处理

Q08 XYPlot 出图

已验收

v0.5

后处理

Q09 动画导出

部分实现

v0.5

后处理

Q10 截面力与剖切面

待实现

v0.6

后处理

Q11 测量

部分实现

v0.6

后处理

Q12 能量检查

部分实现

v0.5

自动化

A01 命令栏 Command(单条原生命令)

已验收

v0.5

自动化

A02 cfile 命令流

已验收

v0.5

自动化

A03 SCL 脚本

已验收

v0.5

自动化

A04 应用内 Python 脚本

已验收

v0.5

自动化

A05 原生宏执行

部分实现

v0.5

自动化

A06 宏安装与快捷键管理

待实现

v0.6

自动化

A07 命令录制转配方

部分实现

v0.5

自动化

A08 配方库

部分实现

v0.5

自动化

A09 参数化批量

部分实现

v0.5

自动化

A10 知识检索

部分实现

v0.5

通用

G01 视图控制

部分实现

v0.5

通用

G02 显示控制

部分实现

v0.6

通用

G03 统一选择器

部分实现

v0.5

通用

G04 实体识别 Identify

部分实现

v0.5

Related MCP server: abaqus-mcp

工作原理

自然语言 → AI Agent → MCP → 原生命令、cfile、SCL、应用内 Python 或读取器 → LS-PrePost 模型与结果。

工具提供执行、观察、验证、知识检索和工程计算。每次作业保留输入身份、命令、日志和产物检查;数值结果标明实际后端。v0.5 将统一为批处理默认、常驻会话可选的执行引擎,当前仍使用各工具既有的执行方式。

快速开始

需要仓库访问权限、Python 3.11+、uv,以及合法安装的 LS-PrePost。Windows 4.13 是当前主要验收环境。

git clone https://github.com/lwz20210407/LS-PrePost-MCP.git
cd LS-PrePost-MCP
uv sync --extra results --extra pydyna

配置安装、输入和产物目录:

$env:LSPP_EXECUTABLE = 'C:\path\to\lsprepost.exe'
$env:LSPP_WORKSPACE = 'D:\lspp-jobs'
$env:LSPP_ALLOWED_ROOTS = 'D:\models;D:\results'
uv run lspp probe_environment

在 Agent 中添加 stdio MCP 服务 uv --directory C:/path/LS-PrePost-MCP run ls-prepost-mcp,传入上述环境变量;安装配套 Skill。完整配置、多版本与精简工具模式见 安装指南。

示例

  • “建立 10×10 mm 的板,划分为 5×5 壳单元,单位 mm-ms-g,保存并重开核对。”

  • “列出这个模型前一百个节点,保留真实节点 ID 和原始坐标。”

  • “用 LASSO 提取指定节点在第 1、2 状态的位移,保留模型单位,并注明读取后端。”

  • “读取已有 LS-PrePost RBDOUT CSV 导出的位移列,显式选择 CSV 格式,保留未知编号和单位声明。”(格式与边界)

  • “读取 NODOUT 中指定节点的原始角速度,保留我声明的单位,不换算角度或坐标系。”(转动分量与边界)

  • “查找 Shell Drag 的官方命令和前置条件。”

可复用输入示例见 examples。执行前应确认模型类型、单位、实体、状态以及工具已验证范围。返回 failed 时查看作业日志和检查结果。

文档

测试

uv run pytest
uv run --extra dev --extra results --extra pydyna pytest

第一条在未装可选后端时跳过相关测试;第二条覆盖这些后端。以上为逻辑测试,原生验证需要 LS-PrePost 安装与专门语料。

使用边界与许可

脚本通道会执行指定代码,不是沙箱;应用层文件范围检查不隔离任意 Python/SCL 的副作用。单位和工程阈值由调用者声明。项目不包含求解器提交,不分发厂商软件、手册和私有模型。

项目代码采用 MIT;第三方命令目录及其条款见 NOTICE。LS-PrePost / LS-DYNA 及相关文档权利归各自所有者。

Available Tools

30 tools
create_elastic_materialC

Create and reimport-check a MAT_001 fragment using optional PyDYNA.

Inputs: units (required), density (required), material_id (required), poisson_ratio (required), +1 more.

create_shell_plateB

Create an XY shell mesh in native LS-PrePost, verify counts and save a new keyword mesh. Not a complete analysis deck.

Inputs: nx (required), ny (required), size (required), units (required), +4 more.

export_keywordC

Save a standalone keyword model into a new owned job. Include-bearing export is rejected.

Inputs: model (required).

extract_binout_curveC

Export a scalar or explicitly ID-selected binout curve through LASSO; never guess an entity column.

Inputs: path (required), units (required), branch (required), variable (required), +1 more.

extract_d3plot_nodalD

Extract vectors through LASSO. Public states are 1-based, IDs are user IDs.

Inputs: path (required), units (required), states (required), node_ids (required), +1 more.

extract_lsreader_nodalC

Extract LS-Reader vectors with 1-based public states and true user IDs.

Inputs: path (required), units (required), states (required), node_ids (required), +1 more.

extract_nodal_resultsB

Extract native position/displacement/velocity at a 1-based state. Older unverified vector ABIs are blocked; use explicit reader tools.

Inputs: state (required), units (required), d3plot (required), node_ids (required), +1 more.

extract_node_historyC

Export native vectors for true user node IDs and explicit 1-based states; tested on the 4.13 profile.

Inputs: units (required), d3plot (required), states (required), node_ids (required), +1 more.

get_element_connectivityA

Query one shell/solid/beam using a user element ID; return connected user node IDs.

Inputs: model (required), element_id (required), file_type, element_type.

inspect_binoutB

List LASSO binout branches/variables from one literal file; reject incomplete MPP shard sets.

Inputs: path (required), branch.

inspect_d3plot_databaseC

Read file metadata through optional LASSO, without launching LS-PrePost.

Inputs: path (required).

inspect_d3plot_sclC

Native SCL inventory with bounded staged input for builds without Python.

Inputs: path (required).

inspect_keyword_deckB

Inventory a deck using PyDYNA; no solver or include expansion is performed.

Inputs: model (required).

inspect_lsreaderC

Inspect a result using LS-Reader in its own configured Python/ABI process.

Inputs: path (required).

inspect_modelC

Open keyword/d3plot in a fresh native Python instance; return counts, user part IDs and state times.

Inputs: model (required), file_type.

list_capabilitiesD

Inputs: no named parameters.

list_installationsA

List configured executables only; file existence is not a compatibility test.

Inputs: no named parameters.

list_jobsC

List recent task manifests in the configured workspace.

Inputs: limit. Returns: result

list_nodesC

Page native user node IDs and reference coordinates. Offset is zero-based; coordinates are not deformed.

Inputs: model (required), limit, offset, file_type.

list_partsC

List native user part IDs and optional names; null names indicate an unavailable binding.

Inputs: model (required), limit, file_type.

measure_partsC

Return raw native part-volume command values; layout/units remain build-dependent and require interpretation.

Inputs: model (required), part_ids (required).

probe_environmentC

Launch a fresh native instance and report its embedded Python; missing empty-model counters are warnings.

Inputs: no named parameters.

probe_sclC

Count nodes in a keyword model through native SCL without requiring embedded Python.

Inputs: model (required).

read_jobB

Read a recorded task including status, errors, log paths and validated artifacts.

Inputs: job_id (required).

render_snapshotC

Render a native PNG. Fringe codes require d3plot/state; shell layer and averaging retain native defaults, not user-specified overrides.

Inputs: model (required), view, state, file_type, +1 more.

run_on_versionC

Run an existing typed action using an explicitly configured installation; no global switch.

Inputs: action (required), version (required), parameters (required).

search_commandsC

Search the attributed Apache-2.0 command catalog; rows are not executable validation.

Inputs: query (required), limit. Returns: result

search_knowledgeD

Inputs: query (required), limit. Returns: result

search_workflowsB

Find authored tutorial acceptance cases; these are not completed automation recipes.

Inputs: query (required), limit. Returns: result

update_elastic_materialC

Modify one elastic material into a fresh deck; preserve the original file.

Inputs: model (required), units (required), density (required), material_id (required), +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.5/5.0

    Scored across 30 tools

    Disambiguation3/5

    Several tools overlap heavily: extract_d3plot_nodal, extract_nodal_results, extract_node_history, and extract_lsreader_nodal all pull nodal data, and the six inspect_* tools (d3plot_scl, d3plot_database, lsreader, binout, keyword_deck, model) target similar inventory goals. Descriptions do differentiate by backend (LASSO/SCL/LS-Reader/PyDYNA), but the distinctions are subtle and easy to misselect on.

    Naming Consistency4/5

    Names follow a clear verb_noun convention (list_parts, inspect_model, create_shell_plate, export_keyword, read_job) consistently in snake_case. Minor deviations like run_on_version and the backend-suffixed inspect_d3plot_scl/extract_lsreader_nodal are still readable and predictable.

    Tool Count3/5

    30 tools is on the heavy side for a single pre/post-processor server, especially with the many parallel inspect_* and extract_* variants multiplied across backends. The breadth is partly justified by the domain's multiple file formats and Python ABI variants, but the set feels over-expanded.

    Completeness4/5

    Coverage spans inspection, extraction, material/mesh creation, keyword export, job management, rendering, and discovery, which is broad for the domain. Gaps exist (no delete/destructive operations and limited model editing beyond elastic material and a shell plate), but core lifecycle workflows are workable.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables an AI assistant to drive Abaqus/CAE through file IPC—sending Python commands, querying model info, submiting jobs, and capturing viewport screenshots—so finite element models can be built and solved without manual GUI interaction.
      2
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables natural-language control of Abaqus/Standard FEA simulations, allowing users to build models, run jobs headlessly, and automatically diagnose and fix solver failures by reading output files and retrying.
      22
      75 PyPI
      4
      AGPL 3.0
    • A
      license
      C
      quality
      B
      maintenance
      Enables AI assistants to control and automate Abaqus/CAE simulations via MCP, including model query, job management, ODB inspection, KPI extraction, capsule tracking, physics contract validation, report generation, and viewport capture. It also supports noGUI batch mode, dual transport, and integration with Codex/Claude clients.
      110
      8
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables driving ANSA's GUI through MCP with 78 tools and 5 resources for modeling, meshing, checks, connections, and scripting, plus embedded ANSA API documentation lookup. Operations execute in the visible ANSA session via a file-based command queue, with pre-execution script validation and cross-session memory.
      13
      -