WorkspaceGuard MCP
Provides read-only Git repository tools for the configured workspace, allowing agents to inspect status, log, and diff without enabling shell access.
Click on "Install 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., "@WorkspaceGuard MCPWhat files are in my workspace and what's the git status?"
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.
WorkspaceGuard MCP
WorkspaceGuard MCP is a local, cross-platform MCP server that lets ChatGPT or an MCP client operate on one designated workspace. The project was rebuilt after studying FileMCP, keeping the useful security principles and trimming parts not yet needed for the first release.
What is it for?
List, read by file or by line, search by name and search by content.
Write files atomically, with
dry_runandexpected_sha256support to avoid overwriting newer changes."Delete" by moving into
.workspaceguard/trash, with manual restore possible.Read Git status, log, and diff without enabling a shell.
Optionally run a terminal via
program + args, without shell string concatenation, and only allow executables in an allowlist.Use over
stdioor MCP Streamable HTTP on127.0.0.1with a token.Write audit JSONL without storing file contents or full command arguments.
Related MCP server: Kastor
Key improvements
Topic | Original FileMCP | WorkspaceGuard MCP |
Cross-platform core | Swift and C# parallel implementations | One TypeScript core for macOS/Windows/Linux |
Permissions | File/Git; shell on or off |
|
Running commands | Shell string ( | Executable + args array, |
Writing files | Write/append, with atomic replace | Atomic replace + dry-run + optimistic lock SHA-256 |
Delete | Real file/folder deletion | Move to internal trash |
Secret files | No dedicated denylist | Blocks |
Observability | Runtime log | Audit JSONL with request ID, result, and duration |
Protocol | Self-built HTTP/MCP parser | Official MCP TypeScript SDK v2 from the MCP project |
The app has an Electron desktop UI to pick a workspace, pick a mode, pick a command allowlist, start/stop the server, run an MCP check right inside the app, and connect a Secure MCP Tunnel. Following FileMCP's approach, the app generates a new loopback token per session, keeps the server on 127.0.0.1, manages the tunnel-client lifecycle, and stores the Runtime API key using the OS encryption mechanism (Keychain on macOS when available). The tunnel-client binary is still downloaded by the user from OpenAI; the project does not bundle that binary. The local runtime and Tunnel do not call Codex or OpenAI models/APIs: you use the app with ChatGPT Web through a developer-mode app, so no Codex quota is used. The conversation still follows the limits of the ChatGPT plan you are using.
Requirements
Node.js 20 or later (tested with Node.js 24).
Git if using the
git_*tools.For ChatGPT: a workspace that supports custom MCP apps, a Secure MCP Tunnel, and a runtime API key with the appropriate tunnel permission. See OpenAI Secure MCP Tunnel.
Step-by-step setup
Step 1 — install dependencies
cd "/Users/danhpham/Documents/ChatGPT/MCP"
npm installDo not put API keys in .env or commit them to Git.
Step 2 — check the whole project
npm run verifyThis command runs typecheck, unit/integration tests, a production build, and a semantic smoke test over MCP stdio.
Step 3 — run the desktop UI (easiest way)
npm run desktopIn the WorkspaceGuard window:
Click Choose folder… and pick a test workspace.
Keep Read-only for the first run.
Click Start MCP. When the status changes to Running, the HTTP server is ready on
127.0.0.1:<port>.Click Stop when done. Closing the app also stops both the server and the Tunnel.
The UI does not display or store the HTTP token; a new token is generated in the main process on every start.
Run a full MCP check right inside the UI
After the server reports Running, click Run MCP check. This is a real MCP client in the Electron main process, not a fake check through the UI.
With Read-only, the app checks the MCP HTTP handshake, tool discovery,
workspace_info, andlist_files.With Read and write, the app additionally checks
write_file→read_file→trash_path. You must tick the confirmation because a test file with a random name will be moved into.workspaceguard/trash.With Run commands, keep
nodeticked in the allowlist so the app additionally checksrun_commandusingnode --version.
Pick a separate test folder for the last two modes. The result of each step appears right in the check section of the UI.
Step 4 — build the core from the terminal (optional)
npm run buildThe production entry point is:
/Users/danhpham/Documents/ChatGPT/MCP/dist/index.jsStep 5 — pick a workspace and mode from the terminal (optional)
It is best to start with a small test folder:
mkdir -p /tmp/workspaceguard-demo
printf 'Xin chào MCP\n' > /tmp/workspaceguard-demo/hello.txtThree modes:
read-only: only file-read and Git-read tools. This is the default.workspace-write: addswrite_fileandtrash_path.command: adds write permission andrun_command.
Note: the server still writes internal audit to .workspaceguard/audit.jsonl in all three modes. "Read-only" describes the public tools, not the filesystem sandbox of the server process itself.
Step 6A — run over stdio (recommended)
node dist/index.js \
--root /tmp/workspaceguard-demo \
--transport stdio \
--mode read-onlyThe terminal will wait for the MCP client to send requests over stdin. This is correct behavior, not a hang.
Step 6B — enable write permission
node dist/index.js \
--root /tmp/workspaceguard-demo \
--transport stdio \
--mode workspace-writetrash_path defaults to dry_run=true. Only when the caller sends dry_run=false is the path moved to trash.
Step 6C — allow running terminal commands yourself
node dist/index.js \
--root /tmp/workspaceguard-demo \
--transport stdio \
--mode command \
--allow-command git,node,npm,npxExample tool input:
{
"program": "npm",
"args": ["test"],
"cwd": "",
"timeout_seconds": 120
}run_command does not use a shell, but it is not an OS sandbox. node, npm, Python, or any allowed executable can still read/write outside the workspace, use the network, and run other processes with the current account's privileges. Only use command mode with a trusted workspace and workflow.
Step 7 — connect ChatGPT using the Secure MCP Tunnel UI
On OpenAI Platform, create a Secure MCP Tunnel and a runtime API key with permission to use the tunnel. Download the tunnel-client matching your OS. Do not give the Runtime API key to Codex and do not write it into .env, source, or Git.
In the app, after MCP reports Running:
Paste the Tunnel ID in the form
tunnel_....Paste the Runtime API key. Next time you can leave it blank to use the encrypted saved key.
Enter
tunnel-clientif the binary is already inPATH, or click Choose file… to select the downloaded binary.Keep the default profile, click Connect Tunnel, and wait for the "ready for ChatGPT" message.
The green "ready for ChatGPT" line confirms the local side is connected. Click Open ChatGPT Web; this app does not open or call Codex.
Click Disconnect Tunnel if you only want to disconnect ChatGPT; click Stop to stop both the Tunnel and the MCP server.
The app performs the equivalent of the tunnel-client init --sample sample_mcp_remote_no_auth → doctor --explain → run sequence, with the MCP endpoint http://127.0.0.1:<port>/mcp, a local health endpoint, and the token header passed via an environment variable. Tunnel profiles live in the app's private data, not in the workspace.
In ChatGPT Web, enable Developer Mode/custom MCP app per your workspace policy, create a new app, choose the Tunnel connection, select the tunnel you just created, run Scan Tools, then try workspace_info, list_files, and read_file before enabling write tools. If you do not see the Tunnel option, check that your workspace has been granted read permission and Tunnel access.
Step 8 — HTTP loopback (optional)
export WORKSPACE_MCP_TOKEN="$(openssl rand -hex 32)"
node dist/index.js \
--root /tmp/workspaceguard-demo \
--transport http \
--mode read-only \
--port 7331Health check:
curl --fail http://127.0.0.1:7331/healthzMCP requests must send the header:
X-Workspace-MCP-Token: <WORKSPACE_MCP_TOKEN>The HTTP server only binds 127.0.0.1, checks Host, Origin, token, basic framing, and body limits. Use stdio if you have no specific HTTP need.
Available tools
Always available
workspace_infolist_filesread_fileread_file_rangesearch_filenamessearch_contentgit_statusgit_loggit_diff
workspace-write or command mode
write_filetrash_path
command mode only
run_command
Restoring trashed files
The tool returns trashPath. Restore with a local command, for example:
mv "/tmp/workspaceguard-demo/.workspaceguard/trash/<id>/remove-me.txt" \
"/tmp/workspaceguard-demo/remove-me.txt"WorkspaceGuard does not automatically clean the trash in this version to avoid deleting data unintentionally.
Structure
src/
├── config.ts # CLI/env và mode
├── security/path-policy.ts # containment + sensitive-path policy
├── services/files.ts # file/search/write/trash
├── services/git.ts # Git read-only
├── services/process.ts # process limits + tree cleanup
├── tools.ts # MCP schemas, annotations, audit
├── server.ts # stdio + HTTP loopback
├── desktop/ # Electron main/preload + renderer an toàn
└── index.ts # CLI entry
tests/ # unit, integration, MCP semantic smoke
docs/ # phân tích source và lộ trìnhAdditional documentation
License and references
The project uses the Apache License 2.0. FileMCP also uses Apache-2.0; see NOTICE for the reference design sources. The tunnel-client binary is not included; operators download the appropriate build from the official OpenAI source.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables ChatGPT to inspect and edit local projects through a secure MCP interface, offering workspace management, file operations, git integration, and safe command execution.4MIT
- AlicenseNot gradedqualityAmaintenanceLets ChatGPT or MCP clients work with files on your machine, with tools for reading, editing, searching, git operations, and safety checks.MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to securely operate a single Windows development workspace via a local MCP server, offering file editing, Git status, static analysis, approved test/build, and limited ADB operations with audit logging.MIT
- AlicenseAqualityBmaintenanceEnables ChatGPT and Codex to safely work with explicitly authorized local project folders through MCP, providing constrained file reading, searching, patch editing, Git inspection, and whitelisted tasks without exposing arbitrary shell, deletion, or deployment capabilities.17MIT
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Project management MCP for AI agents with safe task reads and writes.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/phamcongdanh98/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server