semvec/pypi-packages huggingface dataset:
code-sandbox-mcp 0.1.0
MCP server for E2B code sandbox - Execute code and commands in secure E2B sandboxes
License: MIT
Requires Python: >=3.10.0
Keywords: code-execution, e2b, mcp, model-context-protocol, sandbox

# Code Sandbox MCP

MCP (Model Context Protocol) server for E2B code sandbox. This server provides tools to create, manage, and execute code in secure E2B sandboxes.

## Features

- **Create Sandbox**: Create new E2B sandboxes with customizable timeout and template
- **Kill Sandbox**: Terminate existing sandboxes by ID
- **Run Code**: Execute Python code in sandboxes using Jupyter Notebook syntax
- **Run Command**: Execute shell commands in sandboxes

## Installation

```bash
pip install -e .
```

Or using uv:

```bash
uv pip install -e .
```

## Configuration

Create a `.env` file in the project root with your E2B credentials:

```env
E2B_API_KEY=your_api_key_here
E2B_DOMAIN=your_domain_here
```

## Usage

### Running the Server

Using MCP CLI with Inspector (for testing):

```bash
uv run mcp dev code_sandbox_mcp/server.py
```

Or using MCP CLI:

```bash
uv run mcp run code_sandbox_mcp/server.py
```

Or directly with Python:

```bash
python -m code_sandbox_mcp.server
```

Or using the installed command:

```bash
code-sandbox-mcp
```

### Available Tools

1. **create_sandbox(timeout: int = 300, template: str = None)**
   - Creates a new E2B sandbox
   - Returns the sandbox ID
   - Parameters:
     - `timeout`: Sandbox timeout in seconds (default: 300)
     - `template`: Optional template name or ID

2. **kill_sandbox(sandbox_id: str)**
   - Kills an existing sandbox
   - Returns empty string on success, error message on failure

3. **run_code(code: str, sandbox_id: str = None)**
   - Executes Python code in a sandbox
   - Uses Jupyter Notebook syntax
   - If `sandbox_id` is provided, connects to existing sandbox
   - Otherwise creates a new sandbox
   - Returns stdout and stderr

4. **run_command(command: str, sandbox_id: str = None)**
   - Executes a shell command in a sandbox
   - If `sandbox_id` is provided, connects to existing sandbox
   - Otherwise creates a new sandbox
   - Returns stdout, stderr, and exit code

## Development

This project uses:
- Python 3.10+
- E2B Code Interpreter SDK
- MCP Python SDK (FastMCP)
- python-dotenv for environment variable management

## License

MIT
simplex-ui 3.2.3.0
SIMPLEX User Interface to Python
License: MIT
Requires Python: >=3.8

# simplex-ui

simplex-ui is a Python library to interface the FEL simulation code SIMPLEX.

## Details

For details, visit the [simplex-ui homepage](https://spectrax.org/simplex/app/3.2/python/docs/)

## Installation

Use the package manager to install simplex-ui.

```bash
pip install simplex-ui (--user)
```

## Usage

```python
import simplex

# launch SIMPLEX: interactive mode, HTML source in CDN
simplex.Start(mode="i")

# open a parameter file "/path/to/parameter_file"
simplex.Open("/path/to/parameter_file")

# start calculation: output file will be /path/to/data_dir/sample.json
simplex.StartSimulation(folder="/path/to/data_dir", prefix="sample", serial=-1)

# plot gain curve (growth of the pulse energy) in the Post-Processor
simplex.PostProcess.PlotGainCurve("Pulse Energy")

# quit SIMPLEX
simplex.Exit()
```

## Requirement
You need to install a web browser (Chrome, Edge, or Firefox; Safari is not upported) to show parameter lists, graphical plots, and calculation progress. 

## License

[MIT](https://choosealicense.com/licenses/mit/)