Skip to main content
Glama
Queen MCP

Queen MCP

by kaxokaze
README.md
# Queen MCP

**A portable Windows GUI that exposes one selected folder as an authenticated MCP server through Cloudflare Tunnel.**

Queen MCP is designed to be simple to test:
1. Open `QueenMCP.exe`.
2. Choose a project folder.
3. Select **Restricted** or **Unrestricted**.
4. Click **Start MCP + Tunnel**.
5. Copy the public MCP URL and session bearer token into an MCP client that supports custom Streamable HTTP servers.

## Download

The GitHub Actions workflow builds a single-file Windows x64 GUI executable named **`QueenMCP.exe`**. It is not a setup wizard. No Python installation or separate cloudflared download is needed.

- [Download the latest successful Windows build](https://github.com/kaxokaze/queen-mcp/actions)
- [GitHub Releases](https://github.com/kaxokaze/queen-mcp/releases)

In the latest successful workflow run, download the artifact named `Queen-MCP-Portable-Windows-x64`, extract the ZIP, and launch `QueenMCP.exe`.

## Access levels

### Restricted (default)

- File operations are limited to the selected folder.
- Only project-relative paths are accepted.
- Parent traversal, absolute paths, symbolic links and Windows junctions are rejected.
- Arbitrary shell/terminal execution is not registered.
- File read/write size is limited to 2 MB per operation.

### Unrestricted

- File tools can accept absolute paths and paths outside the selected folder.
- Adds `terminal_run`, which executes shell commands as the Windows account running Queen MCP.
- Commands are time-limited and their output is capped.
- This does **not** grant Administrator privileges. Do not launch Queen MCP as Administrator unless you intentionally want the child commands to inherit that elevation.

Unrestricted mode can modify or delete personal data and system files available to your Windows account. Use it only when you understand and trust the remote MCP client.

## Security model

The server listens on a random loopback-only port. It does not open a router port or bind to your LAN. Cloudflare Quick Tunnel creates a temporary public HTTPS hostname that forwards to the local listener.

Each start creates a new high-entropy bearer token. Every HTTP request to the MCP endpoint must include:

```http
Authorization: Bearer YOUR_SESSION_TOKEN
```

The token is a password: anyone who has it can use the active server with its selected permissions. Keep it private, stop the server when you finish, and never paste it into source control, screenshots or public chats.

The app uses Cloudflare **Quick Tunnel**, which is temporary and intended for development/testing. The URL changes between sessions. For a persistent deployment, configure a named Cloudflare Tunnel and add Cloudflare Access as an additional identity layer before exposing it.

## MCP tools

Always available:
- `project_info` — selected folder and access level.
- `project_list` — list files and directories.
- `project_read` — read UTF-8 text files.
- `project_write` — create or atomically replace UTF-8 text files.
- `project_mkdir` — create directories.
- `project_delete` — delete files or directories recursively.
- `project_move` — move or rename files/directories without overwriting an existing destination.
- `project_stat` — basic file metadata.
- `project_search` — literal text search with common dependency/build folders skipped.

Unrestricted mode only:
- `terminal_run` — execute a shell command as the current Windows user.

## Connect an MCP client

The application displays two values after startup:
- **MCP endpoint** — usually `https://<random-name>.trycloudflare.com/mcp`
- **Bearer token** — copy it using the button in the GUI.

Configure your MCP client for **Streamable HTTP**, using the endpoint URL and the bearer token as an HTTP Authorization bearer credential. Client setup screens and availability differ by product, plan and account settings. Queen MCP cannot enable custom MCP connections in a client that does not support them.

## Build from source (Windows)

Requirements: Python 3.11+ and PowerShell.

```powershell
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m pytest -q
python main.py
```

To build the same portable one-file executable as CI:

```powershell
.\scripts\build_windows.ps1
```

The build script downloads the pinned official Cloudflare `cloudflared-windows-amd64.exe` release and verifies its SHA-256 digest before packaging it inside `QueenMCP.exe`.

## Validation

GitHub Actions performs:
1. Unit tests for restricted/unrestricted filesystem behaviour.
2. Bearer authentication tests.
3. Real in-process MCP client tests (tool discovery, file write and file read).
4. A source self-test.
5. A PyInstaller one-file Windows build.
6. A self-test launched from the packaged `QueenMCP.exe`.

The executable is uploaded only after the test and packaged-app smoke-test steps pass.

## Limitations

- Quick Tunnel URLs are temporary.
- This project does not provide OAuth or user accounts; it uses a per-run bearer token.
- Tool annotations and client-side confirmation dialogs are not security boundaries. The server enforces its own access-mode checks.
- Restricted-mode path checks are designed to block normal traversal and reparse-point escapes, but they are not a substitute for running under a dedicated Windows account or OS sandbox.
- The project is an early test release. Review the security model before using it with sensitive folders.