Python API Docs

This section is for users importing su2-mcp as a Python package. It focuses on the importable module surface and callable entrypoints.

Top-level package

SU2 MCP server package.

class su2_mcp.SessionManager[source]

Manage SU2 sessions and their resources.

Create an empty session registry.

close_session(session_id, delete_workdir=False)[source]

Close a session and optionally remove its working directory.

create_session(base_name=None, initial_config=None, initial_mesh=None, mesh_file_name='mesh.su2')[source]

Create a new SU2 session with optional seed files.

get(session_id)[source]

Return the session record if it exists.

record_run(session_id, metadata)[source]

Store the last run metadata for the session.

require(session_id)[source]

Return the session record or raise if missing.

to_info(session_id)[source]

Return a JSON-friendly description of the session.

update_mesh(session_id, mesh_base64, mesh_file_name='mesh.su2')[source]

Persist a mesh to the session directory and update bookkeeping.

class su2_mcp.SessionRecord(session_id, workdir, config_path, mesh_path=None, last_run_metadata=None, lock=<factory>)[source]

Session state stored by SessionManager.

su2_mcp.build_server()[source]

Construct a FastMCP server with all SU2 tools registered.

CLI entrypoint

Entry point and helpers for the SU2 MCP FastMCP server.

su2_mcp.main.build_parser()[source]

Create the argument parser for running the SU2 MCP server.

su2_mcp.main.create_app(*, host='127.0.0.1', port=8000, mount_path='/', sse_path='/sse', message_path='/messages/', streamable_http_path='/mcp', json_response=False, stateless_http=False)[source]

Build a FastMCP application with all SU2 tools registered.

su2_mcp.main.main(argv=None)[source]

Run the SU2 MCP server with CLI-selected transport settings.