Comsol Codex
БесплатноНе проверенAn MCP server that provides tools for reproducible COMSOL Multiphysics batch workflows, enabling AI agents to compile, run, and diagnose Java API model scripts
Описание
An MCP server that provides tools for reproducible COMSOL Multiphysics batch workflows, enabling AI agents to compile, run, and diagnose Java API model scripts with COMSOL.
README
An MCP server and agent toolkit for reproducible COMSOL Multiphysics batch workflows.
This project is intentionally generic. It does not encode one specific COMSOL model. Instead, it gives AI agents a safe, auditable way to:
- discover a local COMSOL installation;
- compile Java API model scripts with
comsolcompile; - run compiled classes with
comsolbatch; - monitor and diagnose logs;
- search COMSOL completion XML for Java API feature/property names;
- collect lightweight result packages while excluding
.mph, raw dumps, logs, and generated classes; - expose reusable COMSOL automation recipes to Codex/Claude-style agents through MCP tools.
Why This Exists
Several COMSOL MCP projects focus on GUI automation or Python MPh/mphserver workflows. This project focuses on the engineering loop that coding agents often need:
write Java API model -> compile -> batch run -> inspect log -> parse output -> package results
That loop is useful for long-running, reproducible simulation jobs where opening COMSOL Desktop is undesirable or impossible.
Install
python -m pip install -e .
To run as an MCP server:
python -m pip install -e ".[mcp]"
comsol-mcp-server
To use the standalone CLI:
comsol-tool find-install
comsol-tool search-feature ThermalContact
comsol-tool inspect-log path/to/batch.log
Documentation
- Quickstart
- Tool reference
- Architecture
- Recipes
- Safety
- Compatibility
- Comparison with related projects
- Examples
- Roadmap
- Contributing
- Security policy
MCP Tools
The server exposes:
| Tool | Purpose |
|---|---|
comsol_find_install |
Locate comsolcompile, comsolbatch, and comsol |
comsol_compile |
Compile a COMSOL Java API model |
comsol_batch |
Run a compiled class with comsolbatch |
comsol_tail_file |
Read the tail of a log/output file |
comsol_inspect_log |
Detect common COMSOL errors and progress markers |
comsol_search_feature |
Search physics.xml/common.xml for Java API hints |
comsol_collect_outputs |
Zip lightweight scripts/summaries/CSV outputs |
comsol_clean_generated |
List or remove generated class/status/recovery files |
comsol_list_recipes |
List built-in workflow recipes |
comsol_get_recipe |
Read a built-in workflow recipe |
Example Agent Workflow
- Call
comsol_find_install. - Ask the model to generate or modify a Java API script.
- Call
comsol_compile. - If compilation fails, use the compiler output and
comsol_search_feature. - Call
comsol_batchwith a bounded timeout. - If the run is slow or fails, call
comsol_inspect_log. - Parse model stdout with a project-specific parser.
- Call
comsol_collect_outputsto create an uploadable result bundle.
COMSOL Setup
The install finder checks:
COMSOL_HOMECOMSOL_ROOTPATH- common Windows locations such as
C:\Program Files\COMSOLandE:\Program Files\COMSOL - common Linux locations such as
/usr/local/comsoland/opt/comsol
If discovery fails, set:
COMSOL_HOME=/path/to/COMSOL63
On Windows PowerShell:
$env:COMSOL_HOME = "E:\Program Files\COMSOL\COMSOL63"
Safety Model
This toolkit is deliberately conservative:
- it uses
subprocess.run([...], shell=False); - it keeps compile/run operations explicit;
- it separates stdout, stderr, and batch logs;
- it excludes heavy/generated files from packages by default;
- it provides diagnostics rather than hiding COMSOL failures.
You should still run it only on trusted COMSOL Java scripts. A COMSOL Java class can create, solve, and save models on your machine.
What This Is Not
- It is not a replacement for COMSOL Desktop.
- It is not a universal physics model generator.
- It does not ship COMSOL, licenses, or proprietary documentation.
- It does not guarantee that a generated Java API script is physically valid.
Related Work
Existing public projects include GUI-driven COMSOL MCP servers, MPh/mphserver-based MCP servers, and Pythonic COMSOL scripting interfaces. This project aims to complement them with a batch-first, Codex-friendly, reproducible Java API workflow.
Trademark Notice
COMSOL and COMSOL Multiphysics are trademarks or registered trademarks of COMSOL AB. This project is independent and unofficial. See NOTICE.md.
Установка Comsol Codex
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/XiaoSe532/comsol-codex-mcpFAQ
Comsol Codex MCP бесплатный?
Да, Comsol Codex MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Comsol Codex?
Нет, Comsol Codex работает без API-ключей и переменных окружения.
Comsol Codex — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Comsol Codex в Claude Desktop, Claude Code или Cursor?
Открой Comsol Codex на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Comsol Codex with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
