mseep-mcp-safe-local-python-executor 0.1.1__tar.gz → 0.1.2__tar.gz

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.
Files changed (16) hide show
  1. mseep_mcp_safe_local_python_executor-0.1.2/PKG-INFO +27 -0
  2. mseep_mcp_safe_local_python_executor-0.1.2/README.md +1 -0
  3. mseep_mcp_safe_local_python_executor-0.1.2/mseep_mcp_safe_local_python_executor.egg-info/PKG-INFO +27 -0
  4. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/pyproject.toml +1 -1
  5. mseep_mcp_safe_local_python_executor-0.1.1/PKG-INFO +0 -125
  6. mseep_mcp_safe_local_python_executor-0.1.1/README.md +0 -99
  7. mseep_mcp_safe_local_python_executor-0.1.1/mseep_mcp_safe_local_python_executor.egg-info/PKG-INFO +0 -125
  8. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/LICENSE +0 -0
  9. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/mseep_mcp_safe_local_python_executor.egg-info/SOURCES.txt +0 -0
  10. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/mseep_mcp_safe_local_python_executor.egg-info/dependency_links.txt +0 -0
  11. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/mseep_mcp_safe_local_python_executor.egg-info/requires.txt +0 -0
  12. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/mseep_mcp_safe_local_python_executor.egg-info/top_level.txt +0 -0
  13. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/setup.cfg +0 -0
  14. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/setup.py +0 -0
  15. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/tests/test_local_python_executor.py +0 -0
  16. {mseep_mcp_safe_local_python_executor-0.1.1 → mseep_mcp_safe_local_python_executor-0.1.2}/tests/test_mcp_server.py +0 -0
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: mseep-mcp_safe_local_python_executor
3
+ Version: 0.1.2
4
+ Summary: MCP server exposing tool for a safe local Python code execution
5
+ Home-page:
6
+ Author: mseep
7
+ Author-email: mseep <support@skydeck.ai>
8
+ Maintainer-email: mseep <support@skydeck.ai>
9
+ License: MIT
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: mcp[cli]>=1.5.0
22
+ Requires-Dist: smolagents==1.12.0
23
+ Dynamic: author
24
+ Dynamic: license-file
25
+ Dynamic: requires-python
26
+
27
+ # Package managed by MseeP.ai
@@ -0,0 +1 @@
1
+ # Package managed by MseeP.ai
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: mseep-mcp_safe_local_python_executor
3
+ Version: 0.1.2
4
+ Summary: MCP server exposing tool for a safe local Python code execution
5
+ Home-page:
6
+ Author: mseep
7
+ Author-email: mseep <support@skydeck.ai>
8
+ Maintainer-email: mseep <support@skydeck.ai>
9
+ License: MIT
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: mcp[cli]>=1.5.0
22
+ Requires-Dist: smolagents==1.12.0
23
+ Dynamic: author
24
+ Dynamic: license-file
25
+ Dynamic: requires-python
26
+
27
+ # Package managed by MseeP.ai
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "mseep-mcp_safe_local_python_executor"
10
- version = "0.1.1"
10
+ version = "0.1.2"
11
11
  description = "MCP server exposing tool for a safe local Python code execution"
12
12
  readme = "README.md"
13
13
  authors = [
@@ -1,125 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mseep-mcp_safe_local_python_executor
3
- Version: 0.1.1
4
- Summary: MCP server exposing tool for a safe local Python code execution
5
- Home-page:
6
- Author: mseep
7
- Author-email: mseep <support@skydeck.ai>
8
- Maintainer-email: mseep <support@skydeck.ai>
9
- License: MIT
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Classifier: Operating System :: OS Independent
18
- Requires-Python: >=3.6
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: mcp[cli]>=1.5.0
22
- Requires-Dist: smolagents==1.12.0
23
- Dynamic: author
24
- Dynamic: license-file
25
- Dynamic: requires-python
26
-
27
- # Safe Local Python Executor
28
-
29
- An MCP server (stdio transport) that wraps Hugging Face's [`LocalPythonExecutor`](https://github.com/huggingface/smolagents/blob/main/src/smolagents/local_python_executor.py)
30
- (from the [`smolagents`](https://huggingface.co/docs/smolagents/en/index) framework). It is a custom Python runtime that
31
- provides basic isolation/security when running Python code generated by LLMs locally. It does not require Docker or VM.
32
- This package allows to expose the Python executor via MCP (Model Context Protocol) as a tool for LLM apps like Claude Desktop, Cursor or any other MCP compatible client.
33
- In case of Claude Desktop this tool is an easy way to add a missing Code Interpreter (available as a plugin in ChatGPT for quite a while already).
34
-
35
- <img width="1032" alt="image" src="https://github.com/user-attachments/assets/3b820bfc-970a-4315-8f2d-970591c6fdae" />
36
-
37
- ## Features
38
-
39
- - Exposes `run_python` tool
40
- - Safer execution of Python code compared to direct use of Python `eva()l`
41
- - Ran via uv in Python venv
42
- - No file I/O ops are allowed
43
- - Restricted list of imports
44
- - collections
45
- - datetime
46
- - itertools
47
- - math
48
- - queue
49
- - random
50
- - re
51
- - stat
52
- - statistics
53
- - time
54
- - unicodedata
55
-
56
- ## Security
57
-
58
- Be careful with execution of code produced by LLM on your machine, stay away from MCP servers that run Python via command line or using `eval()`. The safest option is using a VM or a docker container, though it requires some effort to set-up, consumes resources/slower. There're 3rd party servcices providing Python runtime, though they require registration, API keys etc.
59
-
60
- `LocalPythonExecutor` provides a good balance between direct use of local Python environment (which is easier to set-up) AND remote execution in Dokcer container or a VM/3rd party service (which is safe). Hugginng Face team has invested time into creating a quick and safe option to run LLM generated code used by their code agents. This MCP server builds upon it:
61
-
62
- >To add a first layer of security, code execution in smolagents is not performed by the vanilla Python interpreter. We have re-built a more secure LocalPythonExecutor from the ground up.
63
-
64
- Read more [here](https://huggingface.co/docs/smolagents/en/tutorials/secure_code_execution#local-code-execution).
65
-
66
- ## Installation and Execution
67
-
68
- 1. Install `uv` (e.h. `brew install uv` on macOS or use [official docs](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2))
69
- 2. Clone the repo, change the directory `cd mcp_safe_local_python_executor`
70
- 3. The server can be started via command line `uv run mcp_server.py`, venv will be created automatically, depedencies (smollagents, mcp) will be installed
71
-
72
-
73
- ## Configuring Claude Desktop
74
-
75
- 1. Make sure you have Claude for Desktop installed (download from [claude.ai](https://claude.ai/desktop))
76
- 2. Edit your Claude for Desktop configuration file:
77
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
78
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
79
- - Or open Claude Desktop -> Settings -> Developer -> click "Edit Config" button
80
-
81
- 3. Add the following configuration:
82
-
83
- ```json
84
- {
85
- "mcpServers": {
86
- "safe-local-python-executor": {
87
- "command": "uv",
88
- "args": [
89
- "--directory",
90
- "/path/to/mcp_local_python_executor/",
91
- "run",
92
- "mcp_server.py"
93
- ]
94
- }
95
- }
96
- }
97
- ```
98
-
99
- 4. Restart Claude for Desktop
100
- 5. The Python executor tool will now be available in Claude (you'll see hammer icon in the message input field)
101
-
102
- ## Example Prompts
103
-
104
- Once configured, you can use prompts like:
105
-
106
- - "Calculate the factorial of 5 using Python"
107
- - "Create a list of prime numbers up to 100"
108
- - "Solve this equation (use Python): x^2 + 5x + 6 = 0"
109
-
110
-
111
- ## Development
112
-
113
- Clone the repo. Use `uv` to create venv, install dev dependencies, run tests:
114
-
115
- ```
116
- uv venv .venv
117
- uv sync --group dev
118
- python -m pytest tests/
119
- ```
120
-
121
- -----------------------
122
-
123
- <a href="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor">
124
- <img width="380" height="200" src="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor/badge" />
125
- </a>
@@ -1,99 +0,0 @@
1
- # Safe Local Python Executor
2
-
3
- An MCP server (stdio transport) that wraps Hugging Face's [`LocalPythonExecutor`](https://github.com/huggingface/smolagents/blob/main/src/smolagents/local_python_executor.py)
4
- (from the [`smolagents`](https://huggingface.co/docs/smolagents/en/index) framework). It is a custom Python runtime that
5
- provides basic isolation/security when running Python code generated by LLMs locally. It does not require Docker or VM.
6
- This package allows to expose the Python executor via MCP (Model Context Protocol) as a tool for LLM apps like Claude Desktop, Cursor or any other MCP compatible client.
7
- In case of Claude Desktop this tool is an easy way to add a missing Code Interpreter (available as a plugin in ChatGPT for quite a while already).
8
-
9
- <img width="1032" alt="image" src="https://github.com/user-attachments/assets/3b820bfc-970a-4315-8f2d-970591c6fdae" />
10
-
11
- ## Features
12
-
13
- - Exposes `run_python` tool
14
- - Safer execution of Python code compared to direct use of Python `eva()l`
15
- - Ran via uv in Python venv
16
- - No file I/O ops are allowed
17
- - Restricted list of imports
18
- - collections
19
- - datetime
20
- - itertools
21
- - math
22
- - queue
23
- - random
24
- - re
25
- - stat
26
- - statistics
27
- - time
28
- - unicodedata
29
-
30
- ## Security
31
-
32
- Be careful with execution of code produced by LLM on your machine, stay away from MCP servers that run Python via command line or using `eval()`. The safest option is using a VM or a docker container, though it requires some effort to set-up, consumes resources/slower. There're 3rd party servcices providing Python runtime, though they require registration, API keys etc.
33
-
34
- `LocalPythonExecutor` provides a good balance between direct use of local Python environment (which is easier to set-up) AND remote execution in Dokcer container or a VM/3rd party service (which is safe). Hugginng Face team has invested time into creating a quick and safe option to run LLM generated code used by their code agents. This MCP server builds upon it:
35
-
36
- >To add a first layer of security, code execution in smolagents is not performed by the vanilla Python interpreter. We have re-built a more secure LocalPythonExecutor from the ground up.
37
-
38
- Read more [here](https://huggingface.co/docs/smolagents/en/tutorials/secure_code_execution#local-code-execution).
39
-
40
- ## Installation and Execution
41
-
42
- 1. Install `uv` (e.h. `brew install uv` on macOS or use [official docs](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2))
43
- 2. Clone the repo, change the directory `cd mcp_safe_local_python_executor`
44
- 3. The server can be started via command line `uv run mcp_server.py`, venv will be created automatically, depedencies (smollagents, mcp) will be installed
45
-
46
-
47
- ## Configuring Claude Desktop
48
-
49
- 1. Make sure you have Claude for Desktop installed (download from [claude.ai](https://claude.ai/desktop))
50
- 2. Edit your Claude for Desktop configuration file:
51
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
52
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
53
- - Or open Claude Desktop -> Settings -> Developer -> click "Edit Config" button
54
-
55
- 3. Add the following configuration:
56
-
57
- ```json
58
- {
59
- "mcpServers": {
60
- "safe-local-python-executor": {
61
- "command": "uv",
62
- "args": [
63
- "--directory",
64
- "/path/to/mcp_local_python_executor/",
65
- "run",
66
- "mcp_server.py"
67
- ]
68
- }
69
- }
70
- }
71
- ```
72
-
73
- 4. Restart Claude for Desktop
74
- 5. The Python executor tool will now be available in Claude (you'll see hammer icon in the message input field)
75
-
76
- ## Example Prompts
77
-
78
- Once configured, you can use prompts like:
79
-
80
- - "Calculate the factorial of 5 using Python"
81
- - "Create a list of prime numbers up to 100"
82
- - "Solve this equation (use Python): x^2 + 5x + 6 = 0"
83
-
84
-
85
- ## Development
86
-
87
- Clone the repo. Use `uv` to create venv, install dev dependencies, run tests:
88
-
89
- ```
90
- uv venv .venv
91
- uv sync --group dev
92
- python -m pytest tests/
93
- ```
94
-
95
- -----------------------
96
-
97
- <a href="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor">
98
- <img width="380" height="200" src="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor/badge" />
99
- </a>
@@ -1,125 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mseep-mcp_safe_local_python_executor
3
- Version: 0.1.1
4
- Summary: MCP server exposing tool for a safe local Python code execution
5
- Home-page:
6
- Author: mseep
7
- Author-email: mseep <support@skydeck.ai>
8
- Maintainer-email: mseep <support@skydeck.ai>
9
- License: MIT
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Classifier: Operating System :: OS Independent
18
- Requires-Python: >=3.6
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: mcp[cli]>=1.5.0
22
- Requires-Dist: smolagents==1.12.0
23
- Dynamic: author
24
- Dynamic: license-file
25
- Dynamic: requires-python
26
-
27
- # Safe Local Python Executor
28
-
29
- An MCP server (stdio transport) that wraps Hugging Face's [`LocalPythonExecutor`](https://github.com/huggingface/smolagents/blob/main/src/smolagents/local_python_executor.py)
30
- (from the [`smolagents`](https://huggingface.co/docs/smolagents/en/index) framework). It is a custom Python runtime that
31
- provides basic isolation/security when running Python code generated by LLMs locally. It does not require Docker or VM.
32
- This package allows to expose the Python executor via MCP (Model Context Protocol) as a tool for LLM apps like Claude Desktop, Cursor or any other MCP compatible client.
33
- In case of Claude Desktop this tool is an easy way to add a missing Code Interpreter (available as a plugin in ChatGPT for quite a while already).
34
-
35
- <img width="1032" alt="image" src="https://github.com/user-attachments/assets/3b820bfc-970a-4315-8f2d-970591c6fdae" />
36
-
37
- ## Features
38
-
39
- - Exposes `run_python` tool
40
- - Safer execution of Python code compared to direct use of Python `eva()l`
41
- - Ran via uv in Python venv
42
- - No file I/O ops are allowed
43
- - Restricted list of imports
44
- - collections
45
- - datetime
46
- - itertools
47
- - math
48
- - queue
49
- - random
50
- - re
51
- - stat
52
- - statistics
53
- - time
54
- - unicodedata
55
-
56
- ## Security
57
-
58
- Be careful with execution of code produced by LLM on your machine, stay away from MCP servers that run Python via command line or using `eval()`. The safest option is using a VM or a docker container, though it requires some effort to set-up, consumes resources/slower. There're 3rd party servcices providing Python runtime, though they require registration, API keys etc.
59
-
60
- `LocalPythonExecutor` provides a good balance between direct use of local Python environment (which is easier to set-up) AND remote execution in Dokcer container or a VM/3rd party service (which is safe). Hugginng Face team has invested time into creating a quick and safe option to run LLM generated code used by their code agents. This MCP server builds upon it:
61
-
62
- >To add a first layer of security, code execution in smolagents is not performed by the vanilla Python interpreter. We have re-built a more secure LocalPythonExecutor from the ground up.
63
-
64
- Read more [here](https://huggingface.co/docs/smolagents/en/tutorials/secure_code_execution#local-code-execution).
65
-
66
- ## Installation and Execution
67
-
68
- 1. Install `uv` (e.h. `brew install uv` on macOS or use [official docs](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2))
69
- 2. Clone the repo, change the directory `cd mcp_safe_local_python_executor`
70
- 3. The server can be started via command line `uv run mcp_server.py`, venv will be created automatically, depedencies (smollagents, mcp) will be installed
71
-
72
-
73
- ## Configuring Claude Desktop
74
-
75
- 1. Make sure you have Claude for Desktop installed (download from [claude.ai](https://claude.ai/desktop))
76
- 2. Edit your Claude for Desktop configuration file:
77
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
78
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
79
- - Or open Claude Desktop -> Settings -> Developer -> click "Edit Config" button
80
-
81
- 3. Add the following configuration:
82
-
83
- ```json
84
- {
85
- "mcpServers": {
86
- "safe-local-python-executor": {
87
- "command": "uv",
88
- "args": [
89
- "--directory",
90
- "/path/to/mcp_local_python_executor/",
91
- "run",
92
- "mcp_server.py"
93
- ]
94
- }
95
- }
96
- }
97
- ```
98
-
99
- 4. Restart Claude for Desktop
100
- 5. The Python executor tool will now be available in Claude (you'll see hammer icon in the message input field)
101
-
102
- ## Example Prompts
103
-
104
- Once configured, you can use prompts like:
105
-
106
- - "Calculate the factorial of 5 using Python"
107
- - "Create a list of prime numbers up to 100"
108
- - "Solve this equation (use Python): x^2 + 5x + 6 = 0"
109
-
110
-
111
- ## Development
112
-
113
- Clone the repo. Use `uv` to create venv, install dev dependencies, run tests:
114
-
115
- ```
116
- uv venv .venv
117
- uv sync --group dev
118
- python -m pytest tests/
119
- ```
120
-
121
- -----------------------
122
-
123
- <a href="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor">
124
- <img width="380" height="200" src="https://glama.ai/mcp/servers/@maxim-saplin/mcp_safe_local_python_executor/badge" />
125
- </a>