Skip to main content

local-shell-mcp

A ChatGPT-ready MCP control plane for shell, files, browser automation, file links, and remote machines.

Docs CI Release Python Docker License

Documentation · Quickstart · Runtime choices · ChatGPT connector · Tools · Releases


local-shell-mcp gives ChatGPT Developer Mode and other MCP clients controlled access to a real execution environment. It exposes a dedicated workspace with shell, persistent shell, filesystem, search, patch, Playwright, audit, todo, public file links, and outbound remote-worker access. Git is handled through ordinary shell commands instead of a parallel wrapper API.

Runtime: Docker / VS Code extension / binary / Python / stdio
  -> exposure: localhost, HTTPS proxy/tunnel, or stdio pipe
  -> client: ChatGPT or another MCP client
  -> controlled workspace at /workspace or configured root
  -> optional remote workers connected over outbound HTTP(S)

The intended safety boundary is the container or VM, not the host.

Why use it

Capability What it enables
Real terminal access Run tests, build projects, inspect logs, and debug with persistent shell sessions.
Workspace-aware file tools Read, write, patch, search, and review files under a controlled root.
Git workflow support Run the standard Git CLI through shell tools without a second, incomplete Git abstraction.
Browser automation Extract page text, capture PNG/PDF evidence, or run a full Playwright script.
Remote workers Control NAT, firewall, HPC, NPU, or lab machines that can only connect outward.
Agent Skills Discover, load, and read reusable SKILL.md workflows through three fixed tools without changing the MCP tool list.
ChatGPT connector support OAuth 2.1, /mcp, discovery controls, and ChatGPT-compatible tool schemas.
Safer operations Workspace scoping, shell timeouts, output limits, environment filtering, audit logs, and secret scanning.

Quick start

Clone the repository and prepare configuration:

git clone https://github.com/fwerkor/local-shell-mcp.git
cd local-shell-mcp
cp .env.example .env

Set at least these values in .env:

LOCAL_SHELL_MCP_PUBLIC_BASE_URL=https://your-public-host.example.com
LOCAL_SHELL_MCP_AUTH_MODE=oauth
LOCAL_SHELL_MCP_OAUTH_ADMIN_PIN=change-me-long-random-pin
LOCAL_SHELL_MCP_OAUTH_JWT_SECRET=change-me-64-hex-random-secret
CLOUDFLARE_TUNNEL_TOKEN=

Start the server:

mkdir -p workspaces/default
docker compose up -d
curl -i http://127.0.0.1:8765/healthz

Start the bundled Cloudflare Tunnel sidecar when you need public HTTPS access:

docker compose --profile tunnel up -d

The public MCP endpoint is:

https://your-public-host.example.com/mcp

Full setup instructions are in the documentation. Runtime choices are documented separately from client connections.

Human interface

The service includes two compatible human interfaces backed by the same authenticated API and state:

  • Web UI is a native browser dashboard for system health, machines, workloads, recent MCP activity, alerts, and todos.
  • OpenTUI is the full terminal-oriented interface with Dashboard, Files, Terminals, Remotes, Audit, and Todos screens. It remains available in the browser as a selectable console and as the native local-shell-mcp tui command.

Open the browser interface on the service origin:

http://127.0.0.1:8765/ui

The OAuth screen lets you choose Web UI or OpenTUI before authorization. After login, switch modes at any time from the interface selector. Native Web UI routes use URL hashes such as #/overview and #/console, so a selected mode or page can be bookmarked. The OpenTUI console retains the existing authenticated xterm.js/PTY transport, mouse interaction, automatic resizing, reconnects, fullscreen mode, and mobile shortcut row.

Standalone release executables embed the native OpenTUI runtime, while Docker images provide it inside the image. Start the service, then launch it without a human login prompt:

local-shell-mcp tui

Files remains an LSM-native three-pane file manager inside OpenTUI for local and remote machines. It renders bounded PNG/JPEG/GIF/WebP thumbnails and provides consistent file operations through the shared service API. Manual actions entered through either human interface are excluded from the MCP audit log; Activity, Audit, and the terminal audit rail show model-originated MCP activity.

See the human interface guide.

ChatGPT setup

For full shell, filesystem, remote-worker, and Playwright tools, use ChatGPT Developer Mode or another full MCP client. ChatGPT is a client connection; choose and start a runtime first.

  1. Expose the server through HTTPS.
  2. Keep OAuth enabled.
  3. Add the MCP endpoint: https://your-public-host.example.com/mcp.
  4. Complete the OAuth authorization flow.
  5. Start with a bounded task and inspect the audit log when needed.

Read the dedicated ChatGPT connector guide.

VS Code extension runtime

Release assets include local-shell-mcp-vscode-<version>.vsix. The extension is a runtime launcher for the current VS Code workspace. It starts the same server, checks /healthz, copies the MCP URL, and copies a ready-to-paste ChatGPT setup prompt.

Basic flow:

Install executable -> install VSIX -> open a workspace -> Start Server -> copy MCP URL

For public ChatGPT access, expose the local server through an HTTPS tunnel and set local-shell-mcp.publicBaseUrl in VS Code settings. Keep local-shell-mcp.allowFullContainer disabled for direct host usage; enable it only inside disposable containers or VMs.

Remote workers

Remote worker mode is enabled by default. Create a one-time invite on the control server, paste the generated command on a remote machine, then use the normal tools with their optional machine argument. Only worker administration retains remote_* names.

This is intended for:

  • HPC login nodes or compute nodes behind firewalls.
  • NPU/GPU servers without inbound connectivity.
  • Lab machines that can make outbound HTTPS requests.
  • Temporary build hosts or remote test environments.

See the remote workers guide.

Agent Skills

Skills are discovered from three ordered sources: project-level /workspace/.agents/skills, the LSM-managed /workspace/.local-shell-mcp/agent_config/skills, and global ~/.config/agents/skills. Higher-priority sources override lower-priority Skills with the same name, and symlinked Skill directories and files are supported.

This makes the universal Skills CLI layout work directly, for example npx skills add owner/repo --agent universal -y. Use skills_list to discover installed Skills, skill_load to load one instruction set, and skill_read_file to read a related file by the returned Skill-relative path. Changes are detected on the next call; no per-Skill MCP tools are registered and no client reconnect is required.

See the Agent Skills guide.

Tool surface

The public MCP surface includes:

  • Shell and jobs: run_shell_tool, run_python_tool, persistent shell_*, and tracked job_* tools. Use run_shell_tool for Git CLI operations.
  • Filesystem: list_files, tree_view, glob_search, grep_search, unified read_file, native-vision view_image, write_file, unified edit_file, delete_file_or_dir, and apply_patch.
  • Transfer: transfer_path for files or directories across controller and worker endpoints.
  • Browser: browser_get_text_tool, unified browser_capture_tool, and playwright_run_script_tool.
  • File links: create_file_link, list_file_links, revoke_file_link.
  • Remote workers: remote_invite, remote_list_machines, remote_rename_machine, and remote_revoke_machine; normal execution tools accept optional machine.
  • Agent Skills: skills_list, skill_load, skill_read_file.
  • Diagnostics: environment_info (including version information), secret_scan, audit_tail, todo_read_tool, and todo_write_tool.

The detailed tool reference, including purpose, inputs, returns, combinations, and notes for every tool, is available in the docs.

Session-oriented community fork

Users who prefer an explicit session abstraction, including those who do not use ChatGPT Memory, may prefer the independently maintained rijuyuezhu/local-shell-mcp fork. It binds workspace context, jobs, todos, and transfers to sessions and has its own tool surface and release lifecycle.

Security model

This project intentionally exposes powerful tools. Treat the connected model as having control of the container or VM.

Default protections include:

  • Workspace scoping to /workspace unless full-container mode is explicitly enabled.
  • Command timeouts, output limits, and concurrency limits.
  • Default command/path denylists for host-control fragments.
  • Shell subprocess environment filtering for service-side secrets.
  • Audit logs at /workspace/.local-shell-mcp/audit.jsonl.
  • Secret scanning helpers before commits and pushes.
  • Tokenized file links with TTL/download limits and revocation.

Hard rules:

  1. Do not mount /var/run/docker.sock.
  2. Do not mount the host root filesystem.
  3. Do not expose the service with LOCAL_SHELL_MCP_AUTH_MODE=none on a public network.
  4. Do not put long-lived credentials in environment variables visible to the model.
  5. Prefer single-repository deploy keys or short-lived tokens.
  6. Run the service in a disposable container or VM.
  7. Treat the local-shell-mcp-credentials Docker volume as sensitive.

For vulnerability reporting, read SECURITY.md.

Configuration

Copy .env.example for the standard setup. The configuration reference documents every environment variable and the optional YAML format for advanced deployments.

Important options:

Setting Purpose
LOCAL_SHELL_MCP_PUBLIC_BASE_URL Public HTTPS origin used by OAuth and ChatGPT.
LOCAL_SHELL_MCP_AUTH_MODE Use oauth for public deployments.
LOCAL_SHELL_MCP_ALLOW_FULL_CONTAINER Disable workspace restrictions only in disposable containers/VMs.
LOCAL_SHELL_MCP_REMOTE_ENABLED Enable or disable remote worker control tools.
LOCAL_SHELL_MCP_UI_ENABLED Mount or disable the shared OpenTUI/WebUI human interface.
LOCAL_SHELL_MCP_UI_PATH WebUI mount path on the same service; default /ui.
LOCAL_SHELL_MCP_UI_WALLPAPER Select bing, aurora, or none for the OpenTUI browser console background.
LOCAL_SHELL_MCP_SHELL_ENV_BLOCKLIST Environment variables removed from spawned shell processes.
LOCAL_SHELL_MCP_FILE_DOWNLOAD_ENABLED Enable tokenized file download links.

Development

Install development dependencies and run checks:

python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev,docs]'
ruff check .
pytest -q
mkdocs build --strict

Build the VS Code extension:

npm --prefix vscode-extension install
npm --prefix vscode-extension run compile

Contribution workflow is documented in CONTRIBUTING.md.

Project documents

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

local_shell_mcp-3.2.0.tar.gz (924.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

local_shell_mcp-3.2.0-py3-none-win_amd64.whl (39.7 MB view details)

Uploaded Python 3Windows x86-64

local_shell_mcp-3.2.0-py3-none-manylinux_2_17_x86_64.whl (40.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

local_shell_mcp-3.2.0-py3-none-manylinux_2_17_aarch64.whl (39.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

local_shell_mcp-3.2.0-py3-none-macosx_15_0_x86_64.whl (28.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

local_shell_mcp-3.2.0-py3-none-macosx_15_0_arm64.whl (25.6 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file local_shell_mcp-3.2.0.tar.gz.

File metadata

  • Download URL: local_shell_mcp-3.2.0.tar.gz
  • Upload date:
  • Size: 924.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for local_shell_mcp-3.2.0.tar.gz
Algorithm Hash digest
SHA256 c20c0977aeff303636dca47a813ebd2e0a9a9cfaac17bbe3f284cec83027498f
MD5 bfff0ac858665c757779a7c8cfe83c64
BLAKE2b-256 1422b96f937df144ac9eeaf57aca2e8c4239c3fb31b75f097ce2002a98ccf8e8

See more details on using hashes here.

File details

Details for the file local_shell_mcp-3.2.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for local_shell_mcp-3.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b9ba686a6375ea57a4d9a066caaff8d95c69b3a47c84ae796b70c0d51f560364
MD5 c6aeec3152b7e95f6881759b0a4663d6
BLAKE2b-256 287bdd6bfdc07d806bb8b7f428f9952eba2835ce72f0640a8229575000c7868a

See more details on using hashes here.

File details

Details for the file local_shell_mcp-3.2.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for local_shell_mcp-3.2.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2507cbc965258f539226f560d8545884b265fd9ea4d998a80abbb5a29a9104da
MD5 c05fa27f1fa6173ce2639cc3eaf3f1f8
BLAKE2b-256 74d790c29f80ad2486df49e5cd53dd82e41ac67ee7c020a92dc7c536550e0132

See more details on using hashes here.

Provenance

The following attestation bundles were made for local_shell_mcp-3.2.0-py3-none-manylinux_2_17_x86_64.whl:

Publisher: release.yml on fwerkor/local-shell-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file local_shell_mcp-3.2.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for local_shell_mcp-3.2.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d446bee63332e9826717a1a7e28168c548aa79ef3357f4f8073aea60559cd29a
MD5 49299081b2fc10782763f431112854c1
BLAKE2b-256 8d92097e2f9e1205c728d51033b620cce688c069db19e0cc45d297bdd8888b31

See more details on using hashes here.

Provenance

The following attestation bundles were made for local_shell_mcp-3.2.0-py3-none-manylinux_2_17_aarch64.whl:

Publisher: release.yml on fwerkor/local-shell-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file local_shell_mcp-3.2.0-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for local_shell_mcp-3.2.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c672f3403acd9802d6e65560ddabae6c71bf1308a40c0b97545d593d32219471
MD5 8e04b420425ba49662f53ac0822c6cf0
BLAKE2b-256 50f239cd57695b1332cd2c22d96757fb710d6289d4f52250677959ed7a86e56c

See more details on using hashes here.

File details

Details for the file local_shell_mcp-3.2.0-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for local_shell_mcp-3.2.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7ca021b33f158cfd6316c4df633326aeca7fdb9a98f2853aff9e72c73ba7b6a0
MD5 0683a2b30e9f4b724a48966275fc09a1
BLAKE2b-256 e94a42ea075bdc225515fd529962bdd5dac9a5242036e507cdc68fb5122bb797

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page