Secure Local Workspace MCP
Secure Local Workspace MCP lets ChatGPT safely work with locally authorized projects through bounded tools and explicit permissions.
Check configuration and safety capabilities, list authorized projects, and discover Git/non-Git projects under approved parent folders.
Connect or disconnect projects within approved discovery roots without deleting project files.
List, read, and search project files with bounded depth, count, and size limits.
Create files, apply SHA-guarded patches, and delete SHA-guarded files only when write access is enabled.
Run only user-configured, allowlisted project tasks—not arbitrary shell commands.
Inspect Git status and diffs, unstage explicit paths, and create local commits for explicit files after status/SHA checks and sensitive-content scanning.
Push a reviewed commit only when push is locally enabled and limited to an allowlisted remote/branch; force push is prohibited.
Provides read-only inspection of authorized local Git repositories, including git status and git diff, without allowing arbitrary Git commands or remote operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Secure Local Workspace MCP 调用 list_projects,只返回项目名称和是否可写。"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Secure Local Workspace MCP
English | 中文(默认)
Let the ChatGPT web version securely connect to local projects: whether or not Git is used, you can view, search, and modify files, and run whitelisted tasks; Git projects can also check diffs, create local commits, and push to a specified remote and branch after explicit user authorization.
You don't need to install Codex. ChatGPT calls the MCP service still running on your computer through the OpenAI Secure MCP Tunnel; the project directory and MCP port don't need to be exposed to the public internet.
Choose Your Use Case First
Your situation | Where to start |
Connecting to ChatGPT for the first time, no Tunnel yet | Follow First-time installation: connect to ChatGPT from scratch |
Tunnel already works in ChatGPT, just want to add a project | |
Project already connected, want ChatGPT to modify or commit | Copy the daily-use prompts directly |
Want to allow ChatGPT to push | First complete Enable controlled push separately |
Installation or connection errors | See FAQ |
Related MCP server: Local Supervisor Bridge
What You Get
Workflow | MCP tools | Key protections |
Discover projects |
| Identifies Git repositories and common non-Git projects, only scans pre-approved parent directories |
Connect or revoke |
| Cannot go beyond the approved scope; revoking does not delete project files |
View and search |
| Restricts directories, depth, count, and file size |
Modify files |
| Modifying or deleting existing files must match the latest SHA-256 |
Run verification |
| Can only run configured fixed tasks |
Review Git |
| Fixed read-only Git commands, returns status/diff hashes |
Local commit |
| Explicit files, concurrency-protected status, sensitive-content scan, does not mix in existing staged content |
Remote push |
| Disabled by default; only allows specified remote/branch; force push prohibited |
The project does not provide arbitrary Shell, git add ., force push, history rewriting, production deployment, or arbitrary disk access.
First-time Installation: Connect to ChatGPT from Scratch
The following flow uses Windows PowerShell as an example. Usually only needs to be done once.
Step 1: Check Prerequisites
You need:
Windows PowerShell;
Git;
Node.js 20 or higher;
Access to ChatGPT developer mode;
Permissions required for Tunnel in OpenAI Platform.
Check local commands:
git --version
node --version
npm --versionIf you plan to let ChatGPT create Git commits, you also need to set up your Git identity first. If already set, you can skip:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Step 2: Download the Project
git clone https://github.com/dxawdc/secure-local-workspace-mcp.git
Set-Location .\secure-local-workspace-mcpStep 3: Prepare the Tunnel on the OpenAI Page
Follow the OpenAI Secure MCP Tunnel official documentation to complete the following:
Create a Tunnel in OpenAI Platform;
Associate the Tunnel with the ChatGPT workspace that will use it;
Create a Runtime API Key for
tunnel-client;Download the latest official
tunnel-client;Record the
tunnel_idand the local path oftunnel-client.exe.
These steps involve account permissions and keys and must be confirmed by the user on the OpenAI page; the project will not create or read account credentials on your behalf.
Step 4: Save the Runtime Key Outside the Repository
Don't write the Key into the README, project config, Git, or PowerShell command history. You can first create a file outside the repository:
New-Item -ItemType Directory -Path "C:\Secrets" -Force
notepad "C:\Secrets\openai-tunnel-runtime-key.txt"Paste the Runtime Key in Notepad, keep only one line, save, and close. For production or team environments, switch to an organization-approved key management solution and restrict access to this file.
Step 5: Run One-click Configuration
Replace the three paths and Tunnel ID in the example with your own values:
.\scripts\quick-setup.ps1 `
-ProjectRoot "D:\Projects\my-app" `
-DiscoveryRoot "D:\Projects" `
-TunnelId "tunnel_REPLACEME" `
-TunnelClient "C:\Tools\tunnel-client\tunnel-client.exe" `
-ControlPlaneApiKeyRef "file:C:\Secrets\openai-tunnel-runtime-key.txt" `
-RegisterStartup `
-StartTunnelHow to fill in the parameters:
ProjectRoot: the project directory you want ChatGPT to operate on this time; it doesn't have to be a Git repository;DiscoveryRoot: the parent directory where ChatGPT is allowed to discover projects, usually the parent ofProjectRoot;TunnelId: the realtunnel_idshown in OpenAI Platform;TunnelClient: the downloaded and extractedtunnel-client.exe;ControlPlaneApiKeyRef: the Runtime Key file path, must have thefile:prefix.
The script will automatically complete:
Install Node.js dependencies using the lock file;
Run unit tests and MCP smoke tests;
Set the project to read-write and allow local commits;
Approve the project discovery directory;
Automatically identify
test,lint,build,typecheckinpackage.json;Create and check the Tunnel profile;
Register a login auto-start task for the current user and start the Tunnel immediately.
Push is not allowed by default. Non-Git projects automatically retain file read-write capability while forcibly disabling commit and push; no need to manually add -DisableCommit.
If accessing OpenAI from this machine must go through a proxy, append at the end of the command:
-HttpProxy "http://127.0.0.1:7890"Step 6: Create a Private App in ChatGPT
Enable developer mode in ChatGPT settings. Enterprise/Edu users may need administrator authorization;
Open ChatGPT Plugins;
Click the plus sign to create a developer mode app;
Connection: select Tunnel;
Select the Tunnel you just created, or paste the real
tunnel_id;Create the app and wait for ChatGPT to discover the tools.
The official instructions require tunnel-client to keep running; otherwise ChatGPT cannot discover or call the tools.
Step 7: Verify the Connection
In a new ChatGPT conversation, select or @ this app, then send:
调用 diagnostics 和 list_projects。
告诉我 Tunnel 后面的本地 MCP 是否正常,并列出已授权项目、读写权限、commit 权限和 push 权限。
不要修改任何文件。Under normal circumstances you should see the project list, and the default allowPush should be false. The new version provides 17 tools in total; if the old tools are still showing, restart the Tunnel and refresh the app in ChatGPT or start a new conversation.
Already Have a Tunnel: Add a New Project
If both the Tunnel and the login auto-start task were configured through this project, run in the repository directory:
.\scripts\quick-setup.ps1 `
-ProjectRoot "D:\Projects\another-app" `
-DiscoveryRoot "D:\Projects" `
-SkipInstall `
-SkipTests `
-RestartTunnelThis adds or updates the project configuration without overwriting other authorized projects.
If you did not register the login task through this project, remove -RestartTunnel; after configuration is complete, restart tunnel-client the way you did before. After restarting, refresh the tools in the ChatGPT app settings.
Let ChatGPT Automatically Connect Non-Git Projects
Common Node.js, Python, Java, Go, Rust, .NET, PHP, Ruby, Elixir, Swift, CMake and other project directories will be automatically recognized by discover_projects. Even if a directory has no common project markers, it can still be connected via an explicit absolute path within the approved DiscoveryRoot:
调用 discover_projects,列出已批准目录中的 Git 和非 Git 项目。
把 D:\Projects\notes-app 接入为可读写项目。
如果它不是 Git 仓库,必须自动关闭 commit 和 push。
接入后调用 list_projects,确认 projectType 和最终权限。After ChatGPT calls connect_project, the configuration is persisted immediately and takes effect in the current MCP process; no need to restart the Tunnel again for a single project.
View Only, No Modifications
.\scripts\quick-setup.ps1 `
-ProjectRoot "D:\Projects\reference-project" `
-DiscoveryRoot "D:\Projects" `
-ReadOnly `
-SkipInstall `
-SkipTests `
-RestartTunnelAllow Modifications, But Not Commits
.\scripts\quick-setup.ps1 `
-ProjectRoot "D:\Projects\my-app" `
-DiscoveryRoot "D:\Projects" `
-DisableCommit `
-SkipInstall `
-SkipTests `
-RestartTunnelOnly Add a Discoverable Project Parent Directory
.\scripts\quick-setup.ps1 `
-DiscoveryRoot "E:\OtherProjects" `
-SkipInstall `
-SkipTests `
-RestartTunnelDon't set DiscoveryRoot to the disk root, the entire user directory, or a directory containing large amounts of private files. It should be a parent directory dedicated to storing code repositories.
Daily-use Prompts
The project name is based on the ID returned by list_projects. The following prompts can be copied directly into ChatGPT, then replace the project name and requirements.
1. View and Analyze Only
使用 Secure Local Workspace MCP 检查项目 my-app。
先调用 list_projects 确认项目,再查看与登录流程有关的代码。
解释实现和可能的问题,不要修改文件,不要提交。2. Modify and Test, But Don't Commit
检查项目 my-app 的重复提交问题并完成修复。
修改前重新读取目标文件并使用最新 SHA-256,只改与本次问题有关的文件。
运行项目允许的 test 或 lint 任务,最后展示 git_status 和 git_diff。
不要 commit,不要 push。3. Modify, Test, and Create a Local Commit
修复项目 my-app 的重复提交问题。
运行相关测试,然后展示完整 git_diff 和 git_status。
确认差异只包含本次修改后,使用最新 statusSha256,
只提交本次涉及的明确文件,提交信息为:fix: prevent duplicate submissions。
提交后报告本地 commit SHA。不要 push。4. Only Commit Changes Already Completed
检查项目 my-app 当前 git_status 和 git_diff,不要继续改代码。
如果存在与本任务无关或已经预暂存的文件,停止并告诉我。
否则使用最新 statusSha256,只提交这些明确文件:src/example.js、test/example.test.js。
提交信息为:fix: handle duplicate submissions。不要 push。git_commit will reject:
., directories, or paths outside the project;Git status that has changed after review;
Pre-existing staged changes;
Sensitive paths such as
.env, private keys, certificates, password stores;High-confidence API Keys, Tokens, private keys, or real Tunnel/organization identifiers;
git diff --cached --checkfailures;Commit not enabled in the local configuration.
A successful commit only means it has been committed locally, not that it has been pushed.
Enable Controlled Push Separately
Push is an external write operation, so it must be explicitly enabled on this machine for the project. It is recommended to also restrict the target branch:
.\scripts\quick-setup.ps1 `
-ProjectRoot "D:\Projects\my-app" `
-AllowPush `
-AllowedRemote "origin" `
-AllowedBranch "main" `
-SkipInstall `
-SkipTests `
-RestartTunnelThen explicitly request it in ChatGPT:
检查项目 my-app 当前分支、HEAD、git_status 和待推送 commit。
只有在工作区状态和 commit 都符合预期时,才把当前 HEAD 推送到允许的 origin/main。
禁止 force push。分别报告本地 commit SHA、远端分支和推送结果。git_push will not automatically create a commit, nor will it push to an unconfigured remote or branch.
Automation vs. Manual Operation Boundaries
Operation | Automated? | Reason or explanation |
Install dependencies, run tests | Automated |
|
Add discovery directories and projects | Automated | Idempotent update, does not overwrite other projects |
Identify common npm tasks | Automated | Only adds to the fixed task whitelist |
Create and check Tunnel profile | Automated | Requires the user to provide Tunnel ID, Client path, and key reference |
Register login auto-start | Optionally automated | Use |
Create OpenAI Tunnel | User confirmation | Involves OpenAI organization and workspace permissions |
Create Runtime API Key | User confirmation | Keys should only be managed by the user or organization admin |
Create app in ChatGPT | User confirmation | ChatGPT shows permission and connection confirmation screens |
Git commit | ChatGPT executes per explicit instructions | Requires status review and explicit files by default |
Git push | Executed by ChatGPT after local authorization | Disabled by default, remote/branch restricted |
For more detailed batch configuration, proxy, auto-start, rollback, and unattended references, see: Windows Automation Configuration Guide.
Configuration Management
The default configuration file is located outside the repository:
%USERPROFILE%\.secure-local-workspace-mcp\config.jsonIf the new-version configuration doesn't exist, the service will compatibly read the old path:
%USERPROFILE%\.local-project-workspace\config.jsonView the current configuration:
npm run config -- listWhen not using PowerShell automation, you can also call the cross-platform configuration CLI:
npm run config -- add-discovery-root --root "D:\Projects"
npm run config -- add-project `
--root "D:\Projects\my-app" `
--writable `
--allow-commit `
--no-pushThe compatible script bootstrap-config.ps1 also idempotently adds or updates a single project without replacing the entire configuration.
Updating the Project
Set-Location .\secure-local-workspace-mcp
git pull --ff-only
npm ci
npm test
npm run smoke:mcpAfter code or tool definitions are updated, you must restart tunnel-client and refresh the app in ChatGPT or start a new conversation.
Revoking Project Access
Send in ChatGPT:
调用 disconnect_project 撤销项目 my-app 的 MCP 访问权限,然后重新列出项目。This only deletes the local authorization configuration; it does not delete the project directory, files, or Git history.
To remove the login auto-start task:
Stop-ScheduledTask -TaskName "Secure Local Workspace MCP Tunnel"
Unregister-ScheduledTask -TaskName "Secure Local Workspace MCP Tunnel" -Confirm:$falseThis does not delete the Tunnel, Runtime Key, profile, or project files.
FAQ
Git commit identity is missing
First set the Git username and email, then re-run the configuration:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Scheduled task not found
You used -RestartTunnel, but the Tunnel was not registered through this project. Remove that parameter to complete the project configuration, then restart tunnel-client the way you did before.
Can't see the Tunnel in ChatGPT
Check in order:
Whether the Tunnel is associated with the current ChatGPT workspace, not just the Platform organization;
Whether the current account has Tunnels Read + Use;
Whether ChatGPT developer mode is enabled;
Whether
tunnel-clientis still running and in a healthy/ready state.
ChatGPT Didn't Discover the 17 Tools
Restart the Tunnel runtime;
Run
tunnel-client doctor --profile <profile> --explain;Refresh in the ChatGPT app settings;
Start a new ChatGPT conversation to avoid old sessions continuing to use cached tool definitions.
Project Can't Be Discovered or Connected
The project must be within an approved
DiscoveryRoot;Git repositories and non-Git directories containing common project markers will automatically appear in discovery results;
Ordinary directories without project markers won't be listed automatically, but you can have ChatGPT call
connect_projectwith their explicit absolute path;Non-Git projects will show
projectType: non-gitand have commit and push forcibly disabled;Run
npm run config -- listto check the actual configuration;Re-add the parent directory and restart the Tunnel if needed.
Writes Rejected or SHA Expired
The project must allow writes;
Before modifying or deleting an existing file, ChatGPT must re-call
read_file;After a file is modified by another program, the old SHA becomes invalid; this is normal concurrency protection.
Commit Rejected Due to Existing Staged Changes
First have ChatGPT call git_status to check. When you confirm it's safe to unstage, call git_unstage to handle the explicit files; this operation does not discard working directory content.
Tunnel Works Locally, But ChatGPT Calls Time Out
Check outbound connectivity to
api.openai.com:443;The browser being able to use a proxy doesn't mean
tunnel-clientautomatically uses the same proxy;Write the proxy in via
-HttpProxyduring initial configuration;Check the local firewall, proxy certificates, and organizational network policies.
Local Verification
npm ci
npm test
npm run smoke:mcp
npm audit --omit=devLocal MCP foreground startup:
.\scripts\start-local.ps1The Tunnel status should at least satisfy:
process_running = true
healthy = true
ready = trueSecurity Recommendations
Discovery Root should be a dedicated project parent directory; don't use the disk root or the entire user directory;
Prefer enabling only commit; enable push per project, remote, and branch only when truly needed;
Runtime Key, Tunnel profile, real configuration, and logs must be stored outside the repository;
MCP commit temporarily disables project Git hooks; testing and formatting should be run through the explicit task whitelist;
Still verify the explicit commit SHA, remote, and branch before pushing;
If a key is accidentally committed, revoke it immediately and clean the complete Git history.
For security design and vulnerability reporting, see SECURITY.md.
Official References
License
MIT
Available Tools
17 toolsapply_patchApply a guarded unified patchA
Apply a unified diff to one existing text file after verifying the SHA-256 returned by read_file.
Inputs: path (required), patch (required), projectId (required), expectedSha256 (required).
connect_projectConnect a local projectA
Authorize one directory beneath a locally approved discovery root. Non-Git projects can be edited, but commit and push are automatically disabled.
Inputs: projectPath (required), label, writable, projectId, +1 more.
create_text_fileCreate a text fileB
Create a new text file without overwriting an existing path.
Inputs: path (required), content (required), projectId (required).
delete_text_fileDelete a guarded text fileADestructive
Delete one regular text file only after verifying the latest SHA-256 returned by read_file.
Inputs: path (required), projectId (required), expectedSha256 (required).
diagnosticsCheck local project workspaceARead-only
Check configuration and safety capabilities before starting local project work.
Inputs: no named parameters.
disconnect_projectDisconnect an authorized projectADestructive
Remove one project from the MCP authorization list without deleting any project files.
Inputs: projectId (required).
discover_projectsDiscover local projectsARead-only
Find Git repositories and common non-Git project folders only beneath parent folders that the user approved locally during setup.
Inputs: maxDepth, maxProjects, includeNonGit, maxDirectories.
git_commitCommit selected project changesB
Stage and commit only explicit relative paths after status review, concurrency validation, whitespace checks, and sensitive-content scanning.
Inputs: paths (required), message (required), projectId (required), expectedStatusSha256 (required).
git_diffShow Git diffBRead-only
Run a fixed, read-only Git diff command in an authorized project.
Inputs: projectId (required), staged.
git_pushPush the current commitA
Push the reviewed current commit without force to an allowlisted remote and branch. This must be enabled locally per project.
Inputs: projectId (required), expectedCommitSha (required), remote.
git_statusShow Git statusBRead-only
Run a fixed, read-only Git status command in an authorized project.
Inputs: projectId (required).
git_unstageUnstage selected Git pathsA
Remove explicit paths from the Git index without changing their working-tree contents.
Inputs: paths (required), projectId (required), expectedStatusSha256 (required).
list_filesList project filesBRead-only
List files and directories beneath an authorized project path.
Inputs: projectId (required), maxDepth, maxEntries, pathPrefix.
list_projectsList authorized local projectsARead-only
List the local projects, write permissions, and task names authorized by the user.
Inputs: no named parameters.
read_fileRead a project text fileBRead-only
Read a bounded line range from a text file and return its SHA-256 edit precondition.
Inputs: path (required), projectId (required), endLine, startLine.
run_taskRun an allowlisted project taskA
Run one task whose executable and arguments were explicitly configured by the user.
Inputs: taskName (required), projectId (required).
search_textSearch project textARead-only
Search for a literal string across bounded text files in an authorized project.
Inputs: query (required), projectId (required), extensions, maxResults, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a distinct operation—project discovery/auth, file read/write, git workflow, or task execution—so an agent can reliably select based on action. The only mild pairing is list_projects vs discover_projects, but their descriptions clearly separate authorized projects from available ones.
Most tools follow a predictable verb_noun pattern like list_files, read_file, apply_patch, and run_task. diagnostics is a noun-style outlier, and the git_* family uses command nouns (git_status, git_diff) rather than verbs, but the overall pattern remains recognizable.
At 17 tools, the server is slightly above the typical 3–15 range, but the count is justified by covering project discovery, authorization, file editing, git operations, and task execution. Each tool earns its place and none feel redundant.
The toolset covers project lifecycle, file CRUD/search, core git commit/push workflows, and configured task execution with no dead ends. Minor gaps like file rename/move or git branch/log operations are not essential to the secure workspace purpose but could be nice additions.
Maintenance
Related MCP Connectors
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to inspect and edit local projects through a secure MCP interface, offering workspace management, file operations, git integration, and safe command execution.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT web to safely read and modify only explicitly allowed local project files through OpenAI Secure MCP Tunnel, including git operations, file edits, and running project scripts, while enforcing strict security boundaries.30MIT
- AlicenseNot gradedqualityDmaintenanceEnables ChatGPT or any MCP client to operate safely on a designated workspace by listing, reading, searching, writing, and trashing files, inspecting Git status/log/diff, and optionally running allowlisted executables without a shell.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to read and edit local project files, inspect Git changes, and run approved development scripts through a secure MCP tunnel, with optional Codex Desktop integration.8Apache 2.0