pyphi.mcp.server#

The PyPhi Model Context Protocol server.

Defines the FastMCP application, the tools that wrap PyPhi’s public API, and the main entry point for the pyphi-mcp console script. The teaching resources and prompts are registered from pyphi.mcp.resources and pyphi.mcp.prompts.

The server holds built substrates and analysis results in an in-process registry keyed by short handles, so a substrate is built once and then explored across many states and subsets without resending its transition probability matrix.

Module attributes

TPM_MAX_STATES

Largest state count for which a substrate summary carries its TPM as text.

UnitIndex

an integer, or a float with no fractional part (some clients send 1.0); a boolean is rejected, since a mask such as [false, true] would otherwise be read as the indices 0 and 1.

Functions

analyze(handle, state[, subset, formalism, ...])

Run an IIT analysis of a substrate in a state.

build_substrate(tpm[, cm, node_labels, alphabet])

Build a substrate from a transition probability matrix and return a handle.

campaign_status(directory)

Report a campaign's task ledger and refresh its resubmission list.

collect_campaign(directory[, partial])

Reassemble a campaign's outputs into a sweep result.

configure_parallel([enable, levels, ...])

Read or set the server's parallelization configuration.

describe_substrate(handle)

Describe a substrate previously loaded or built.

estimate_cost(handle[, subset, compute, ...])

Count the workload of an analysis before running it.

inspect(result_ref[, path])

Inspect a stored result, or one part of it.

list_examples()

List the built-in example substrates that load_example can load.

load_example(name)

Load a built-in example substrate and return a handle for it.

main([argv])

The pyphi-mcp entry point.

plot(target[, kind, view, max_relations])

Render one of PyPhi's built-in visualizations.

prepare_campaign(handles, directory[, ...])

Materialize a sweep as an HTCondor campaign directory.

prepare_ces_campaign(handle, state, directory)

Materialize one system's scoped CES analysis as an HTCondor campaign.