NeKo Biological Network Builder

io.github.marcorusc由 GitHub 帳號 marcorusc 發布v2.5.2更新於 Oct 29, 2026

MCP server for biological network construction and analysis using pathway databases

概覽

AI 產生的概覽

依通路資料庫建構、整理、分析並匯出生物訊號網路,支援分支歷史以及與 MaBoSS、BioMASS 的交接。

可以做什麼
  • 建立與管理建模工作階段、設定工作階段預設參數並檢視網路規模
  • 以種子基因透過 OmniPath 或 SignON 建構網路,或匯入既有 SIF 檔案
  • 新增或移除基因與交互作用、整理邊的正負效應,並依效應、來源或標的篩選
  • 檢查拓撲:列出交互作用、尋找路徑、取得文獻證據、分析連通性與基因集
  • 透過可預覽的連線策略修復網路連通性
  • 瀏覽、比較與限制分支網路歷史,並渲染為 SVG 示意圖
適用情境
適合研究人員讓助理從精選交互作用資料庫組裝訊號網路、依證據整理邊、檢查並修復連通性,再把布林模型交給模擬伺服器。適用於逐一假設反覆迭代的網路建模,而非快速查詢。
執行需求
以 stdio 在本機執行,來自 mcp-biomodelling-servers Python 套件,透過 mcp-neko-server 指令或 uvx 啟動,需要 Python 環境。依資料庫建構需要網路存取,可能耗時數分鐘。產物寫入共用快取根目錄或 MCP_BIOMODELLING_ARTIFACT_ROOT 變數指定的位置。未宣告任何身分驗證。
安裝前請注意
許多工具會修改或刪除資料:移除基因、交互作用與雙模邊會改變科學拓撲,delete_session 與 clean_generated_files 無法復原,降低歷史上限可能立即且不可逆地裁剪快照。complete_connection 與 connect_as_atopo 等連線策略開銷可能很大。種子基因清單與 SIF 內容會傳送到外部通路資料庫。交接匯出拒絕覆寫既有產物,每次應使用新的前綴。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 NeKo Biological Network Builder,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

NeKo MCP Server

The Wave 2 integration guide covers bounded diagnostics and the coordinated lightweight-history API.

The NeKo server builds, curates, analyzes, and exports signalling networks through the Model Context Protocol (MCP). It uses NeKo to construct networks from curated interaction databases or existing SIF files, and it preserves topology changes in NeKo's native branching history.

The server is distributed in the mcp-biomodelling-servers Python package and communicates over stdio. A typed, integrity-protected handoff connects a finished NeKo network to the MaBoSS MCP server.

Installation and startup

Install all three bio-modelling servers:

bash
python -m pip install mcp-biomodelling-servers

Start the installed NeKo server:

bash
mcp-neko-server

Alternatively, run it in an isolated environment:

bash
uvx --from mcp-biomodelling-servers mcp-neko-server

The branching history resource renders with the bundled PyGraphviz; no system Graphviz is needed. See the repository README for supported Python versions, complete MCP client configuration, and source-checkout instructions.

Sessions and network state

Every modelling hypothesis should have its own NeKo session. Begin with create_session(), retain the returned session_id, and pass it explicitly to subsequent calls. A newly created session is not automatically selected as the default; call set_default_session() if later calls should be allowed to omit the ID.

json
{  "label": "TP53-MYC resistance network"}
  • list_sessions reports active in-memory sessions, network dimensions, the current default, and history-retention settings.
  • list_artifact_sessions discovers exported files from current or previous server processes.
  • status returns the node and interaction counts for one session.
  • reset_network discards the current network while keeping the session and its settings.
  • delete_session permanently removes the in-memory session.

set_default_params() stores completion defaults per session. Previews and global completion reuse all defaults; add_nodes(autoconnect=true) reuses the sign and consensus filters.

Recommended workflow

Use this order for a database-backed network:

  1. Call create_session() and retain its ID.
  2. Optionally configure reusable connection settings with set_default_params().
  3. Build the network with create_network(...).
  4. Resolve bimodal edges, which BNET export requires: edit_interactions (operation='set_effect') with evidence where the sign matters, or remove_bimodal_interactions() to delete all remaining ones (this can disconnect the network). When appropriate, also call remove_undefined_interactions().
  5. Check connectivity with analyze_connectivity() (isolated nodes and the full component partition).
  6. If repair is needed, call preview_connection_impact() before selecting a mutating connection strategy.
  7. Inspect the resulting topology and evidence.
  8. Use the history tools to compare the new state with earlier alternatives.
  9. Export an integrity-protected MaBoSS handoff with export_neko_handoff(...).

During iterative construction, prefer verbosity="summary". Use preview or full only when the actual nodes, interactions, paths, or evidence are needed.

Building a network

create_network() supports two curated database backends:

  • omnipath, the default;
  • signor.

Create a network from seed genes:

json
{  "list_of_initial_genes": ["EGFR", "KRAS", "TP53", "AKT1"],  "database": "omnipath",  "max_len": 2,  "path_policy": "one_shortest",  "reuse_policy": "discovered_paths",  "only_signed": true,  "consensus": true,  "session_id": "SESSION_ID",  "verbosity": "summary"}

The construction parameters are:

ParameterContract
max_lenMaximum path length, from 1 to 4
path_policyone_shortest, all_shortest, or all_bounded
reuse_policynone, discovered_paths, or induced_subgraph
only_signedKeep only signed interactions when true
consensusUse the resource's own consensus sign flags when true; this does not universally imply multiple databases or higher confidence
verbositysummary, preview, or full

Construction may query an external biological database and can take several minutes. The tool reports MCP progress while database resources and the network are being prepared.

An existing SIF can be used instead:

json
{  "list_of_initial_genes": [],  "sif_file": "/absolute/path/input.sif",  "database": "omnipath",  "session_id": "SESSION_ID",  "verbosity": "summary"}

If the server cannot read your file (a host that sandboxes each server), pass the file's complete content as sif_text instead of sif_file. NeKo stores it verbatim in the session artifact directory and records it as the import source.

Additional seed genes may be supplied together with sif_file. A call that cannot complete successfully does not replace a valid network already stored in the session.

Editing and curating the topology

Add or remove nodes and interactions

  • add_nodes adds one or more genes in a single call and, by default, autoconnects each new gene to any direct neighbour already in the network (cheap; does not search multi-step paths). Set autoconnect=false to skip.
  • remove_gene removes a node and all incident edges.
  • remove_interaction removes only the requested directed edge.

Inspect the current network before destructive edits:

json
{  "session_id": "SESSION_ID",  "verbosity": "preview",  "max_rows": 50}

on list_genes_and_interactions.

Gene symbols should match the identifiers returned by the inspection tools. remove_interaction(node_A, node_B) removes node_A → node_B; it does not remove the reverse edge.

Curate interaction signs

  • remove_bimodal_interactions removes edges reported as both activating and inhibiting, with their references, and can disconnect the network. Prefer edit_interactions with evidence when an edge's sign matters.
  • remove_undefined_interactions removes edges whose effect cannot be mapped to a Boolean activation or inhibition.

These operations simplify later BNET export but change the scientific topology. Inspect the affected network and its history after applying them.

Inspecting topology and evidence

The server offers both concise text and JSON-native structured results:

  • list_genes_and_interactions returns node and directed-interaction records.
  • filter_interactions filters by effect, source, or target without modifying the network.
  • find_paths reports directed paths between two genes up to a bounded length.
  • get_references returns literature evidence for interactions involving one or two genes.
  • status reports the current dimensions.

For example, inspect inhibitory edges targeting apoptosis:

json
{  "effect": ["inhibition"],  "target": "Apoptosis",  "session_id": "SESSION_ID",  "verbosity": "preview",  "format": "markdown",  "max_rows": 50}

filter_interactions(format="json") changes the model-readable text format; the tool's structured result remains available independently.

Auditing and repairing connectivity

analyze_connectivity() reports isolated nodes—nodes with no incident edges—together with the complete connected-component partition of the network. Use it before a BNET or handoff export.

Scout candidate changes

preview_connection_impact() evaluates possible repair directions without changing the active network:

MethodResult
hubsRanks high-degree genes that may help orient a repair
relax_max_lenSimulates increasing the stored maximum path length
unsignedSimulates allowing unsigned interactions

Example:

json
{  "method": "relax_max_len",  "session_id": "SESSION_ID",  "verbosity": "preview",  "format": "markdown"}

The simulation methods operate on a copy. Their predicted changes are not committed to the session.

Apply a selected strategy

See NeKo's concise connection-strategy guide to choose the topology and path/reuse policies that match the research question.

bridge_components() connects two explicit groups:

json
{  "comp_a": ["EGFR", "KRAS"],  "comp_b": ["TP53", "BAX"],  "max_len": 2,  "mode": "OUT",  "only_signed": true,  "consensus": true,  "session_id": "SESSION_ID"}

comp_a/comp_b must be Gene Symbols (e.g. from a component's nodes list in analyze_connectivity()'s output), never the numeric component_id that analyze_connectivity() reports for each component - that ID is a report label, not a valid gene name.

mode is OUT, IN, or ALL.

connect_targeted_nodes() supports:

  • connect_to_upstream_nodes;
  • connect_subgroup.

apply_global_connection() supports:

  • complete_connection, with explicit path_policy and reuse_policy;
  • connect_network_radially, with direction="OUT" or "IN";
  • connect_as_atopo, with strategy_mode="radial" or "complete" and an optional outputs list of gene symbols to anchor the topology. This strategy loops until the network is connected to every declared output, so its cost is open-ended on large networks.

The database-backed connection tools can be expensive — complete_connection is O(N^2) over every node pair, and connect_as_atopo cost is open-ended. Reinspect components and compare history states after every selected strategy.

Branching network history

NeKo automatically records snapshots for its supported topology-changing operations. The MCP server exposes that native history directly, so undo, redo, checkout, and comparison preserve the exact NeKo network states.

List states

list_network_history() returns:

  • the exact current state ID;
  • retained state IDs;
  • parent and child relationships;
  • node and edge counts for every state;
  • the configured retention limit.

State IDs are identifiers, not list positions. Always obtain them from list_network_history() before navigation or comparison.

Navigate

Use the single navigate_network_history() tool:

json
{  "action": "checkout",  "state_id": 3,  "session_id": "SESSION_ID"}

The supported actions are:

Actionstate_id behavior
undoMoves to the parent; state_id must be omitted
redoMoves to a child; the ID may be omitted when there is one unambiguous child
checkoutMoves to the exact saved state; state_id is required

Navigation does not delete other saved states. If an older state is checked out and then modified, NeKo retains the previous future and records the new topology on a separate branch.

Compare without navigating

compare_network_states(state_a, state_b) reports added and removed nodes and interactions without changing the currently checked-out state:

json
{  "state_a": 2,  "state_b": 5,  "session_id": "SESSION_ID"}

Configure retention

set_network_history_limit(max_states) sets the per-session policy:

  • null keeps an unbounded history;
  • an integer must be at least 2;
  • a policy set before construction applies when a network is created;
  • lowering the limit may immediately and irreversibly prune older snapshots.

Call list_network_history() before reducing the limit.

Render the history

Read:

text
neko://session/{session_id}/history

to obtain read-only HTML containing NeKo's inline SVG history diagram. This resource does not change the checked-out state. The server renders NeKo's history digraph with the bundled PyGraphviz rather than an external dot executable; a rendering failure is returned as a resource error.

Export and the MaBoSS handoff

Standalone exports

export_network(format="sif") writes a standalone tab-separated interaction network. export_network(format="bnet") writes a Boolean model for MaBoSS.

BNET export requires one connected network. It sanitizes names that are invalid in Boolean rules and reports renamed nodes and duplicate rules removed after identifier normalization. Use list_bnet_files() to inspect BNET artifacts in the session.

Verified NeKo-to-MaBoSS transfer

Prefer export_neko_handoff() when the next step is simulation in the MaBoSS MCP server:

json
{  "biological_context": "EGFR-driven survival and apoptosis decision",  "output_nodes": ["Apoptosis", "Proliferation"],  "artifact_prefix": "egfr_decision_v1",  "session_id": "SESSION_ID"}

The handoff:

  • requires a connected network and non-empty biological_context;
  • writes a sanitized BNET and versioned JSON manifest;
  • records exact Boolean nodes, declared outputs, node renames, removed duplicates, package versions, session provenance, and the current NeKo history state;
  • protects both files with artifact integrity metadata;
  • translates requested original NeKo output names to their exact sanitized BNET names; and
  • refuses to overwrite an existing artifact pair.

Choose a new artifact_prefix for every retained handoff. output_nodes may be omitted, but MaBoSS must then select a small output set before running a simulation.

Pass the returned manifest path to MaBoSS import_neko_handoff(). A standalone BNET path can instead be passed to MaBoSS bnet_to_bnd_and_cfg(), but that route does not preserve the typed scientific context and provenance manifest.

If MaBoSS cannot read NeKo's files (a host that sandboxes each server), call export_handoff_bundle(manifest_path=...) and pass the returned object to import_neko_handoff(handoff_bundle=...) instead. See Hosts that sandbox each server.

Tool reference

CategoryTools
Sessionscreate_session, list_sessions, list_artifact_sessions, set_default_session, status, reset_network, delete_session
Construction and editingcreate_network, set_default_params, add_nodes, remove_gene, remove_interaction
Curationedit_interactions, remove_bimodal_interactions, remove_undefined_interactions
Inspection and evidencelist_genes_and_interactions, filter_interactions, find_paths, get_references, analyze_connectivity, analyze_gene_set
Connection strategiespreview_connection_impact, bridge_components, connect_targeted_nodes, apply_global_connection
Branching historylist_network_history, navigate_network_history, compare_network_states, set_network_history_limit
Export and artifactsexport_network, export_neko_handoff, export_biomass_handoff, export_handoff_bundle, list_bnet_files, clean_generated_files

Resources and prompt

Name or URIContent
docs://neko/agent_manualRecommended agent workflow and operating rules
neko://session/{session_id}/historyBranching history as inline SVG HTML
neko_workflow_promptThe operating manual as an MCP prompt

Structured output and errors

Inspection, session, history, export, and handoff tools return structured JSON-native results in addition to concise model-readable text. This allows an MCP host to consume exact nodes, interactions, state IDs, dimensions, paths, provenance, and artifact metadata without parsing Markdown.

Invalid identifiers, missing prerequisites, unsupported strategies, failed database operations, disconnected exports, and other modelling failures are returned as MCP tool errors with recovery guidance. Correct the arguments or perform the named prerequisite and retry in the same session.

Artifact cleanup

clean_generated_files(session_id=...) deletes exported artifacts for the selected session without resetting its in-memory network. It is destructive. Retain any SIF, BNET, or handoff files needed for reproducibility before calling it.

If both network state and artifacts should be discarded, clean the generated files before calling delete_session().

Further reading

Export an ODE-construction handoff

export_biomass_handoff(biological_context, artifact_prefix="neko_to_biomass", session_id=...) writes a network JSON and integrity-protected neko-to-biomass manifest. It preserves original node identifiers, stable edge IDs, all references, and available mechanism/database/context columns. Duplicate identical interactions merge their reference lists. Disconnected and unsigned interactions remain available for evidence curation.

Import the manifest with BioMASS's import_neko_handoff. The calling agent then reads literature and proposes reactions with evidence or explicit assumptions. This export does not assign rate laws or kinetic parameters. The existing export_neko_handoff continues to export Boolean models for MaBoSS.

Artifact storage uses the shared cache root or MCP_BIOMODELLING_ARTIFACT_ROOT, with the NeKo/<session_id> namespace. Legacy package-local artifacts remain listed with their location. See the root README's artifact storage section.

create_network accepts optional parent_manifest and derived_from for SIF imports. A parent is a verified .lineage.json from a SIF export; an edited copy requires derived_from to identify the intact parent SIF. SIF/BNET exports retain source hashes in sibling .lineage.json files, independently of handoff approval.

Evidence-backed interaction editing (Wave 2)

With the updated NeKo curation API, edit_interactions accepts up to 20 explicit add or set_effect operations between existing nodes. Each operation requires an effect, rationale, and publication evidence. PMIDs are optional when another citation is supplied; missing references are never invented. Obtain the exact network/state IDs from status and pass them with the session ID. A stale request, ambiguous endpoint or conflicting addition fails without partial batch mutation. The capability does not grant scientific authorization.

Inspection preserves manual origin and separates original evidence from edit justification. Existing history tools expose bounded summaries and exact-state detail resources. Use export_network(format='history') to save retained branches, snapshots and explanations, then Network.from_history(path) to restore them. Database identity reports the name used for construction only.

SIF/BNET exports and handoffs include verified history/provenance companions. Keep the referenced files together and use the coordinated MCP package to read new manifests. See Wave 2 integration for the agreed API, compatibility table, source requirements and measured interface costs.

來源:NeKo/README.md,提交 d9079ee

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

5
  1. v2.5.2最新Oct 29, 2026
  2. v2.5.1Oct 22, 2026
  3. v2.5.0Oct 21, 2026
  4. v2.4.0Oct 1, 2026
  5. v2.2.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分