mle-kit-mcp 0.1.0__py3-none-any.whl → 0.1.2__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 +6 -2
- mle_kit_mcp/tools/llm_proxy.py +1 -1
- mle_kit_mcp/tools/text_editor.py +14 -5
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/METADATA +3 -1
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/RECORD +10 -10
- /mle_kit_mcp/{llm_proxy_source.py → llm_proxy.py} +0 -0
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/WHEEL +0 -0
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/entry_points.txt +0 -0
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {mle_kit_mcp-0.1.0.dist-info → mle_kit_mcp-0.1.2.dist-info}/top_level.txt +0 -0
mle_kit_mcp/tools/bash.py
CHANGED
@@ -67,7 +67,7 @@ signal.signal(signal.SIGINT, cleanup_container)
|
|
67
67
|
signal.signal(signal.SIGTERM, cleanup_container)
|
68
68
|
|
69
69
|
|
70
|
-
def bash(command: str) -> str:
|
70
|
+
def bash(command: str, cwd: Optional[str] = None) -> str:
|
71
71
|
"""
|
72
72
|
Run commands in a bash shell.
|
73
73
|
When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
|
@@ -80,12 +80,16 @@ def bash(command: str) -> str:
|
|
80
80
|
|
81
81
|
Args:
|
82
82
|
command: The bash command to run.
|
83
|
+
cwd: The working directory to run the command in. Relative to the workspace directory.
|
83
84
|
"""
|
84
85
|
|
85
86
|
container = get_container()
|
87
|
+
workdir = DOCKER_WORKSPACE_DIR_PATH
|
88
|
+
if cwd:
|
89
|
+
workdir = DOCKER_WORKSPACE_DIR_PATH + "/" + cwd
|
86
90
|
result = container.exec_run(
|
87
91
|
["bash", "-c", command],
|
88
|
-
workdir=
|
92
|
+
workdir=workdir,
|
89
93
|
stdout=True,
|
90
94
|
stderr=True,
|
91
95
|
)
|
mle_kit_mcp/tools/llm_proxy.py
CHANGED
@@ -18,7 +18,7 @@ from mle_kit_mcp.tools.remote_gpu import (
|
|
18
18
|
send_rsync as _remote_send_rsync,
|
19
19
|
)
|
20
20
|
|
21
|
-
INPUT_SCRIPT_FILE_NAME = "
|
21
|
+
INPUT_SCRIPT_FILE_NAME = "llm_proxy.py"
|
22
22
|
OUTPUT_SCRIPT_FILE_NAME = "llm_proxy.py"
|
23
23
|
DEPENDENCIES = "fastapi uvicorn httpx openai fire"
|
24
24
|
START_TIMEOUT = 30
|
mle_kit_mcp/tools/text_editor.py
CHANGED
@@ -50,17 +50,23 @@ def _insert(path: Path, insert_line: int, new_str: str) -> str:
|
|
50
50
|
return truncate_content(new_content, WRITE_MAX_OUTPUT_LENGTH, target_line=insert_line)
|
51
51
|
|
52
52
|
|
53
|
-
def _str_replace(path: Path, old_str: str, new_str: str) -> str:
|
53
|
+
def _str_replace(path: Path, old_str: str, new_str: str, dry_run: bool = False) -> str:
|
54
54
|
assert path.is_file(), f"File not found: {path}"
|
55
55
|
content = path.open().read()
|
56
56
|
count = content.count(old_str)
|
57
57
|
assert count != 0, "old_str not found in file"
|
58
58
|
assert count == 1, "old_str is not unique in file"
|
59
59
|
target_line = content[: content.find(old_str) + len(old_str)].count("\n")
|
60
|
-
_save_file_state(path, content.splitlines(True))
|
61
60
|
new_content = content.replace(old_str, new_str)
|
62
|
-
|
63
|
-
|
61
|
+
if not dry_run:
|
62
|
+
_save_file_state(path, content.splitlines(True))
|
63
|
+
path.write_text(new_content)
|
64
|
+
display_content = truncate_content(
|
65
|
+
new_content, WRITE_MAX_OUTPUT_LENGTH, target_line=target_line
|
66
|
+
)
|
67
|
+
if dry_run:
|
68
|
+
display_content = f"Dry run:\n{display_content}"
|
69
|
+
return display_content
|
64
70
|
|
65
71
|
|
66
72
|
def _undo_edit(path: Path) -> str:
|
@@ -129,6 +135,7 @@ def text_editor(
|
|
129
135
|
view_start_line: Optional[int] = None,
|
130
136
|
view_end_line: Optional[int] = None,
|
131
137
|
show_lines: Optional[bool] = False,
|
138
|
+
dry_run: Optional[bool] = False,
|
132
139
|
) -> str:
|
133
140
|
"""
|
134
141
|
Custom editing tool for viewing, creating and editing files.
|
@@ -167,6 +174,7 @@ def text_editor(
|
|
167
174
|
new_str: Required for `str_replace`, `insert` and `append`.
|
168
175
|
old_str: Required for `str_replace` containing the string in `path` to replace.
|
169
176
|
show_lines: Optional for view command. If True, the command will also output line numbers.
|
177
|
+
dry_run: Optional for `str_replace` command. If True, the command won't modify the file but will display the result.
|
170
178
|
"""
|
171
179
|
assert not path.startswith(
|
172
180
|
"/"
|
@@ -191,7 +199,8 @@ def text_editor(
|
|
191
199
|
if command == "str_replace":
|
192
200
|
assert old_str is not None, "'old_str' is required for 'str_replace' command"
|
193
201
|
assert new_str is not None, "'new_str' is required for 'str_replace' command"
|
194
|
-
|
202
|
+
assert dry_run is not None
|
203
|
+
return _str_replace(path_obj, old_str, new_str, dry_run=dry_run)
|
195
204
|
if command == "undo_edit":
|
196
205
|
return _undo_edit(path_obj)
|
197
206
|
assert False, f"Not a valid command! List of commands: {valid_commands}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mle-kit-mcp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
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
|
@@ -14,6 +14,8 @@ Requires-Dist: mcp>=1.9.2
|
|
14
14
|
Requires-Dist: fire>=0.7.0
|
15
15
|
Requires-Dist: docker>=7.1.0
|
16
16
|
Requires-Dist: vastai-sdk==0.1.16
|
17
|
+
Requires-Dist: openai>=1.102.0
|
18
|
+
Requires-Dist: fastapi>=0.116.1
|
17
19
|
Dynamic: license-file
|
18
20
|
|
19
21
|
# MLE KIT MCP
|
@@ -1,18 +1,18 @@
|
|
1
1
|
mle_kit_mcp/__init__.py,sha256=2Ru2I5u4cE7DrkkAsibDUEF1K6sYtqppb9VyFrRoQKI,94
|
2
2
|
mle_kit_mcp/__main__.py,sha256=rcmsOtJd3SA82exjrcGBuxuptcoxF8AXI7jNjiVq2BY,59
|
3
3
|
mle_kit_mcp/files.py,sha256=ux53kWw7hBAcOmS9qNI4gpQX8XcQPT2LICC--S5-TGI,635
|
4
|
-
mle_kit_mcp/
|
4
|
+
mle_kit_mcp/llm_proxy.py,sha256=zDfNDvG1nAkft-irj0KhdB-1z-UUtKweRJYG0fCveVE,1637
|
5
5
|
mle_kit_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
mle_kit_mcp/server.py,sha256=W4YJ3m1-NKheJ5QlGggfMQyXPghzKgg5zXqb-TLYH1U,1271
|
7
7
|
mle_kit_mcp/utils.py,sha256=iHNcEZZzPD37bEYE18SzJ3WUjLP3Ym-kc91SwcW1vlI,1984
|
8
8
|
mle_kit_mcp/tools/__init__.py,sha256=r2fIg2mZ6zaeq0CzEKCEdeUTjV0pcA9NZaaOfBNVTnE,332
|
9
|
-
mle_kit_mcp/tools/bash.py,sha256=
|
10
|
-
mle_kit_mcp/tools/llm_proxy.py,sha256=
|
9
|
+
mle_kit_mcp/tools/bash.py,sha256=kunYHc3dyPGOooT-KY9L7eI_N22lBrcDbTlcp_yTTws,2820
|
10
|
+
mle_kit_mcp/tools/llm_proxy.py,sha256=eV8QwDBgsyfBzD454GzWsNjH6976E-e_fmO6CYpdLGc,5305
|
11
11
|
mle_kit_mcp/tools/remote_gpu.py,sha256=Fv8SJC8bE3Oo8JHOKXoYpISXFMzUMFjEcCQOTyW7V1I,11544
|
12
|
-
mle_kit_mcp/tools/text_editor.py,sha256=
|
13
|
-
mle_kit_mcp-0.1.
|
14
|
-
mle_kit_mcp-0.1.
|
15
|
-
mle_kit_mcp-0.1.
|
16
|
-
mle_kit_mcp-0.1.
|
17
|
-
mle_kit_mcp-0.1.
|
18
|
-
mle_kit_mcp-0.1.
|
12
|
+
mle_kit_mcp/tools/text_editor.py,sha256=0uGcSjcBjdPlqjYZYuWo29SmAMzBcWgKt4KRumFI3WE,9529
|
13
|
+
mle_kit_mcp-0.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
14
|
+
mle_kit_mcp-0.1.2.dist-info/METADATA,sha256=pGh_SbX6SFp_Ku1aOIUmPQjpDFXvBeXFebcyVzQcJVM,1074
|
15
|
+
mle_kit_mcp-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
mle_kit_mcp-0.1.2.dist-info/entry_points.txt,sha256=-iHSUVPN49jkBj1ySpc-P0rVF5-IPHw-KWNayNIiEsk,49
|
17
|
+
mle_kit_mcp-0.1.2.dist-info/top_level.txt,sha256=XeBtCq_CnVI0gh0Z_daZOLmGl5XPlkA8RgHaj5s5VQY,12
|
18
|
+
mle_kit_mcp-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|