ABAQUS MCP Server for GUI Scripting

ABAQUS MCP Server for GUI Scripting

A server that enables programmatic interaction with an already running Abaqus/CAE GUI application, allowing users to execute Python scripts and retrieve message logs through the Model Context Protocol (MCP).

Category
访问服务器

README

English | 中文

ABAQUS MCP Server for GUI Scripting

An MCP (Model Context Protocol) server designed to interact with an already running Abaqus/CAE Graphical User Interface (GUI). It allows for the execution of Python scripts within the Abaqus environment and retrieval of messages from the Abaqus message log/area, all through MCP tools.

This server uses GUI automation techniques (pywinauto) to control the Abaqus/CAE application.

Features

  • Script Execution in GUI: Executes Python scripts by automating the "File -> Run Script..." menu in an active Abaqus/CAE session.
  • Message Log Retrieval: Attempts to scrape text content from the Abaqus/CAE message/log display area.
  • MCP Interface: Exposes functionalities as standard MCP tools and prompts for easy integration with LLM agents and other MCP-compatible clients.
  • Operates on Existing GUI: Does not start or stop Abaqus/CAE; it requires an Abaqus/CAE session to be already open and running.

System Requirements

  • Operating System: Windows (due to pywinauto and Abaqus GUI interaction).
  • Python: Python 3.7+.
  • Abaqus/CAE: A compatible version of Abaqus/CAE must be installed and already running with its GUI open when using this server.

Python Dependencies

Install the required Python packages using pip:

pip install -r requirements.txt

(See requirements.txt for the list of dependencies, primarily mcp[cli], pywinauto, pygetwindow, psutil, pywin32.)

Configuration

  1. Ensure Abaqus/CAE is Running: Before starting this MCP server, make sure the Abaqus/CAE application is open on your desktop, with the GUI loaded and responsive.
  2. Accessibility: Ensure no other modal dialogs are blocking the Abaqus/CAE interface when the server attempts to interact with it.

Usage

Starting the MCP Server

Navigate to the server's directory and run:

python mcp_server.py

The server will start and be ready to accept MCP requests.

MCP Tools Provided

  1. execute_script_in_abaqus_gui

    • Description: Executes a given Python code string within the active Abaqus/CAE GUI session. It automates the 'File -> Run Script...' menu process.
    • Argument:
      • python_code (str): The Python script content (Abaqus Scripting Interface commands) to be executed.
    • Returns: str - A message indicating the outcome of the script submission attempt (e.g., "Script submitted for execution...").
    • Important: This tool does not return the direct output or error messages from the script's execution within Abaqus. To see the script's actual outcome, you must use the get_abaqus_gui_message_log tool after allowing time for the script to run.
  2. get_abaqus_gui_message_log

    • Description: Attempts to retrieve the text content from the Abaqus/CAE message/log area (usually found at the bottom of the main GUI window).
    • Arguments: None.
    • Returns: str - The extracted text from the message area, or an error/status message if retrieval fails.
    • Note: The reliability of this tool depends on accurately identifying the message area UI element. The current implementation uses heuristics. For robust operation in a specific Abaqus environment, you might need to update the server code with specific UI element identifiers (e.g., AutomationId, Name, ClassName) obtained using an inspect tool (see Development/Troubleshooting).

MCP Prompts Provided

  1. abaqus_scripting_strategy
    • Description: This prompt provides comprehensive guidance on how to best use the server's tools (execute_script_in_abaqus_gui and get_abaqus_gui_message_log) together effectively. It explains the workflow for script execution and result verification, tool assumptions, and troubleshooting tips. It is highly recommended that LLM agents consult this prompt before attempting to use the tools.

Important Considerations & Limitations

  • Requires Running Abaqus GUI: This server only interacts with an Abaqus/CAE session that is already open and has its GUI active and responsive. It cannot start or manage the Abaqus application itself.
  • GUI Automation Sensitivity: GUI automation can be sensitive to the Abaqus version, screen resolution, window themes, and minor UI layout changes. While pywinauto provides a good level of abstraction, issues can still arise.
  • Focus and Window State: The Abaqus window should ideally be the active, non-minimized window for the most reliable interaction, although the server attempts to manage focus.
  • Modal Dialogs: Unexpected modal dialogs in Abaqus (e.g., save reminders, warnings) can block the automation tools.
  • Error Reporting: Differentiate between errors from the MCP tools (e.g., "Abaqus window not found") and errors reported within the Abaqus message log (which originate from your script running inside Abaqus).

Development / Troubleshooting

  • Inspecting UI Elements: If the get_abaqus_gui_message_log tool fails to retrieve messages accurately, or if execute_script_in_abaqus_gui has trouble with the "Run Script" dialog, you may need to use a UI inspection tool (e.g., pywinauto.inspect module's InspectDialog or py_inspect.py script, FlaUInspect for UIA backend) to identify the correct properties (AutomationId, Name, ClassName, ControlType) of the target UI elements in your Abaqus version. These properties can then be used to refine the search logic in mcp_server.py.
  • Timeouts: The server includes some time.sleep() calls and uses pywinauto's Timings.slow() to better handle Abaqus's potentially slow UI response times. These might need adjustment in some environments.

Project Structure

abaqus-mcp-gui-server/
├── mcp_server.py         # The main MCP server script
├── requirements.txt      # Python dependencies
└── README.md             # This documentation file

License

This project is intended for learning, research, and specific automation tasks. When using Abaqus software, always adhere to the licensing terms provided by Dassault Systèmes.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选