From 2851eaf791f1f133d31559736074f69466521686 Mon Sep 17 00:00:00 2001 From: Xuner AI Date: Mon, 20 Apr 2026 16:45:35 +0800 Subject: [PATCH] fix: sync version and use context manager for file handle - Sync __init__.py version: 0.0.17 -> 0.0.18 (matches pyproject.toml) - Use context manager for play_audio local file reading to prevent file handle leak (fixes #63) --- minimax_mcp/__init__.py | 2 +- minimax_mcp/server.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/minimax_mcp/__init__.py b/minimax_mcp/__init__.py index 4de0fc1..902ebd4 100644 --- a/minimax_mcp/__init__.py +++ b/minimax_mcp/__init__.py @@ -1,3 +1,3 @@ """Minimax MCP Server package.""" -__version__ = "0.0.17" +__version__ = "0.0.18" diff --git a/minimax_mcp/server.py b/minimax_mcp/server.py index c767441..ce74c5e 100644 --- a/minimax_mcp/server.py +++ b/minimax_mcp/server.py @@ -287,7 +287,8 @@ def play_audio(input_file_path: str, is_url: bool = False) -> TextContent: return TextContent(type="text", text=f"Successfully played audio file: {input_file_path}") else: file_path = process_input_file(input_file_path) - play(open(file_path, "rb").read()) + with open(file_path, "rb") as f: + play(f.read()) return TextContent(type="text", text=f"Successfully played audio file: {file_path}")