create_server

petrophys.mcp.server.create_server

Also available as petrophys.mcp.create_server

create_server(roots=None, *, session=None, calculation_profile=None)[source]

Build the Petrophys MCP server.

Parameters:
  • roots (sequence of path, optional) – Folders the server may read wells from and write exports to. Defaults to PETROPHYS_MCP_ROOTS or the current directory. Bundled sample wells are always readable.

  • session (Session, optional) – Existing session to serve (mainly for tests).

  • calculation_profile (str, optional) – Calculation profile of interpretations whose settings do not set calculation_profile, e.g. "geolink" to pin an evaluation harness to the eval package’s calculations. Defaults to PETROPHYS_CALCULATION_PROFILE, else the library default ("current"). A profile given in a tool’s settings wins. The environment variable is read here, by the MCP server only; library calls such as petrophys.interpret() ignore it.

Returns:

Call .run() to serve over stdio.

Return type:

MCPServer

Raises:

ValueError – If the calculation profile is not valid.