{"id":50489230,"url":"https://github.com/cuzfrog/wsl-windows-shutdown-mcp","last_synced_at":"2026-06-02T01:03:13.423Z","repository":{"id":356846678,"uuid":"1234283236","full_name":"cuzfrog/wsl-windows-shutdown-mcp","owner":"cuzfrog","description":"MCP server for shutting down Windows from WSL","archived":false,"fork":false,"pushed_at":"2026-05-10T02:50:15.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-10T04:30:54.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuzfrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T01:29:27.000Z","updated_at":"2026-05-10T02:50:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cuzfrog/wsl-windows-shutdown-mcp","commit_stats":null,"previous_names":["cuzfrog/wsl-windows-shutdown-mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cuzfrog/wsl-windows-shutdown-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzfrog%2Fwsl-windows-shutdown-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzfrog%2Fwsl-windows-shutdown-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzfrog%2Fwsl-windows-shutdown-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzfrog%2Fwsl-windows-shutdown-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuzfrog","download_url":"https://codeload.github.com/cuzfrog/wsl-windows-shutdown-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzfrog%2Fwsl-windows-shutdown-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33800676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T01:03:10.765Z","updated_at":"2026-06-02T01:03:13.411Z","avatar_url":"https://github.com/cuzfrog.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wsl-mcp-shutdown\n\nA tiny [MCP](https://modelcontextprotocol.io/) server that runs on your **Windows host** and lets an AI agent running inside **WSL** shut down your PC or cancel a shutdown.\n\n```\nWSL agent (Claude / any MCP client)\n        │  HTTP + SSE  (localhost:8000)\n        ▼\n  shutdown_server.py  (runs on Windows)\n        │  subprocess\n        ▼\n  Windows shutdown.exe / rundll32.exe\n```\n\n---\n\n## Requirements\n\n| Requirement | Notes |\n|---|---|\n| **Windows 10 / 11** | Host machine |\n| **Python 3.9 or newer** | Must be on `PATH` in `cmd.exe` — verify with `python --version` |\n| **WSL 2** | With an MCP-compatible agent (e.g. Claude Code) |\n\n\u003e **Python must already be installed.** Download it from \u003chttps://www.python.org/downloads/\u003e and make sure *\"Add Python to PATH\"* is checked during setup. The installer handles everything else.\n\n---\n\n## Installation (Windows)\n\n1. **Clone or download this repo onto your Windows filesystem** (not inside WSL):\n\n   ```cmd\n   git clone https://github.com/your-username/wsl-mcp-shutdown.git\n   cd wsl-mcp-shutdown\n   ```\n\n   Or download and extract the ZIP from GitHub.\n\n2. **Run the installer** in a plain `cmd.exe` window (no Administrator needed):\n\n   ```cmd\n   install.bat\n   ```\n\n   The installer will:\n   - Create a Python virtual environment (`.venv`) in the repo folder\n   - Install the `mcp[cli]` package into it\n   - Generate a `start_mcp.bat` launcher with editable settings\n   - Copy `start_mcp.bat` to your Windows **Startup** folder so the server launches automatically on login\n\n3. *(Recommended)* **Set an auth token** — open `start_mcp.bat` in Notepad and set:\n\n   ```bat\n   set \"MCP_SHUTDOWN_TOKEN=your-secret-here\"\n   ```\n\n   Save the file. Any client calling the server must pass this token as the `token` argument to each tool. Leave it blank to disable auth (only safe on a private machine).\n\n4. **Start the server now** (it will also start automatically after your next login):\n\n   ```cmd\n   start_mcp.bat\n   ```\n\n   You should see:\n   ```\n   [mcp-shutdown] Starting SSE server on port 8000\n   ```\n\n---\n\n## Configure Your WSL Agent\n\nAdd the server to your MCP client config. For **Claude Code** (`~/.claude/claude_mcp_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"windows-shutdown\": {\n      \"type\": \"sse\",\n      \"url\": \"http://localhost:8000/sse\"\n    }\n  }\n}\n```\n\n### WSL 2 — if `localhost` doesn't work\n\nWSL 2 has `localhost` forwarding enabled by default on modern Windows builds. If it doesn't work, find your Windows host IP from inside WSL:\n\n```bash\ncat /etc/resolv.conf | grep nameserver | awk '{print $2}'\n```\n\nThen use that IP (e.g. `http://172.22.16.1:8000/sse`) in your config.\n\n### Quick connectivity test (from WSL bash)\n\n```bash\ncurl -N http://localhost:8000/sse\n# Should print an SSE stream header — Ctrl+C to exit\n```\n\n---\n\n## Available Tools\n\n| Tool | What it does |\n|---|---|\n| `shutdown_windows` | Shuts down Windows (optional delay \u0026 message) |\n| `cancel_shutdown` | Cancels a pending shutdown or restart |\n\nAll tools accept an optional `token` argument (required if `MCP_SHUTDOWN_TOKEN` is set).\n\n---\n\n## Changing the Port/Host\n\nOpen `start_mcp.bat` and `wsl-mcp-shutdown.bat` (in Startup) and change:\n\n```bat\nset \"MCP_SHUTDOWN_PORT=8000\"\nset \"MCP_SHUTDOWN_HOST=\u003cyour host IP\u003e\"\n```\n\nThen update the port in your MCP client config to match.\n\n---\n\n## Auto-start Behaviour\n\nThe installer places `wsl-mcp-shutdown.bat` in:\n\n```\n%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\\n```\n\nThis means the server starts automatically **when you log in to Windows**. The window appears briefly in the taskbar; it stays running in the background.\n\nTo disable auto-start, delete the shortcut from that Startup folder, or run:\n\n```cmd\nuninstall.bat\n```\n\n---\n\n## Uninstall\n\n```cmd\nuninstall.bat\n```\n\nThis removes the Startup shortcut and the `.venv` folder. The repo directory itself is left intact.\n\n---\n\n## Security Notes\n\n- It is **strongly recommended** to set `MCP_SHUTDOWN_TOKEN`.\n- For extra isolation, configure Windows Firewall to block port 8000 from external networks (allow only `127.0.0.1`).\n- The tools call the standard Windows `shutdown.exe` — no third-party binaries, no elevated privileges required for scheduling.\n\n---\n\n## Troubleshooting\n\n| Symptom | Fix |\n|---|---|\n| `python not found` | Re-install Python with \"Add to PATH\" checked; open a fresh `cmd.exe` |\n| `pip install failed` | Check your internet connection; run `install.bat` again |\n| Agent can't connect | Check the server window is open; try the `curl` test above; check Windows Firewall |\n| `Error: Invalid or missing auth token` | Add `\"token\": \"your-secret\"` to your tool call arguments |\n| Port already in use | Change `MCP_SHUTDOWN_PORT` in `start_mcp.bat` and update MCP config |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuzfrog%2Fwsl-windows-shutdown-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuzfrog%2Fwsl-windows-shutdown-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuzfrog%2Fwsl-windows-shutdown-mcp/lists"}