mle-kit-mcp 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mle_kit_mcp/tools/bash.py CHANGED
@@ -9,7 +9,7 @@ from mle_kit_mcp.files import get_workspace_dir
9
9
  _container = None
10
10
  _client = None
11
11
 
12
- BASE_IMAGE = "python:3.9-slim"
12
+ BASE_IMAGE = "python:3.12-slim"
13
13
  DOCKER_WORKSPACE_DIR_PATH = "/workdir"
14
14
 
15
15
 
@@ -37,10 +37,10 @@ _instance_info: Optional[InstanceInfo] = None
37
37
 
38
38
 
39
39
  def cleanup_machine(signum: Optional[Any] = None, frame: Optional[Any] = None) -> None:
40
- print("Cleaning up...")
41
40
  global _instance_info
42
41
  signal.alarm(0)
43
42
  if _instance_info and _sdk:
43
+ print("Cleaning up...")
44
44
  try:
45
45
  _sdk.destroy_instance(id=_instance_info.instance_id)
46
46
  _instance_info = None
@@ -94,7 +94,7 @@ def get_offers(vast_sdk: VastAI, gpu_name: str) -> List[int]:
94
94
 
95
95
 
96
96
  def run_command(
97
- instance: InstanceInfo, command: str, timeout: int = 60
97
+ instance: InstanceInfo, command: str, timeout: int = 60, raise_exc: bool = True
98
98
  ) -> subprocess.CompletedProcess[str]:
99
99
  cmd = [
100
100
  "ssh",
@@ -117,7 +117,7 @@ def run_command(
117
117
  ]
118
118
  try:
119
119
  result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
120
- if result.returncode != 0:
120
+ if result.returncode != 0 and raise_exc:
121
121
  raise Exception(
122
122
  f"Error running command: {command}; "
123
123
  f"Output: {result.stdout}; "
@@ -178,6 +178,8 @@ def launch_instance(vast_sdk: VastAI, gpu_name: str) -> Optional[InstanceInfo]:
178
178
  offer_ids = get_offers(vast_sdk, gpu_name)
179
179
 
180
180
  instance_id = None
181
+ info: Optional[InstanceInfo] = None
182
+
181
183
  for offer_id in offer_ids:
182
184
  print(f"Launching offer {offer_id}...")
183
185
  instance = vast_sdk.create_instance(id=offer_id, image=BASE_IMAGE, disk=50.0)
@@ -301,7 +303,7 @@ def remote_bash(command: str, timeout: Optional[int] = 60) -> str:
301
303
  init_all()
302
304
  assert _instance_info
303
305
  assert timeout
304
- result = run_command(_instance_info, command, timeout=timeout)
306
+ result = run_command(_instance_info, command, timeout=timeout, raise_exc=False)
305
307
  output = ("STDOUT: " + result.stdout + "\n") if result.stdout else ""
306
308
  output += ("STDERR: " + result.stderr) if result.stderr else ""
307
309
  return output.replace(VAST_AI_GREETING, "")
@@ -136,7 +136,6 @@ def text_editor(
136
136
  If `path` is a file and `show_lines` is True, `view` displays the result of applying `cat -n`.
137
137
  If `path` is a file and `show_lines` is False, `view` displays the result of applying `cat`.
138
138
  If `path` is a directory, `view` lists non-hidden files and directories up to 2 levels deep.
139
- The `write` command cannot be used if the specified `path` already exists as a file.
140
139
  If a `command` generates a long output, it will be truncated and marked with `<response clipped>`.
141
140
  The `undo_edit` command will revert the last edit made to the file at `path`.
142
141
  Always write arguments with keys, do not rely on positions.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mle-kit-mcp
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: MCP server that provides different tools for MLE
5
5
  Author-email: Ilya Gusev <phoenixilya@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/IlyaGusev/mle_kit_mcp
@@ -11,13 +11,9 @@ Requires-Python: >=3.12
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: mcp>=1.9.2
14
- Requires-Dist: black==25.1.0
15
- Requires-Dist: mypy==1.16.0
16
- Requires-Dist: flake8==7.2.0
17
14
  Requires-Dist: fire>=0.7.0
18
15
  Requires-Dist: docker>=7.1.0
19
16
  Requires-Dist: vastai-sdk==0.1.16
20
- Requires-Dist: pytest>=8.4.1
21
17
  Dynamic: license-file
22
18
 
23
19
  # MLE KIT MCP
@@ -5,12 +5,12 @@ mle_kit_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  mle_kit_mcp/server.py,sha256=E9cXdKwVBASBzKyrZGHCTvj6BIMN-EbVSQZDFNg0YnE,1062
6
6
  mle_kit_mcp/utils.py,sha256=wd7wSyddHRHOYdxmXw8uoAOBxVZOL2_vjNomss07inc,1654
7
7
  mle_kit_mcp/tools/__init__.py,sha256=0aLl0gD-JteSvOs2PgVhbv0Wnh6fodFySgQWQvoI1xI,215
8
- mle_kit_mcp/tools/bash.py,sha256=9IIcely_J_fvNPLdJvHFOL72OG3rVIpNC3MB5S36pJI,2460
9
- mle_kit_mcp/tools/remote_gpu.py,sha256=7bhkwlB-qnzb7CExKuCS7YNPg19K-SLjamHTxVzi2uU,11374
10
- mle_kit_mcp/tools/text_editor.py,sha256=s9lPzqQWpZ2277f99TgMyKeOSTrv-PhX4HVtdXVeQ24,9228
11
- mle_kit_mcp-0.0.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
- mle_kit_mcp-0.0.3.dist-info/METADATA,sha256=9xP8U4vC840biALBdSzPqA8UI8zyr-HloOW0V8ps1wg,1126
13
- mle_kit_mcp-0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- mle_kit_mcp-0.0.3.dist-info/entry_points.txt,sha256=-iHSUVPN49jkBj1ySpc-P0rVF5-IPHw-KWNayNIiEsk,49
15
- mle_kit_mcp-0.0.3.dist-info/top_level.txt,sha256=XeBtCq_CnVI0gh0Z_daZOLmGl5XPlkA8RgHaj5s5VQY,12
16
- mle_kit_mcp-0.0.3.dist-info/RECORD,,
8
+ mle_kit_mcp/tools/bash.py,sha256=10hYo_hIBvQh8wbjssixb89SXG05H6nHtndShr6V31E,2461
9
+ mle_kit_mcp/tools/remote_gpu.py,sha256=paYXwbHm7-ROddcDayRKIkqacUPVxTcvvj-CLs26i6E,11474
10
+ mle_kit_mcp/tools/text_editor.py,sha256=EJ832vgdFdycrLOf3eOYMXnlMgB2_iH_u4ANvZVrMsE,9139
11
+ mle_kit_mcp-0.0.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
+ mle_kit_mcp-0.0.5.dist-info/METADATA,sha256=5HZ8PgimNnqIVHBKyJUUU6RwbYi1QjeIRSW_a1Z6yOA,1011
13
+ mle_kit_mcp-0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ mle_kit_mcp-0.0.5.dist-info/entry_points.txt,sha256=-iHSUVPN49jkBj1ySpc-P0rVF5-IPHw-KWNayNIiEsk,49
15
+ mle_kit_mcp-0.0.5.dist-info/top_level.txt,sha256=XeBtCq_CnVI0gh0Z_daZOLmGl5XPlkA8RgHaj5s5VQY,12
16
+ mle_kit_mcp-0.0.5.dist-info/RECORD,,