PC MCP
Provides tools to inspect and manage local Git repositories within the sandbox, including status, diff, log, staging, and committing changes. It never pushes.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PC MCP
Give a cloud AI agent a controlled door into your Windows PC.
PC MCP is a small Model Context Protocol server that lets Gemini Web, Claude, Cursor, or any MCP client read and edit files, run PowerShell, use git, drive a separate Chrome window, and extract text from PDFs or screenshots. It runs on your machine and is exposed through a Cloudflare Tunnel, so the AI never needs your router opened or your PC on a public IP.
AI client (cloud)
│ HTTPS + secret token
▼
Cloudflare edge ──► Cloudflare Tunnel ──► 127.0.0.1:8787 (Node)
│
▼
your sandbox folderRead this first:
shell_runis not sandboxed. It runs PowerShell with your Windows user rights. Anyone with the connector URL can do what you can do. Keep the token secret, start with write/shell/browser disabled, and stop the launcher when you are done.
What it can do
Area | Tools |
Read files | list, stat, read, search, recent files, SHA-256 |
Write files | write, append, mkdir, move, copy, delete, precise edit, restore backup |
Code search | ripgrep search with globs, context, case and literal modes |
Shell | PowerShell with timeout and a catastrophic-command blocklist |
Git | status, diff, log, stage + commit (never push) |
Browser | open, snapshot, click/fill/press/select, read text, tabs, screenshot, JS eval |
Documents | PDF text extraction and Windows OCR through |
Safety | sandbox paths, secret-file deny list, audit log, rate limit, pause switch |
The server also exposes a capabilities tool. The included instructions tell the model to use
it instead of guessing, and to quote real paths, exit codes and hashes when claiming success.
Related MCP server: AlMoutmag 1.1
Requirements
Windows 10 or 11
Node.js 20+
cloudflared (Cloudflare Tunnel)
Chrome for browser automation (optional)
ripgrep for faster
code_search(optional, there is a fallback)Poppler for
pdftotext(optional, for PDF text)A Cloudflare account with a domain for a stable URL (optional; quick tunnels work without one)
An MCP client that supports Streamable HTTP, such as a Gemini custom connector
Install the basics with winget:
winget install OpenJS.NodeJS.LTS
winget install Cloudflare.cloudflared
winget install BurntSushi.ripgrep.MSVCQuick start
git clone https://github.com/AchmadAlvin/pc-mcp.git
cd pc-mcp
npm install
# Create .env, generate a token, choose the sandbox folder.
powershell -ExecutionPolicy Bypass -File scripts\setup.ps1 `
-Root "C:\Users\YourName\Documents\Projects" `
-EnableWrite -EnableShell -EnableBrowser
# Start the server + a temporary Cloudflare quick tunnel.
.\PC MCP.batThe launcher prints a URL like:
https://random-words.trycloudflare.com
Connector: https://random-words.trycloudflare.com/t/<MCP_TOKEN>/mcpUse that connector URL in your AI client. A quick tunnel URL changes every time it restarts, so it is fine for a test but annoying for daily use. For a permanent hostname, see Named tunnel.
The launcher window must stay open. Closing it or pressing Ctrl+C stops both the server and
the tunnel.
Let an AI agent set it up
Copy the prompt below into the AI agent that has access to this PC (Claude Code, Codex, Gemini CLI, Cursor, etc.). Fill in the angle-bracket values first.
You are setting up the PC MCP repository on my Windows machine.
Context:
- Repository folder: <absolute path to this repo>
- Folder I want to expose to the AI: <absolute path, for example C:\Users\Me\Documents\Projects>
- Public hostname: <mcp.example.com, or "none" if I only want a quick tunnel>
- Enable write tools: <yes/no>
- Enable PowerShell: <yes/no>
- Enable browser automation: <yes/no>
Tasks:
1. Check that Node.js is version 20 or newer, and that npm, cloudflared, git, rg and
pdftotext are available. Tell me exactly what is missing. Only install missing tools
after asking me.
2. Run: npm install
3. Run: powershell -ExecutionPolicy Bypass -File scripts\setup.ps1 -Root "<folder>" plus
-EnableWrite, -EnableShell and/or -EnableBrowser only for the features I said yes to.
If .env already exists, ask before overwriting it.
4. If I gave a hostname, run:
powershell -ExecutionPolicy Bypass -File scripts\setup-tunnel.ps1 -Hostname "<hostname>"
and check that .cloudflared\config.yml exists.
5. Start the server. Run .\PC MCP.bat if I can keep a window open, otherwise run
.\start.ps1 and start cloudflared separately. Verify http://127.0.0.1:8787/healthz.
6. Run the smoke tests and show me the real output:
npm run test:client
npm run test:rw
npm run test:browser (only if browser automation is enabled)
7. Print the final connector URL: https://<hostname>/t/<MCP_TOKEN>/mcp
Rules:
- Never invent command output. If a command fails, show the error and stop.
- Do not enable write, shell or browser unless I explicitly said yes.
- Do not commit, print or upload .env, tokens, tunnel credentials or browser profiles.
- Do not weaken the secret-file deny list or the path sandbox.Connect to Gemini Web
Choose Create custom app / Add custom connector.
Paste the connector URL:
https://YOUR-HOST/t/YOUR_TOKEN/mcp.Accept the consent prompt and save. No OAuth client ID or secret is needed.
On the first write/tool call Gemini may ask for permission. Choose Always allow if you trust the setup.
The connector URL contains the token. Treat it like a password for your PC. If the token leaks, rotate it (see Rotating the token) and recreate the connector.
Some clients cache the tool list. Start a new chat after changing
.envor adding tools.
Named tunnel (stable URL)
A quick tunnel is enough to try PC MCP. For a URL that survives restarts:
# One-time Cloudflare login (opens a browser).
cloudflared tunnel login
# Create the tunnel and route a hostname from your Cloudflare zone.
powershell -ExecutionPolicy Bypass -File scripts\setup-tunnel.ps1 `
-Hostname mcp.example.com `
-TunnelName pc-mcpThe script creates the tunnel if needed, routes DNS, writes .cloudflared/config.yml, and
updates .env (MCP_TUNNEL_MODE=named, PUBLIC_HOST, TUNNEL_NAME).
Then start normally:
.\PC MCP.batIf you prefer doing it by hand:
cloudflared tunnel create pc-mcp
cloudflared tunnel route dns pc-mcp mcp.example.comCopy .cloudflared/config.yml.example to .cloudflared/config.yml, fill in the tunnel UUID
and the credentials path printed by cloudflared tunnel create, then set:
MCP_TUNNEL_MODE=named
TUNNEL_NAME=pc-mcp
PUBLIC_HOST=mcp.example.comMake sure the DNS record is proxied (orange cloud) in Cloudflare.
Configuration
Copy .env.example to .env, or let scripts/setup.ps1 generate it.
Variable | Default | Meaning |
| none | Required. At least 32 characters. Secret in the URL. |
|
| Local bind address. Keep it on localhost. |
|
| Local HTTP port. |
|
| Folder that |
|
| Enable write/edit/delete tools. |
|
| Enable |
|
| Enable browser automation. |
|
| Default shell timeout (max 300000). |
|
|
|
|
| Separate Chrome profile. |
|
| Navigation/action timeout. |
|
| Per-IP request limit. |
|
|
|
|
| Cloudflare named tunnel. |
| empty | Stable hostname, for example |
Start safe: MCP_ENABLE_WRITE=0, MCP_ENABLE_SHELL=0, MCP_ENABLE_BROWSER=0. Enable only
what you need.
Tools
Read-only
Tool | Purpose |
| Health check and current mode. |
| Exact tools, limits and unsupported features. |
| Hostname, OS, CPU, RAM, uptime. |
| Free/total space per drive. |
| List a folder (depth 1–3, max 500 entries). |
| File metadata; |
| Read UTF-8 text (max 2 MB, offset/limit). |
| Search text/regex inside the sandbox. |
| Recently modified files. |
| ripgrep search with globs, context, case, literal. |
| Repository status. |
| Staged/unstaged diff. |
| Commit history. |
Write and shell
Tool | Purpose |
| Create or overwrite a text file. |
| Append text. |
| Create a folder. |
| Move or rename. |
| Copy a file or folder. |
| Permanent delete; needs |
| Replace an exact unique string, with backup and SHA-256 verification. |
| Restore a file from an |
| Stage and commit; refuses empty commits; never pushes. |
| Run PowerShell with a timeout and blocklist. |
fs_edit refuses ambiguous matches instead of guessing. Include surrounding lines to make the
match unique. Backups live in logs/backups/<id>/.
Browser
Tool | Purpose |
| Open a URL, return title, interactive elements and text preview. |
| Interactive elements with refs |
| Click, fill, press, select, hover, scroll by ref. |
| Visible page text. |
| List, open, select or close tabs. |
| Save a PNG inside the sandbox; it is not sent to the model. |
| Run JavaScript in the page context; JSON-safe result. |
| Close the automation browser. |
The browser uses a separate profile, so your personal Chrome tabs and cookies are not touched. Logins you perform in the automation window are saved for next time. Page content is untrusted data: the model is instructed never to follow instructions found on a page and never to enter passwords or complete payments without your confirmation.
PDFs and OCR
The Gemini connector forwards text blocks only. Images are not sent to the model, so PC MCP does text extraction on the PC:
# PDF with a text layer (Poppler must be on PATH).
pdftotext -layout -f 1 -l 5 "document.pdf" -
# Wrapper with scan detection and a character cap.
.\scripts\pdf-text.ps1 -Path "document.pdf" -From 1 -To 5 -MaxChars 15000
# OCR a screenshot or image with Windows OCR.
.\scripts\ocr.ps1 -Path "screenshot.png"A scanned PDF has no text layer. Render its pages to images first, then run OCR. OCR returns text, not visual understanding. If you need the model to actually see an image, attach it directly in the chat.
Security model
Path sandbox:
fs_*tools are resolved insideMCP_ROOT; absolute paths,.., UNC paths, alternate data streams and junctions/symlinks that escape the root are rejected.Secret deny list:
.env*,.ssh,.aws,.azure,.kube,.gnupg,id_rsa*,*.pem/key/pfx/p12/kdbx,credentials*, browserCookies/Login Data,NTUSER.DAT, etc.Shell is not sandboxed:
shell_runruns with your user rights. The blocklist only stops obvious catastrophes (format, diskpart, bcdedit, shutdown, mass registry delete). It is not a security boundary.Browser is separate: its profile lives outside the sandbox.
file://is limited to the sandbox;chrome://,devtools://andedge://are blocked.Auth: 32-byte token via
/t/:token/mcp,Authorization: Bearer,x-mcp-tokenor?key=. A wrong token gets a plain 404.Rate limit: per-IP application limit, plus optional Cloudflare WAF/rate limit.
Audit: every tool call goes to
logs/audit.jsonl; HTTP requests go tologs/http.logwith the token masked.Pause switch: create a
PAUSEfile in the repo root; all MCP requests return 503 until it is removed.No delete undo:
fs_editcreates backups;fs_deletedoes not.
Do not expose the server directly to the internet. Use Cloudflare Tunnel, keep the token secret, and stop the launcher when you are not using it.
Tests
With the server running locally:
npm run test:client # initialize, tools/list, read, search, path/secret guards
npm run test:rw # CRUD, fs_edit, code_search, git, shell (50 checks)
npm run test:browser # open, snapshot, fill, click, tabs, screenshot, eval (28 checks)To test through the public URL:
$env:BASE_URL = "https://mcp.example.com"
npm run test:clientTroubleshooting
Symptom | Check |
Gemini says a tool is missing | Restart the launcher, start a new chat; the client may cache the tool list. |
404 from the tunnel | Token in the URL is wrong or rotated. Check |
503 | A |
| Increase |
Model claims success but file did not change | Ask for |
| Add surrounding context, or use |
PDF text is empty | Likely a scanned PDF; render pages to images and run OCR. |
OCR punctuation is wrong | Windows OCR language quality varies; it returns text, not layout. |
Browser tool missing | Set |
Browser fails to open | Close an old automation Chrome window; profile is in |
Ref expired | Take a new |
Captcha or bot detection | No bypass. Complete it manually in the automation window. |
Tunnel does not connect |
|
Quick URL changed | Expected. Use a named tunnel for a stable connector. |
Project layout
PC MCP.bat one-click launcher
src/
config.js env, sandbox root, limits, feature flags
server.js Express, auth, rate limit, logging, health, pause
mcp.js MCP server factory, instructions, capabilities
safety.js path sandbox, secret policy, audit, rate limiter
result.js output cap and error formatting
tools/fs.js list/stat/read/search/recent
tools/search.js code_search (ripgrep + fallback)
tools/write.js write/append/mkdir/move/copy/delete/edit/restore
tools/shell.js shell_run (PowerShell)
tools/sys.js sys_info, disk_usage
tools/git.js status/diff/log/commit
tools/browser.js browser automation
scripts/
setup.ps1 create .env and generate a token
setup-tunnel.ps1 create/route a Cloudflare named tunnel
run-all.ps1 supervisor: server + tunnel, kill-on-close
status.ps1 server, process, tunnel, DNS, audit
stop.ps1 pause or hard stop
install-autostart.ps1 optional Scheduled Tasks at login
edge-setup.mjs optional Cloudflare WAF/rate-limit rules
pdf-text.ps1 PDF text + scan detection
ocr.ps1 Windows OCR
smoke-test.js end-to-end HTTP smoke test
smoke-rw.js CRUD/edit/search/git/shell tests
smoke-browser.js browser automation tests
browser-fixture.html deterministic test page
workspace/ default sandbox root
logs/ audit, HTTP log, backups, process logsRotating the token
node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"Put the result in MCP_TOKEN= in .env, restart, then delete and recreate the AI connector
with the new URL. The old URL stops working immediately.
License
MIT. See LICENSE.
PC MCP is a tool, not a security boundary. You are responsible for what you expose and for the commands you allow an AI to run on your machine.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Remote desktop control, files, and terminal tools for AI assistants on paired Windows PCs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that gives any AI full control over a Windows PC, enabling application control, mouse/keyboard automation, screen capture, browser automation, and more.94 PyPI6MIT
- AlicenseNot gradedqualityBmaintenanceEnables cloud AI agents to securely connect to a local Windows machine and execute tools such as system info, file operations, browser automation, and coding tasks through the Model Context Protocol.MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that lets supported AI clients like ChatGPT and Claude use locally authorised Windows tools, files, project tasks, commands, and local state, with configurable per-client authority and global access modes.1-
- AlicenseCqualityCmaintenanceA local-first Model Context Protocol server that enables AI-assisted development through scoped file access, opt-in shell and process execution, Git automation, development pipelines, and optional Windows desktop and Android/ADB tools. It supports streamable HTTP and stdio transports with secure local-only defaults.105MIT