Spaces:
Sleeping
Sleeping
gabyorel
commited on
Commit
Β·
a6afbde
1
Parent(s):
4b38877
Update README
Browse files
README.md
CHANGED
|
@@ -1,14 +1,82 @@
|
|
| 1 |
---
|
| 2 |
title: SafeBox
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.33.0
|
| 8 |
app_file: app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
short_description: Execute Python code safely in a dynamic sandbox.
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: SafeBox
|
| 3 |
+
emoji: π οΈ
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.33.0
|
| 8 |
app_file: app.py
|
| 9 |
+
tags:
|
| 10 |
+
- mcp-server-track
|
| 11 |
+
- code-execution
|
| 12 |
+
- modal
|
| 13 |
+
- sandbox
|
| 14 |
+
- dynamic-dependencies
|
| 15 |
pinned: false
|
| 16 |
license: apache-2.0
|
| 17 |
short_description: Execute Python code safely in a dynamic sandbox.
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# SafeBox MCP Server
|
| 21 |
+
|
| 22 |
+
This project is a Gradio-based MCP server that allows both users and AI agents to **safely execute arbitrary Python code snippets** in a Modal sandbox. It automatically **detects and installs Python dependencies** before executing the code.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
## β¨ Features
|
| 26 |
+
|
| 27 |
+
- **Sandboxed Code Execution**: All code is executed inside a secure, isolated Modal sandbox.
|
| 28 |
+
- **Dynamic Dependency Resolution**: Automatically detects imported packages in the code and installs them on the fly using `pip`.
|
| 29 |
+
- **Runtime Feedback**: Returns `stdout`, `stderr`, `returncode`, and any error messages from the execution.
|
| 30 |
+
- **Build Logs**: Returns Modal build logs for full visibility.
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## π€ Designed for AI Agents
|
| 34 |
+
|
| 35 |
+
SafeBox was built with **autonomous AI agents** in mind.
|
| 36 |
+
|
| 37 |
+
It is ideal for agents that need to **reflect on code changes** by executing, analyzing, and iterating on their own generated Python code.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
## π Integration with MCP clients
|
| 41 |
+
|
| 42 |
+
All you need to do is add this URL endpoint to your MCP Client (e.g., Cursor, Cline, or Tiny Agents), which typically means pasting this config in the settings:
|
| 43 |
+
|
| 44 |
+
```json
|
| 45 |
+
{
|
| 46 |
+
"mcpServers": {
|
| 47 |
+
"safebox": {
|
| 48 |
+
"url": "https://agents-mcp-hackathon-safebox.hf.space/gradio_api/mcp/sse"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Some MCP Clients, notably Claude Desktop, do not yet support SSE-based MCP Servers.
|
| 55 |
+
In those cases, you can use a tool such as mcp-remote. First install Node.js. Then, add the following to your own MCP Client config:
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
{
|
| 59 |
+
"mcpServers": {
|
| 60 |
+
"safebox": {
|
| 61 |
+
"command": "npx",
|
| 62 |
+
"args": [
|
| 63 |
+
"mcp-remote",
|
| 64 |
+
"https://agents-mcp-hackathon-safebox.hf.space/gradio_api/mcp/sse",
|
| 65 |
+
"--transport",
|
| 66 |
+
"sse-only"
|
| 67 |
+
]
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## π Authentication & Tokens
|
| 74 |
+
β
You do not need to set up your own Modal account to use this Space.
|
| 75 |
+
|
| 76 |
+
This Space uses a preconfigured Modal token, and you are free to use my credits to run your code snippets in a secure sandbox.
|
| 77 |
+
|
| 78 |
+
## πΊ Demo Video
|
| 79 |
+
Curious to see it in action?
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
Watch this short demo showing how the sandbox runs Python code with automatic dependency detection and live output:
|