You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+173-2Lines changed: 173 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
10
10
CodeRunner is an MCP (Model Context Protocol) server that executes AI-generated code in a sandboxed environment on your Mac using Apple's native [containers](https://github.com/apple/container).
11
11
12
-
**Key use case:** Process your local files (videos, images, documents, data) with remote LLMs like Claude or ChatGPT without uploading your files to the cloud. The LLM generates code that runs locally on your machine to analyze, transform, or process your files.
12
+
**Key use case:** Process your local files (videos, images, documents, data) with remote LLMs like Claude or ChatGPT without uploading your files to the cloud. The LLM generates Python code or bash scripts that run locally on your machine to analyze, transform, or process your files.
13
13
14
14
## What CodeRunner Enables
15
15
@@ -21,6 +21,7 @@ CodeRunner is an MCP (Model Context Protocol) server that executes AI-generated
21
21
| Copy/paste scripts to run elsewhere | Code runs immediately, shows output/files |
22
22
| LLM analyzes text descriptions of files | LLM directly processes your actual files |
23
23
| Manage Python environments and packages | Pre-configured environment ready to use |
24
+
| Limited to one programming language | Supports both Python and Bash execution |
24
25
25
26
## Quick Start
26
27
@@ -140,15 +141,185 @@ From [@apple/container](https://github.com/apple/container/blob/main/docs/techni
140
141
## Architecture
141
142
142
143
CodeRunner consists of:
143
-
-**Sandbox Container:** Isolated execution environment with Jupyter kernel
144
+
-**Sandbox Container:** Isolated execution environment with Python and Bash Jupyter kernels
144
145
-**MCP Server:** Handles communication between AI models and the sandbox
146
+
-**Multi-Kernel Support:** Automatically routes Python and Bash code to appropriate kernels
145
147
146
148
## Examples
147
149
148
150
The `examples/` directory contains:
149
151
-`openai-agents` - Example OpenAI agents integration
150
152
-`claude-desktop` - Example Claude Desktop integration
151
153
154
+
## Development
155
+
156
+
### Running Locally
157
+
158
+
1.**Install dependencies:**
159
+
```bash
160
+
pip install -r requirements.txt
161
+
```
162
+
163
+
2.**Set up configuration:**
164
+
```bash
165
+
cp .env.example .env
166
+
# Edit .env with your preferred settings
167
+
```
168
+
169
+
3.**Run tests:**
170
+
```bash
171
+
python -m pytest tests/ -v
172
+
```
173
+
174
+
4.**Run the server:**
175
+
```bash
176
+
python server.py
177
+
```
178
+
179
+
### Available MCP Tools
180
+
181
+
CodeRunner provides the following MCP tools for AI models:
182
+
183
+
1.**`execute_python_code`** - Execute Python code in a persistent Jupyter kernel
CodeRunner can be configured via environment variables with the `CODERUNNER_` prefix for consistency across all components (Python application, Docker container, and entrypoint script). See `.env.example` for available options:
245
+
246
+
-`CODERUNNER_JUPYTER_HOST`: Jupyter server host (default: 127.0.0.1)
247
+
-`CODERUNNER_JUPYTER_PORT`: Jupyter server port (default: 8888)
248
+
-`CODERUNNER_FASTMCP_HOST`: FastMCP server host (default: 0.0.0.0)
249
+
-`CODERUNNER_FASTMCP_PORT`: FastMCP server port (default: 8222)
250
+
-`CODERUNNER_EXECUTION_TIMEOUT`: Code execution timeout in seconds (default: 300)
0 commit comments