list_running_servers
Lists all running local LLM servers with their port numbers and model names. Monitor active instances to manage server lifecycle.
Instructions
現在バックグラウンドで稼働しているすべてのローカルLLMサーバー(ポート番号とモデル名)の一覧を取得します。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_mlx_launcher/server.py:151-155 (handler)The handler logic for 'list_running_servers': calls process_manager.get_running_servers() and returns the result as JSON, or 'No running servers found.' if empty.
elif name == "list_running_servers": servers = process_manager.get_running_servers() if not servers: return [types.TextContent(type="text", text="No running servers found.")] return [types.TextContent(type="text", text=json.dumps(servers, indent=2))] - src/mcp_mlx_launcher/server.py:40-47 (schema)The tool schema definition for 'list_running_servers' in the tool list, with no required input parameters.
types.Tool( name="list_running_servers", description="現在バックグラウンドで稼働しているすべてのローカルLLMサーバー(ポート番号とモデル名)の一覧を取得します。", inputSchema={ "type": "object", "properties": {}, }, ), - src/mcp_mlx_launcher/server.py:17-17 (registration)The tool is registered via @server.list_tools() decorator on the handle_list_tools function which returns the list of tool definitions.
@server.list_tools() - The helper method MlxProcessManager.get_running_servers() which loads state, filters alive processes using psutil.pid_exists(), cleans up dead ones, and returns the active server dictionary.
def get_running_servers(self) -> dict: """現在稼働中のサーバー一覧を取得し、死んだプロセスをクリーンアップする""" state = self._load_state() active_servers = {} changed = False for port_str, info in list(state.items()): pid = info["pid"] if psutil.pid_exists(pid): active_servers[port_str] = info else: del state[port_str] changed = True if changed: self._save_state(state) return active_servers