Bridge all MCP tools from local-shell-mcp—including shell, file, browser, and remote machine—to the DeepSeek Harness web client, with a Live Workspace view for real-time collaboration.
- Language
- Python
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add github:fwerkor/local-shell-mcpRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin fwerkor/local-shell-mcp for me: review the repository at https://github.com/fwerkor/local-shell-mcp.git first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-Line Description
Bridges the standalone local-shell-mcp MCP service (providing shell, file, browser automation, remote machine, Agent Skills tools, etc.) into DeepSeek Harness's web client, embedding a real-time collaborative Live Workspace panel within the conversation window.
Core Capabilities
- Automatically registers all upstream MCP service tools under the
mcp__lsm__*namespace in the DSH tool list for direct model invocation - Injects upstream service-declared instruction segments as part of the system prompt, enabling the model to perceive currently available tools and context
- Renders an embedded real-time workspace within the "Live Workspace" tab of the DSH session panel, supporting terminal viewing, files, task progress, and querying the model
- Each DSH session gets its own dedicated upstream MCP connection, auto-disconnected when the session ends, with heartbeat and reconnection on disconnect
- Listens to upstream
tools/list_changednotifications, hot-updating the local tool list without restarting the plugin - Non-text content like images, audio, and resources returned from upstream are discarded and replaced with placeholder descriptions to avoid polluting the conversation context
Technical Implementation
- Language: JavaScript (Node.js, ESM)
- Key Dependencies:
@modelcontextprotocol/sdk(MCP client),zod(result validation),node:crypto,node:fs/promises - Architecture Pattern: DSH bundle patch + client injection dual-end structure; server side bridges MCP through four hooks:
tools/systemPrompt/webServer/agents, client side mounts React views in the conversation panel viaslots/sessions/conversation - Entry Files:
dsh/index.js(server-side bridge),dsh/client.js(client-side React view),cordis.patch.yml(injection declaration)
Use Cases
When you already have a local-shell-mcp service running locally or in a container and want DeepSeek Harness to directly call it for command line, file operations, browser automation, and remote machine control, installing this plugin brings the complete toolset and real-time workspace into the DSH web interface. Particularly convenient for multi-account collaboration or when you need to visually display the model's execution process.
Prerequisites & Compatibility
| Dependency | Minimum Version | Description |
|---|---|---|
| DSH | Not declared | Injects via dsh.bundle.patch and dsh.client.inject, requires DSH version supporting bundle patch and client runtime |
| Node.js | >=22 | Declared in package.json engines field |
| Platform | Cross-platform | Pure Node.js implementation with no native modules, relies on node:crypto / node:fs/promises |
| Local MCP Service | Bundled | Depends on upstream local-shell-mcp HTTP service at default address http://127.0.0.1:8765/mcp, needs to be started separately |
Installation
dsh plugin --profile web add github:fwerkor/local-shell-mcp
Configuration
This plugin requires no manual configuration from regular users; the following advanced fields take effect under config in cordis.patch.yml (can also override defaults via similarly-named DSH_LSM_* environment variables):
| Configuration | Type | Description | Default Value |
|---|---|---|---|
| url | String | HTTP/HTTPS address of the upstream MCP service; DSH establishes a Streamable HTTP connection to it | http://127.0.0.1:8765/mcp |
| browserUrl | String | Frontend origin address for the Live Workspace browser panel; if not set, uses the address returned by upstream | Not set (passthrough from upstream) |
| headers | Object | Extra HTTP headers to passthrough to upstream MCP requests, such as Authorization | Empty object |
| toolCallTimeoutMs | Number | Maximum wait time for a single tool call; exceeding this will interrupt | 120000 (120 seconds) |
| keepAliveIntervalMs | Number | Heartbeat interval; must be at least 5000 milliseconds | 30000 (30 seconds) |
| reconnectInitialDelayMs | Number | Milliseconds to wait for first reconnection after upstream disconnect | 500 |
| reconnectMaxDelayMs | Number | Maximum backoff wait milliseconds for reconnection | 30000 |
Environment variable quick overrides: DSH_LSM_MCP_URL / DSH_LSM_BROWSER_URL / DSH_LSM_AUTHORIZATION / DSH_LSM_TOOL_CALL_TIMEOUT_MS / DSH_LSM_KEEPALIVE_INTERVAL_MS.
FAQ
Q: What will I see after installing?
A: A "Live Workspace" tab will appear in the conversation panel, showing local-shell-mcp's real-time collaborative interface (terminal, files, task progress, etc.). The model's available tools list will also automatically append all upstream-declared tools with the mcp__lsm__ prefix.
Q: Do I need to start the local-shell-mcp service first?
A: Yes. This plugin is just a bridge and doesn't include the MCP service internally; it depends on the upstream MCP service at localhost:8765 (default). You can change the address via the DSH_LSM_MCP_URL environment variable or the url field in cordis.patch.yml.
Q: Is each DSH session independent?
A: Yes. The plugin establishes a separate upstream MCP connection for each DSH Session, tagged with session affinity request headers. It maintains up to 64 active session connections simultaneously; when exceeded, sessions are evicted based on least recently used time for ended sessions.
Q: What if tool results contain images or audio?
A: The plugin only forwards text fragments to the model. Images, audio, and resource content are replaced with placeholders like "[image: …, content discarded]" to prevent large binary data from flooding the conversation context.
Q: Do I need to add a Bearer Token for the local service?
A: Optional. Set DSH_LSM_AUTHORIZATION in the DSH process environment to passthrough to upstream MCP request headers; alternatively, hardcode it in the headers field of cordis.patch.yml.
Q: Will DSH automatically update when the upstream MCP tool list changes?
A: Yes. The plugin subscribes to upstream tools/list_changed notifications. Upon detecting changes, it re-fetches and hot-updates the local mcp__lsm__* tool list without restarting the plugin or reconnecting the session.
Q: What if the Live Workspace fails to load?
A: First verify the upstream MCP service is reachable and the live_workspace_reconnect tool has returned credentials. If the upstream is remote HTTPS and DSH is accessed in a browser, you also need to properly set DSH_LSM_BROWSER_URL; otherwise iframe cross-origin or protocol mismatches will cause failures.
Learning Curve
Beginner — single command installation; main work is starting a local-shell-mcp MCP service that can be accessed, with no additional DSH-side configuration required.
Known Issues & Limitations
- Upstream tools that require "task-based" execution mode will cause this bridge to throw an error without calling them, as the current implementation only supports standard request/response-style tool calls
- Maximum number of active DSH session connections is 64; when 64 sessions are all still active and a new session wants to connect, it will directly throw a "too many live sessions" error instead of queuing
- Upstream returned images, audio, and
resource_linkcontent are discarded; the model only receives placeholder descriptions and cannot directly view or forward them cordis.patch.yml'sbrowserUrlcannot contain username and password, otherwise configuration validation will error- Tool names undergo length and character normalization (
mcp__lsm__prefix + truncation + hash); upstream tool names that are too long will appear differently in the DSH UI than their original names
local-shell-mcp
A ChatGPT-ready MCP control plane for shell, files, browser automation, file links, and remote machines.
Documentation · Quickstart · Runtime choices · ChatGPT connector · DSH plugin · 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, durable logical sessions with optional Goal plans, 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. |
| DeepSeek Harness plugin | Install this repository as a DSH bundle and expose the complete LSM tool surface, including remote workers. |
| ChatGPT Live Workspace | Render a native MCP App for real-time activity, terminal, files, diffs, jobs, remotes, audit, and direct human/agent collaboration inside ChatGPT. |
| Safer operations | Workspace scoping, shell timeouts, output limits, environment filtering, audit logs, and secret scanning. |
Quick start
Install the official launcher or Python package when you want a host runtime:
npx local-shell-mcp --help
pipx install local-shell-mcp
lsm --help
The npm and Python distributions both expose local-shell-mcp; installed packages also expose lsm as the short command. The npm distribution is only a verified launcher for the matching standalone release binary, not a second server implementation.
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, and alerts.
- OpenTUI is the full terminal-oriented interface with Dashboard, Files, Terminals, Remotes, and Audit screens. It remains available in the browser as a selectable console and as the native
local-shell-mcp tuicommand.
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.
session_manage provides one durable logical task context for agent work. A Session is deliberately independent of machine and working directory: it stores the task objective, semantic progress reports, recent execution Activity, and an optional Plan. session_id is the only durable task identity. To continue work in another ChatGPT conversation, the user explicitly passes the existing session_id, and the new agent calls session_manage(action="resume", session_id=...). Agents do not list or auto-select Sessions from other conversations. They should report the active session_id after start/resume, at meaningful progress checkpoints, and before ending a turn, while using session_manage(action="report", session_id=...) for semantic progress rather than copying every tool result into the summary. Ordinary tools receive the same task identity as logical_session_id.
When the client supports MCP Apps, workspace_open(session_id=...) opens the execution view for the explicitly selected Session as a floating MCP App and can expand to fullscreen. The v3 name open_live_workspace remains a hidden, non-enumerated compatibility alias for ChatGPT clients with a cached recipient; new integrations see and use only workspace_open. The Live Workspace is a reconnectable viewer and collaboration surface, not the owner of task state: closing it or reconnecting MCP does not discard Session progress, Activity, or its Plan. Ordinary MCP tools remain the execution API, while the app adds live operational activity, persistent terminals, file/diff inspection, jobs, remotes, audit data, and the active Session id. Clients that do not render MCP Apps continue to use the normal tool surface unchanged.
plan_manage(session_id=...) optionally enables Goal mode on that explicit Session for substantial multi-step work. An active Plan is the goal: its steps can be revised as execution changes and, while a Live Workspace is attached, the app can request continuation after 15 minutes without agent tool activity. Automatic continuation is capped at 10 continuation attempts (accepted or rejected) and resumes the same Session before continuing. Blocked, completed, and cancelled Plan statuses are never nudged; an active Plan whose steps are all completed or skipped remains eligible for cleanup continuation so a resumed agent can call plan_manage(action="finish"). A Session does not require a Plan.
- Expose the server through HTTPS.
- Keep OAuth enabled.
- Add the MCP endpoint:
https://your-public-host.example.com/mcp. - Complete the OAuth authorization flow.
- Start with a bounded task and inspect the audit log when needed.
Read the dedicated ChatGPT connector guide.
DeepSeek Harness plugin
The repository root is also a DSH plugin bundle. With a normal LSM HTTP/MCP service running on the same host, install it directly into a DSH profile:
dsh plugin --profile web add 'github:fwerkor/local-shell-mcp#main'
The bundle uses an LSM-aware Streamable HTTP bridge and keeps the complete LSM tool surface, including remote_manage, remote_transfer, browser tools, and Dynamic MCP tools. Each DSH Session receives a stable v4 logical-session identity, so its Logical Session, active run, Activity, and native Live Workspace view stay isolated from other DSH conversations and survive DSH-side MCP transport recreation. DSH sees model tools under the normal mcp__lsm__* namespace. For production, pin the Git spec to a reviewed release or commit.
See the DeepSeek Harness integration guide.
VS Code extension runtime
Release assets include local-shell-mcp-<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 skill_list to discover installed Skills, skill_load to load one instruction set, and skill_read 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:
- Live Workspace:
workspace_openopens the reconnectable MCP App for the current logical Session. - Shell and jobs:
run_shell,run_python, persistentshell_*, and trackedjob_*tools. Userun_shellfor Git CLI operations. - Filesystem:
file_list,file_tree,file_glob,file_grep, unifiedfile_read, native-visionimage_view,file_write, unifiedfile_edit,file_delete, andfile_patch. - Transfer:
remote_transferfor files or directories across controller and worker endpoints. - Dynamic MCP:
mcp_manage,mcp_tool_search,mcp_tool_inspect, andmcp_tool_call. External tools are discovered progressively and never expand LSM's owntools/listsurface. - Browser: persistent high-level
browser_session,browser_snapshot, andbrowser_act;browser_run_scriptis the low-level Playwright escape hatch. - File links:
link_create,link_list,link_revoke. - Remote workers:
remote_managewithinvite,list,rename, andrevokeactions; normal execution tools accept optionalmachine. - Agent Skills:
skill_list,skill_load,skill_read. - Sessions:
session_managefor durable task context, progress handoff, agent-run takeover, and cross-run inheritance. - Planning:
plan_managefor optional Session-owned Goal mode and automatic continuation. - Diagnostics:
environment_get(including version information),secret_scan, andaudit_tail.
The detailed tool reference, including purpose, inputs, returns, combinations, and notes for every tool, is available in the docs.
Related projects
The following independently maintained projects explore adjacent session and orchestration models around LSM:
- rijuyuezhu/local-shell-mcp uses a different, execution-oriented session model that binds workspace context and related resources to explicit sessions. It has its own tool surface and release lifecycle.
- DongYaoZe/localshell-web-supervisor is a local reliability and orchestration layer for browser-driven agents using Local Shell MCP. It supervises replaceable browser workers while reconciling durable LSM sessions, Goals/jobs, and actual workspace/Git state, with guarded lease, handoff, takeover, and recovery flows. It is not part of the LSM runtime or 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
/workspaceunless 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.
- Dynamic stdio MCP servers inherit only a minimal OS environment plus explicitly configured per-server variables; configured environment/header values are stored in a mode-
0600state file and redacted from tool results and Audit arguments. - 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:
- Do not mount
/var/run/docker.sock. - Do not mount the host root filesystem.
- Do not expose the service with
LOCAL_SHELL_MCP_AUTH_MODE=noneon a public network. - Do not put long-lived credentials in environment variables visible to the model.
- Prefer single-repository deploy keys or short-lived tokens.
- Run the service in a disposable container or VM.
- Treat the
local-shell-mcp-credentialsDocker 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
Listing badge
[](https://deepseek-plugin.org/plugins/fwerkor/local-shell-mcp)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.