
BioMASS ODE Model Builder
io.github.marcoruscv2.4.0更新于 Oct 1, 2026
Construct, inspect, visualize, and simulate evidence-backed ODE models with BioMASS
概览
使用 BioMASS 与 Text2Model 构建、检查、可视化并模拟有证据支持的 ODE 模型。
- 功能
- 这是一个有状态的 MCP 服务器,用于依据文献证据构建常微分方程模型。它提供 22 个工具,覆盖会话、编写、检查、生成、可视化、模拟和产物管理。助手可导入网络或 Text2Model 文档、附加证据、构建反应、配置观测量与条件、校验、生成、渲染图形并运行有界模拟。导出包包含生成的 Python、证据、覆盖率、图形和已保存的运行。
- 适用场景
- 当助手需要把整理好的生物网络或论文转化为可执行的 BioMASS ODE 模型并进行探索时使用。适合重视证据关联、覆盖率报告和可复现模拟运行的机制建模流程。v1 不包含参数校准和敏感性分析。
- 运行要求
- 通过 stdio 在本地运行,从 PyPI 安装 mcp-biomodelling-servers,并用 uvx 或 mcp-biomass-server 命令启动。图形渲染需要可选的 biomass-graph 附加组件以及 Graphviz 系统运行时和 dot;从源码构建 PyGraphviz 可能需要 C 编译器和开发头文件。交互式 HTML 图形会加载 JavaScript CDN,打开时需要网络访问。未声明账户、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 BioMASS ODE Model Builder,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
BioMASS ODE Model Builder
A stateful MCP server for evidence-backed ODE construction using BioMASS 0.14 and Text2Model. It supports model inspection, graph visualization, export, and bounded exploratory simulation. The calling agent reads literature and proposes mechanisms. Calibration and sensitivity analysis are outside v1.
Installation
For graph rendering:
Install the Graphviz system runtime too. Building PyGraphviz from source may
require a C compiler, Python development headers, and Graphviz development
headers (for example, graphviz libgraphviz-dev build-essential on Debian/Ubuntu).
If graph dependencies are unavailable, construction and simulation still work.
Example MCP client configuration with visualization enabled:
From a source checkout, install with python -m pip install '.[dev,biomass-graph]'
and run python -m BioMASS.server. The repository's wheel path remapping does
not support editable installs.
NeKo workflow
- Curate a network in NeKo, then call its
export_biomass_handoffwith the biological context. The export preserves nodes, stable edge IDs, references, and available mechanism/context columns. It does not require connectivity. create_session, thenimport_neko_handoffwith the returned manifest path. Import verifies artifact integrity and stores a durable copy of the network and provenance inside the authoring snapshot.- Read papers with the calling agent's literature tools.
set_evidencestores source identifiers, supporting passages or summaries, locations, biological context, limitations, and supporting/contradicting/context-only stances. build_reactionsadds or edits reactions;set_reactionsreplaces the complete list. Each record has a stable ID, Text2Model statement, originating edges, evidence IDs, and a supported/assumed/unreviewed status. Scientific annotations are optional and supplied by the agent; new records default to unreviewed. These links may be many-to-many; uncovered edges remain in the coverage report.configure_modelsets observables, time span, conditions, numerical defaults, units, and quantity provenance. It replaces the complete configuration.- Inspect, validate, generate, visualize, optionally simulate, and export.
Reaction example (IDs must correspond to imported edges and stored evidence):
Use share_parameters_with to refer to an earlier reaction ID. The renderer
resolves that ID to the correct Text2Model line number. Numeric sharing in
reaction records is rejected. Complete replacement with set_reactions clears numerical overrides and
conditions because generated parameter names depend on line numbers; reapply
those settings after inspecting the revised model.
For conversational construction, call create_session, then build_reactions
with templates or raw statements. inspect_reactions returns stable IDs and
generated symbols. Preview a batch using expected_version, then apply with
preview=false. Incremental edits retain compatible numerical settings. Read
model editing or docs://biomass/model_editing for details.
The agent chooses kinetics and any scientific annotations; the server validates
syntax, references, dependencies, and execution.
Standalone text workflow
import_text preserves a complete Text2Model document verbatim, including
comments, directives, and numeric line references. Replacing a document also
replaces its line-evidence mapping and clears the old configuration. Evidence
can be stored before import, then linked by line number. In document mode,
put observables, simulation conditions, and time span in the text itself;
configure_model can override numeric defaults and record units/provenance.
import_text_file reads an existing UTF-8 file into the session with its source
path and hash. build_reactions can expand or edit it while preserving untouched
lines and parameter references. The original file is never modified. Removals
leave comment lines so later line numbers remain stable; dependent observables
and conditions must be repaired explicitly in the same batch.
examples/enzyme.txt is a small executable enzyme model. It specifies all three parameters, all four initial values (including zeros), and the time span, so it runs without opting into placeholder values.
Pass that object to run_simulation after generate_model. For explicitly
hypothetical runs, set scenario.allow_placeholders to true. A supplied or
assumed value is distinguished from a Text2Model placeholder. Literature-derived
quantities require evidence IDs. Unspecified units remain explicit null values.
Scenario overrides replace generated defaults before condition assignments. Each condition starts from fresh defaults. The actual parameters and initial values used for each solve, including steady-state preparation, are recorded. Parameter-sharing constraints remain effective; override their source parameter. Simulation produces complete species and observable CSV tables, a trajectory preview (up to 20 species), and a numerical scenario report.
Graph visualization
visualize_model(format="png"): default static graph and MCP image content.visualize_model(format="svg"): scalable static graph.visualize_model(format="html"): interactive graph; no browser is opened.export_model_graph: DOT for external graph software.
Static layouts are dot (default), neato, fdp, circo, and twopi.
HTML optionally exposes physics/layout controls. Layout selection applies to
static formats. Interactive HTML references the vis-network JavaScript and stylesheet CDN used by
BioMASS’s supported PyVis version; opening it requires network access. Graph artifacts are linked to an immutable model
revision and are included in that revision's exported bundle.
BioMASS projects reactants and modifiers onto products, combining repeated species connections. It does not distinguish reactants from modifiers, or activating from inhibiting modifiers. Therefore this visualization is not a complete reaction graph or a signed causal network. Unresolved NeKo edges remain in coverage reports. An interactive graph is not a simulation animation. See the upstream graph tutorial.
Tools and resources
The server exposes 22 tools:
Read docs://biomass/agent_manual or request biomass_workflow_prompt for agent
instructions. Session resources expose /model, /evidence, /coverage,
/files, and /revision/{revision} under biomass://session/{session_id}.
Before writing reactions, agents should read these offline MCP resources:
These references ship with the server and are linked from its initialization instructions, agent manual, workflow prompt, and authoring tool descriptions. They document the supported BioMASS 0.14 subset. A separate skill is not required. The syntax examples are converted in tests; the complete example workflows are also generated and simulated. Signed edges do not automatically determine mechanisms, kinetic laws, or one reaction per edge.
Revisions, validation, and limits
Each session has locked authoring state and a durable JSON snapshot. Workers use separate directories and fresh interpreters. Generated revisions have integrity inventories; authoring edits clear the current revision pointer but retain previous revisions. Explicitly select an old revision to inspect its original model and evidence. Failed jobs retain only diagnostic logs.
Syntax validity, generation success, evidence coverage, and numerical execution
are separate results. None establishes biological validity. Validation with
check_generation=true uses a disposable worker and publishes no revision.
Accepted expressions contain finite constants, arithmetic, and model-symbol
references (p[name], u[name], init[name] where applicable). Python calls,
attributes, imports, and arbitrary Python model packages are unsupported.
Identifiers start with a letter and use letters, digits, and single underscores.
Numerical reaction values must be finite and nonnegative.
Workers default to 60 seconds, configurable from 1 to 300 seconds. v1 limits: 1 MiB / 2000 text lines, 500 species / 1000 reactions, 20 conditions, and 10001 integer time samples. Timeouts terminate the worker and its child processes on POSIX systems. These processes isolate runtime state; they are not an OS sandbox.
Exports include generated Python, original text, numerical configuration,
evidence, assumptions, coverage, version metadata, graphs, and saved runs.
Extract the ZIP and run python run_simulation.py to list saved scenarios, then
python run_simulation.py simulate_<run_id> to reproduce one. The script uses
the recorded actual numerical conditions. requirements.txt pins BioMASS 0.14.0.
Closing a session preserves artifacts; cleanup preserves authoring and lineage
while removing generated revisions and runs.
来源:BioMASS/README.md,提交 0d5af4b
工具
0版本历史
1- v2.4.0最新Oct 1, 2026


