Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ coverage.xml

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor directories and files
.idea/
Expand All @@ -40,4 +44,22 @@ coverage.xml
.DS_Store

# Windows
Thumbs.db.env
Thumbs.db

# Personal config files (use example files instead)
claude_mcp_proxy/claude_desktop_config.json

# Runtime files
*.pid
*.sock
*.log

# Uploads directory
uploads/
jupyter_runtime/

# Jupyter Notebook
.ipynb_checkpoints

# Node modules (if any)
node_modules/
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing to CodeRunner

Thank you for your interest in contributing to CodeRunner! We welcome contributions from the community.

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/coderunner.git`
3. Create a new branch: `git checkout -b feature/your-feature-name`
4. Make your changes
5. Test your changes thoroughly
6. Commit your changes: `git commit -m "Add your feature"`
7. Push to your fork: `git push origin feature/your-feature-name`
8. Create a Pull Request

## Development Setup

1. Install dependencies: `pip install -r requirements.txt`
2. Copy the example config: `cp claude_mcp_proxy/claude_desktop_config.example.json claude_mcp_proxy/claude_desktop_config.json`
3. Update the config file with your local paths
4. Follow the setup instructions in the README

## Code Style

- Follow PEP 8 for Python code
- Use meaningful variable and function names
- Add comments for complex logic
- Write tests for new features

## Testing

- Ensure all existing tests pass
- Add tests for new functionality
- Test with different Python versions if possible

## Submitting Changes

- Keep commits focused and atomic
- Write clear commit messages
- Update documentation as needed
- Ensure no sensitive information is included

## Questions?

Feel free to open an issue for questions or discussions about contributing.
4 changes: 2 additions & 2 deletions Dockerfile.coderunner
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RUN python -m bash_kernel.install
# Copy the application code (main.py)
COPY ./main.py /app/main.py

# Copy the application code (main.py)
COPY ./mcp_main.py /app/mcp_main.py
# Copy the application code (server.py)
COPY ./server.py /app/server.py

# Create application/jupyter directories
RUN mkdir -p /app/uploads /app/jupyter_runtime
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 CodeRunner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ container run \
Finally, run the script from your terminal:

```bash
git clone https://github.com/instavm/coderunner.git
git clone https://github.com/BandarLabs/coderunner.git
cd coderunner

# Configure Claude Desktop MCP integration (optional)
cp claude_mcp_proxy/claude_desktop_config.example.json claude_mcp_proxy/claude_desktop_config.json
# Edit the config file with your local paths
```

Now you can give it prompts like `write python code to generate 100 primes` and watch it execute the code safely in the sandbox!
Expand All @@ -56,14 +60,14 @@ Now you can give it prompts like `write python code to generate 100 primes` and
Download `mcphost` from [releases](https://github.com/mark3labs/mcphost/releases/tag/v0.14.0)

```bash
cp cookbooks/.mcp.json ~/.mcp.json
cp examples/.mcp.json ~/.mcp.json
~/Downloads/mcphost_Darwin_arm64/mcphost -m ollama:llama3.1:8b
```

### Can also run via python openai agents

```bash
python cookbooks/openai_testmcp.py
python examples/openai_client.py
```

### Use via Curl
Expand Down
18 changes: 18 additions & 0 deletions claude_mcp_proxy/claude_desktop_config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"mcpServers": {
"coderunner": {
"command": "/path/to/your/python",
"args": [
"/path/to/coderunner/claude_mcp_proxy/mcp.py"
]
},
"filesystem": {
"command": "/path/to/your/node",
"args": [
"/path/to/mcp/filesystem/server",
"/path/to/workspace1",
"/path/to/workspace2"
]
}
}
}
18 changes: 0 additions & 18 deletions claude_mcp_proxy/claude_desktop_config.json

This file was deleted.

2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ echo $kernel_id > /app/uploads/python_kernel_id.txt
# exec python mcp_main.py

# Start FastAPI application
exec uvicorn mcp_main:app --host 0.0.0.0 --port 8222 --workers 1 --no-access-log
exec uvicorn server:app --host 0.0.0.0 --port 8222 --workers 1 --no-access-log
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mcp_main.py → server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
logger = logging.getLogger(__name__)

# Initialize the MCP server with a descriptive name for the toolset
mcp = FastMCP("jupyter_tools")
mcp = FastMCP("CodeRunner")


# Jupyter connection settings
Expand Down