[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79897":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},79897,"comsol-mcp","777gegewu\u002Fcomsol-mcp","777gegewu","非官方 COMSOL MCP 学习项目：通过 Java Shell 控制已打开的 COMSOL Desktop GUI",null,"Python",108,8,93,1,0,6,11,15,18,61.86,"MIT License",false,"main",[25,26,27,28,29],"codex","comsol","java-shell","mcp","pywinauto","2026-06-12 04:01:25","# COMSOL MCP\n\n[中文说明](README.zh-CN.md)\n\nThis repository contains an MCP server for controlling an already-open COMSOL Desktop GUI through the COMSOL Java Shell.\n\nThis is an unofficial educational project. It is intended for learning, tutorials, and local automation experiments, not as a COMSOL-supported integration.\n\nThe 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`.\n\n## Scope\n\nThis repository currently publishes only the GUI Java Shell MCP implementation.\n\nCOMSOL 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.\n\n## Requirements\n\n- Windows\n- COMSOL Desktop 6.3 or newer\n- COMSOL Desktop and the target model already open\n- Java Shell visible\n\nAutomatic ribbon clicking is disabled by default because localized COMSOL ribbon automation can trigger COMSOL UI errors.\n\n## Setup\n\n```powershell\n.\\setup_venv.ps1\n```\n\nOptional local settings:\n\n```powershell\nCopy-Item .\\env.local.example .\\env.local\n```\n\n## Run\n\n```powershell\n.\\start_server.ps1\n```\n\nCodex global config should point `mcp_servers.comsol_gui` to:\n\n- `E:\\AgentCOMSOL\\AgentCOMSOL-main\\comsol-gui-mcp\\.venv\\Scripts\\python.exe`\n- `E:\\AgentCOMSOL\\AgentCOMSOL-main\\comsol-gui-mcp\\server.py`\n\n## MCP Tools\n\n- `gui_status()` lists COMSOL GUI processes\u002Fwindows and whether Java Shell is visible.\n- `ensure_java_shell()` finds Java Shell and returns a manual action if it is not visible.\n- `execute_java_shell(code, allow_non_model_code=false, timeout_sec=30)` pastes commands and executes them with `Ctrl+Enter`.\n- `set_global_parameter(name, value, description=null)` sets a global parameter through Java Shell.\n- `get_java_shell_output()` tries to read visible Java Shell text through UI Automation.\n\n## Safe Command Policy\n\nBy 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.\n`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.\n\n## First Validation\n\n1. Open COMSOL Desktop and a test model.\n2. Open `Home > Windows > Java Shell`.\n3. Call `gui_status()`.\n4. Call `set_global_parameter(\"codex_gui_mcp_probe\", \"1\")`.\n5. Confirm the parameter appears in the GUI.\n6. Clean up with `execute_java_shell(\"model.param().remove(\\\"codex_gui_mcp_probe\\\");\")`.\n\n## Notice\n\nThis 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.\n\nThe 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.\n","该项目是一个非官方的学习项目，旨在通过Java Shell控制已打开的COMSOL Desktop GUI。核心功能包括通过Codex将COMSOL Java API命令粘贴到当前打开的COMSOL模型的Java Shell中并执行，支持GUI可见编辑、全局参数设置及获取Java Shell输出等功能。技术上采用了Python语言，并利用pywinauto库实现自动化操作。适用于教育场景下的学习、教程演示以及本地自动化实验。需要注意的是，此项目并不适合用于正式的COMSOL集成工作流，且仅在Windows环境下运行，要求COMSOL版本不低于6.3。",2,"2026-06-11 03:58:26","CREATED_QUERY"]