Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

License Stars Issues
A personal setup guide for supercharging Open-WebUI with Docker Sandboxes and Model Context Protocol (MCP) servers.

Note

This is a configuration guide, not a software product. It describes how I set up my own local AI Architect environment. Your results may vary depending on your Docker setup and Open-WebUI version.

Why I Built This

I was tired of Open-WebUI's default Python sandbox (Pyodide) failing to run advanced libraries or web servers like Streamlit. I needed an AI assistant that could not only write code but execute it natively, spin up servers, and query local databases autonomously.

By replacing the default browser-based sandbox with a Dockerized Jupyter God Mode Sandbox and attaching MCP Servers via npx and uvx, I unlocked the true potential of Open-WebUI. This repository is my blueprint for how you can replicate the exact same setup.

What is this stack?

Open WebUI: A ChatGPT-style app that runs 100% locally on your machine. You download it like any Mac app, and it gives you a feature-rich interface to chat with AI.

God Mode Sandbox: A background Docker container running Jupyter and pre-loaded with heavy-duty data science libraries (pandas, scikit-learn, matplotlib, streamlit).

MCP Servers: Model Context Protocol plugins that give the AI the ability to read your local filesystem, query SQLite databases, search the web (Brave), and interact with GitHub APIs.

Architecture

flowchart LR
    A(["👤 You"]) --> B["🖥️ Open-WebUI\nport 8080"]
    
    subgraph "Execution Engines"
        B --> C["📦 Pyodide Sandbox\n(WebAssembly, Default)"]
        B --> D["🐳 God Mode Docker Sandbox\nport 8888 (Jupyter)"]
    end
    
    subgraph "MCP Superpowers"
        B --> E["📁 Filesystem (npx)"]
        B --> F["🗄️ SQLite/Postgres (uvx)"]
        B --> G["🔍 Brave Search (npx)"]
        B --> H["🐙 GitHub (npx)"]
    end
    
    D -.-> I["🌐 Streamlit Preview\nport 8501"]
Loading

Note: The Docker Sandbox runs locally on your machine and shares a volume mount at ~/openwebui_sandbox/workspace for easy file access.

Prerequisites

Requirement Tested Version Notes
macOS 12+ Windows/Linux: paths may need to be adjusted
Docker 20+ Required for the Jupyter Sandbox
Node.js 18+ npx is required for JS-based MCPs
Python (uv) any uvx is recommended for Python-based MCPs
Open-WebUI latest Installed and running locally

Quick Start

Run these steps in order to deploy the Docker sandbox.

# Step 1 – Clone this repo and navigate to the docker sandbox
git clone https://github.com/SudhirRathore/openwebui-advanced-setup.git
cd openwebui-advanced-setup/docker-sandbox

# Step 2 – Build and Run the Container (runs in background automatically)
chmod +x build_and_run.sh
./build_and_run.sh

Expected output from Step 2:

Building God Mode Sandbox image...
Running new Sandbox...
Sandbox is running on port 8888 (Jupyter) and port 8501 (Streamlit).

Configuring Open-WebUI

  1. Go to Settings > Admin Settings > Tools > Code Execution.
  2. Set the Engine to Jupyter.
  3. Set Jupyter URL to: http://localhost:8888
  4. Set Jupyter Auth Token to: godmode_secret (leave password blank).
  5. Save settings.

Optimizations Applied

# What Before After Note
1 Execution Pyodide (Browser restricted) Jupyter Docker Container AI can now run network requests and spawn servers
2 Python Libraries Basic only (numpy, pandas) streamlit, scikit-learn, fastapi, plotly Data science unlocked
3 File I/O Virtual memory Mapped host volume ~/openwebui_sandbox Charts/CSVs appear instantly on your Mac
4 Web Search None Brave Search via MCP Real-time stateless search capability
5 Database Access None SQLite/Postgres via uvx MCP Direct AI database querying

Adding MCP Servers

Navigate to Settings > Admin Settings > External > Tool Servers and add these commands:

  • Filesystem (Node): npx -y @modelcontextprotocol/server-filesystem /Users/yourusername/Desktop
  • GitHub (Node): npx -y @modelcontextprotocol/server-github (Requires GITHUB_PERSONAL_ACCESS_TOKEN)
  • Brave (Node): npx -y @modelcontextprotocol/server-brave-search (Requires BRAVE_API_KEY)
  • SQLite (Python): uvx mcp-server-sqlite --db-path /path/to/database.db
  • Postgres (Python): uvx mcp-server-postgres postgresql://user:pass@localhost/dbname

Limitations

  • Docker Required. The God Mode sandbox requires Docker to be running on your machine.
  • Port Conflicts. Ensure ports 8888 and 8501 are not being used by other applications before running the script.
  • macOS-focused. The build_and_run.sh script assumes macOS volume mounts ($HOME/openwebui_sandbox). Windows users will need to adapt the path format.

Roadmap

  • Add Windows and Linux path support to the Docker volume mount
  • Add a docker-compose.yml alternative for easier deployment
  • Document how to add custom Python packages dynamically without rebuilding
  • Add screenshot of the Streamlit preview working inside Open-WebUI

Related Projects

License

MIT — Copyright (c) 2026 Sudhir Rathore

About

A guide to manually adding Docker Jupyter Sandboxes and external MCP servers to Open-WebUI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages