
MaBoSS Boolean Network Simulator
io.github.marcorusc由 GitHub 帳號 marcorusc 發布v2.5.2更新於 Oct 30, 2026
MCP server for Boolean network simulation and attractor analysis using MaBoSS
概覽
透過 MaBoSS 執行隨機布林網路模擬與吸引子分析,讓助理建構、設定、模擬並匯出生物模型。
- 可以做什麼
- 建立、列出、切換與刪除記憶體中的 MaBoSS 工作階段及其產物檔案
- 將 BNET 模型轉換為 BND/CFG 並載入,或匯入經驗證的 NeKo 交接包
- 檢視節點、初始狀態機率、邏輯規則與已存突變
- 修改規則、讀數、參數、輸出節點與初始狀態分布
- 執行模擬與突變副本,讀取狀態機率表並產生軌跡圖
- 匯出 BND/CFG 檔案或具完整性校驗的 PhysiCell 交接包,並列出或清理產物
- 適用情境
- 適合計算生物學情境:需要助理建構並執行布林網路模型、探索吸引子與突變影響,或在 NeKo 到 MaBoSS 再到 PhysiCell 的建模流程中傳遞模型。
- 執行需求
- 以 Python 套件 mcp-biomodelling-servers 形式透過 stdio 在本機執行,使用 mcp-maboss-server 指令或 uvx 啟動。依賴 pyMaBoSS 及其編譯引擎 cmaboss,不需另外安裝 MaBoSS 執行檔。未宣告驗證、環境變數或標頭;產物儲存可用 MCP_BIOMODELLING_ARTIFACT_ROOT 重新指定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 MaBoSS Boolean Network Simulator,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MaBoSS MCP Server
The Wave 2 integration guide covers summary readouts, named rate editing, persistent run IDs, bounded results and handoff 2.1.
The MaBoSS server exposes stochastic Boolean-model construction, configuration, simulation, analysis, and export through the Model Context Protocol (MCP). It uses pyMaBoSS as its simulation engine and can participate in a verified modelling pipeline from NeKo to MaBoSS to PhysiCell.
The server is distributed in the
mcp-biomodelling-servers
Python package and communicates over stdio.
Installation and startup
Install all three bio-modelling servers:
Start the installed MaBoSS server:
Alternatively, run it in an isolated environment:
The server does not need the separate MaBoSS executable. It validates and
simulates models with cmaboss, the compiled engine installed with pyMaBoSS,
in a child Python process so a long simulation never blocks the server. Loading
a model that the engine rejects fails with the engine's message.
See the repository README for the supported Python versions, complete MCP client configuration, source-checkout instructions, and shared runtime behavior.
Sessions and model state
Every model belongs to a MaBoSS session. Start by calling
create_session(), retain the returned session_id, and pass it explicitly
when more than one model is active. When session_id is omitted, tools use the
active default session.
create_sessioncreates an isolated in-memory session and may attach a human-readable label.list_sessionsreports active sessions and whether each has a model or simulation result.list_artifact_sessionsdiscovers session artifacts left by earlier server processes.set_default_sessionselects the session used by calls that omitsession_id.delete_sessionremoves in-memory state and, by default, its artifact files.
Generated BND, CFG, CSV, PNG, and handoff files are stored under the server's
session-scoped artifacts/<session_id>/ directory. Use
list_generated_files() to obtain their resolved paths instead of guessing
them.
Recommended standalone workflow
For a standalone BNET model, use the following order:
- Call
create_session(). - Convert the BNET with
bnet_to_bnd_and_cfg(bnet_path). - Load the generated files with
build_simulation(). - Call
get_maboss_nodes()and use only the returned node names. - Inspect the current configuration with
update_maboss_parameters(),get_maboss_initial_state(), andget_maboss_logical_rules(). - Select a small, biologically meaningful set of outputs with
set_maboss_output_nodes(...). - Optionally update parameters, initial-state probabilities, or logical rules.
- Call
run_simulation(). - Read numerical results with
get_simulation_result(). - Render the trajectory with
visualize_network_trajectories(). - Export updated BND/CFG files or a typed PhysiCell handoff when needed.
bnet_to_bnd_and_cfg() writes output.bnd and output.cfg into the session
artifact directory. With no paths supplied, build_simulation() automatically
loads those files. If the server cannot read your BNET file (a host that
sandboxes each server), pass its complete content as bnet_text instead of
bnet_path; it is stored verbatim in the session artifact directory.
A Boolean network with N visible outputs can produce up to 2^N states. Always call
set_maboss_output_nodes()beforerun_simulation(). Selecting only the outputs needed for the scientific question reduces both runtime and result size.
Inspecting and configuring a model
Simulation parameters
Call update_maboss_parameters() without a parameters value to inspect all
parameters supported by the loaded model. Supply only the values that should
change:
Common parameters include:
The server also accepts backend parameters exposed by the loaded MaBoSS version. Unknown parameter names produce a recoverable tool error.
Output nodes
First call get_maboss_nodes(), then provide a non-empty subset:
Initial-state probabilities
Inspect the existing distribution with get_maboss_initial_state() before
changing it.
For one node, provide [P(OFF), P(ON)]:
For multiple nodes, use JSON-native state/probability records. State-vector
order must match the order in nodes, each state must contain only 0 or 1,
and the probabilities must sum to 1:
The listed states do not have to cover every possible combination, but states
must be unique and each vector must have the same length as nodes.
Logical rules and mutations
get_maboss_logical_rulesreturns the current Boolean rules, up to 100 nodes unlessselected_nodesis given (truncatedreports when more exist). Arule_limitationmarks nodes whose custom rate expressions mean the rule alone does not describe their switching; inspect those withget_maboss_nodes.change_maboss_rulereplaces one node's rule and restores the previous rule if model validation rejects the change.get_maboss_mutationsreports mutations currently stored in the model.simulate_mutationruns a mutant copy without changing the session's base simulation.
For example:
Mutation states are ON, OFF, or WT. A single state may be applied to all
requested nodes, or a state list may be supplied in node order.
Running and reading a simulation
run_simulation() executes the loaded model in a worker thread, stores the
pyMaBoSS result in the session, reports MCP progress, and writes a non-empty
state-probability table to result.csv.
get_simulation_result() returns both:
- a Markdown state-probability table for the model to read; and
- JSON-native structured content containing the numerical trajectory table.
The same Markdown result is available through
maboss://session/{session_id}/result.
Native trajectory images
After run_simulation(), call:
on visualize_network_trajectories.
The optional until parameter is the maximum simulation time displayed. It
must be a finite number greater than zero. Omit it to plot the full available
trajectory.
The tool:
- delegates trajectory drawing to pyMaBoSS
plot_trajectory(until=...); - uses a tight bounding box and padding so legends outside the axes are not cropped;
- returns the PNG as an MCP
ImageContentblock with MIME typeimage/png; - returns text plus structured metadata for the session, time window, and artifact; and
- saves the exact same PNG bytes as
network_trajectory.pngin the session artifact directory.
An MCP client must support rendering image content blocks to display the plot inline. The saved artifact remains available when a client presents only the textual or structured part of the result.
Cross-server handoffs
NeKo to MaBoSS
Prefer import_neko_handoff(manifest_path) when the Boolean model comes from
the NeKo MCP server. The tool:
- validates the
neko-to-mabossmanifest and artifact hashes; - converts the referenced BNET into MaBoSS BND and CFG files;
- verifies the converted node set;
- applies output nodes declared by NeKo when present;
- loads the model only after the complete import succeeds; and
- retains the NeKo provenance for a later PhysiCell handoff.
If the manifest declares no output nodes, call set_maboss_output_nodes()
before running or exporting the model.
If this server cannot read NeKo's files (a host that sandboxes each server),
pass handoff_bundle, the object returned by NeKo export_handoff_bundle,
instead of manifest_path. See
Hosts that sandbox each server.
MaBoSS to PhysiCell
Call export_maboss_handoff(target_cell_type=...) to produce an
integrity-protected maboss-to-physicell handoff. It snapshots:
- the current BND and CFG model;
- MaBoSS parameters and selected output nodes;
- an optional non-empty simulation-result CSV;
- the intended PhysiCell cell type and biological context; and
- the complete upstream NeKo lineage, when one was imported.
A standalone MaBoSS model must provide biological_context. A model imported
from NeKo may inherit that context. The export refuses to overwrite existing
handoff artifacts, so choose a new artifact_prefix for every retained
handoff.
For a PhysiCell server that cannot read MaBoSS's files, call
export_handoff_bundle(manifest_path=...) here and pass the result to
import_maboss_handoff(handoff_bundle=...). The bundle also carries the NeKo
parent manifest and its files.
Use export_maboss_bnd_cfg() when only standalone MaBoSS files are needed.
Use export_maboss_handoff() when PhysiCell needs typed scientific context,
integrity metadata, and provenance.
Tool reference
Resources and prompt
The server exposes read-only resources for clients that support MCP resource templates:
maboss_workflow_prompt exposes the same recommended operating rules as an
MCP prompt.
Preserved simulation runs
Each successful file-backed run_simulation and simulate_mutation call
preserves a unique run_<uuid> artifact set before pyMaBoSS releases its
temporary directory:
- Exact BND/CFG inputs sent to the engine (for mutant runs, the mutated copy) and the engine's actual output files.
- Full state-probability and node-marginal CSV tables, including their original
time index labelled
Time. - A JSON inventory with session/run identity, run kind, source model revision, requested mutations, effective configuration (parameters, rates, initial state, outputs, readouts), reported timepoints, file sizes and SHA-256 hashes. The inventory is published after its files.
Both tools return the run ID. get_simulation_result(run_id=...) and
visualize_network_trajectories(run_id=...) read a saved run from disk after
verifying its integrity, including after a server restart, without rerunning the
engine. Omitting run_id selects the latest ordinary run of the session and
reports the resolved ID; mutant runs never replace that selection, and the base
model is not modified. An unknown run ID, or one from another session, is an
error rather than a fallback. Each plot is saved under a new
<run_id>.plot_<uuid>.png name, so earlier plots are never overwritten.
The legacy result.csv and result resource keep their latest final-snapshot
behavior and are not the historical record. Saving results does not fill missing
timepoints or validate numerical/biological behavior.
An engine failure or a copy, parsing or publication error fails the operation
without rerunning the engine and is recorded as a separate failed_<uuid>.json
incomplete record with any available diagnostic files. Partial publication rolls
back only that attempt's new links. Previously saved runs remain intact.
Errors and artifact cleanup
Invalid parameters, unknown nodes, missing model state, missing simulation results, and failed scientific operations are returned as MCP tool errors with actionable messages. A caller can correct the arguments or perform the named prerequisite and retry without restarting the server.
clean_generated_files(session_id=...) removes artifacts for one session but
keeps its in-memory model. delete_session(clean_files=true) removes both.
These operations are destructive; retain any BND, CFG, CSV, PNG, or handoff
files needed for reproducibility before calling them.
Further reading
- MaBoSS website and documentation
- pyMaBoSS source
- MCP Python SDK v2 media results
- MCP Python SDK v2 structured output
Artifact storage uses the shared cache root or MCP_BIOMODELLING_ARTIFACT_ROOT,
with the MaBoSS/<session_id> namespace. Legacy artifacts remain discoverable.
bnet_to_bnd_and_cfg accepts optional parent_manifest (a verified BNET source
sidecar or NeKo handoff) and derived_from (the intact parent artifact path for
edited copies). Conversion and model exports retain hashes in .lineage.json
sidecars. Ordinary provenance does not replace import_neko_handoff or confer
approval. See the root README for exact path and provenance semantics.
來源:MaBoSS/README.md,提交 d9079ee
工具
0版本歷史
5- v2.5.2最新Oct 29, 2026
- v2.5.1Oct 22, 2026
- v2.5.0Oct 21, 2026
- v2.4.0Oct 1, 2026
- v2.2.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分