AgentStack
MCP verified MIT Self-run

Comsol Mcp

mcp-777gegewu-comsol-mcp · by 777gegewu

非官方 COMSOL MCP 学习项目:通过 Java Shell 控制已打开的 COMSOL Desktop GUI

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add mcp-777gegewu-comsol-mcp

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Comsol Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

COMSOL MCP

[中文说明](README.zh-CN.md)

This repository contains an MCP server for controlling an already-open COMSOL Desktop GUI through the COMSOL Java Shell.

This is an unofficial educational project. It is intended for learning, tutorials, and local automation experiments, not as a COMSOL-supported integration.

The server is designed for GUI-visible edits: Codex pastes COMSOL Java API commands into the Java Shell of the currently open COMSOL Desktop model, then executes them with Ctrl+Enter.

Scope

This repository currently publishes only the GUI Java Shell MCP implementation.

COMSOL can also be controlled through the Python mph package in a background workflow, but that implementation is not included here. If you need the background route, keep it as a separate project with its own source ownership and license review.

Requirements

  • Windows
  • COMSOL Desktop 6.3 or newer
  • COMSOL Desktop and the target model already open
  • Java Shell visible

Automatic ribbon clicking is disabled by default because localized COMSOL ribbon automation can trigger COMSOL UI errors.

Setup

.\setup_venv.ps1

Optional local settings:

Copy-Item .\env.local.example .\env.local

Run

.\start_server.ps1

Codex global config should point mcp_servers.comsol_gui to:

  • E:\AgentCOMSOL\AgentCOMSOL-main\comsol-gui-mcp\.venv\Scripts\python.exe
  • E:\AgentCOMSOL\AgentCOMSOL-main\comsol-gui-mcp\server.py

MCP Tools

  • gui_status() lists COMSOL GUI processes/windows and whether Java Shell is visible.
  • ensure_java_shell() finds Java Shell and returns a manual action if it is not visible.
  • execute_java_shell(code, allow_non_model_code=false, timeout_sec=30) pastes commands and executes them with Ctrl+Enter.
  • set_global_parameter(name, value, description=null) sets a global parameter through Java Shell.
  • get_java_shell_output() tries to read visible Java Shell text through UI Automation.

Safe Command Policy

By default, execute_java_shell only accepts non-empty executable lines that start with model.. Use allow_non_model_code=true only when you intentionally need broader Java Shell commands. execute_java_shell rejects COMSOL save calls such as model.save(...) and ModelUtil.save(...); GUI edits should be verified through the MCP and then saved manually by the user in COMSOL Desktop.

First Validation

  1. Open COMSOL Desktop and a test model.
  2. Open Home > Windows > Java Shell.
  3. Call gui_status().
  4. Call set_global_parameter("codex_gui_mcp_probe", "1").
  5. Confirm the parameter appears in the GUI.
  6. Clean up with execute_java_shell("model.param().remove(\"codex_gui_mcp_probe\");").

Notice

This is not an official COMSOL project and is not affiliated with, endorsed by, or supported by COMSOL AB. COMSOL product names and trademarks belong to their respective owner.

The code is provided for learning and tutorial use under the MIT License. Use it with local test models first, and review generated Java API commands before applying them to important COMSOL models.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.