aiida_mcp.profiles module

AiiDA profile listing, creation and switching.

aiida_mcp.profiles.create_profile(name: str, email: str | None = None, storage_backend: str = 'core.sqlite_dos', storage_config: dict[str, Any] | None = None, broker: str = 'none', first_name: str | None = None, last_name: str | None = None, institution: str | None = None, set_as_default: bool = False) → dict[str, Any]

Create a new AiiDA profile and initialise its storage.

This does not switch the server’s active profile; call switch_profile for that.

Parameters:
  • name (str) – Name for the new profile.

  • email (str or None) – Default user’s email. Required unless storage_backend is read-only.

  • storage_backend (str) – Storage entry point, e.g. core.sqlite_dos or core.psql_dos.

  • storage_config (dict[str, Any] or None) – Backend-specific configuration. Unset fields fall back to the backend’s defaults.

  • broker (str) – Message broker to configure. One of BROKER_CHOICES.

  • first_name (str or None) – First name for the default user.

  • last_name (str or None) – Last name for the default user.

  • institution (str or None) – Institution for the default user.

  • set_as_default (bool) – Whether to make this the default profile for future server starts.

Returns:

The new profile’s name, storage backend, broker backend, and whether it is now the default.

Return type:

dict[str, Any]

Raises:

ToolError – If broker or storage_backend is not recognised, email is missing for a non-read-only backend, a profile named name already exists, or profile creation otherwise fails.

aiida_mcp.profiles.list_profiles() → dict[str, Any]

List all configured AiiDA profiles.

Returns:

The name of the currently loaded profile, the default profile, and a summary of every configured profile.

Return type:

dict[str, Any]

aiida_mcp.profiles.switch_profile(name: str) → dict[str, Any]

Switch the server’s active AiiDA profile and initialise its storage.

Parameters:

name (str) – Name of the profile to switch to.

Returns:

The result of list_profiles, reflecting the newly loaded profile.

Return type:

dict[str, Any]

Raises:

ToolError – If name does not match a configured profile.