Skip to content

pymetrix-assistant

A plugin: a separate package

pymetrix-assistant is a first-party plugin, installed on its own:

python -m pip install --pre pymetrix-assistant

An AI assistant in the pymetrix desktop app: ask Claude, or serve the open session to your own assistant over MCP.

The names pymetrix_assistant exports (its __all__), with their full documentation. Import them from the plugin: from pymetrix_assistant import .... The plugin's README says more.

Public names

AppServer dataclass

AppServer(url: str, port: int, steps: list[str] = list(), _server: Any = None, _thread: Any = None)

A running server: its address, and stop().

claude_code_command

claude_code_command() -> str

The command that adds this server to Claude Code.

serve

serve(app: Any, port: int = 0, root: Path | None = None, call: Callable[[Callable[[], Any]], Any] | None = None, on_step: Callable[[str], None] | None = None) -> AppServer

Serve pymetrix's MCP tools over the app's session (app: an AppInterface) on this computer, at http://127.0.0.1:<port>/mcp/<secret>. Steps run through app.run; every tool call runs through call (default: on the thread calling serve, the app's main thread). root: the folder files may be read from (default: the current folder). on_step(code) is told each step the assistant ran.

Plugin plumbing

What pymetrix's plugin loader reads (PLUGIN, register) and the plugin's version.

__version__ module-attribute

__version__ = '0.1.0a1'

PLUGIN module-attribute

PLUGIN = PluginInfo(name='pymetrix-assistant', version=__version__, api='1.13', license='BSD-3-Clause', maintainer='Geoffrey Heenan', description='An AI assistant in the desktop app: ask Claude, or serve the open session to your own assistant over MCP', requires={'mcp': '>=2.3', 'uvicorn': '', 'anthropic': '>=2.6', 'keyring': '>=24'}, install='pip install "pymetrix-assistant"')

register

register() -> None

The entry point: register the Assistant panel (once). Qt is imported only when the app builds the panel.