Tiny local server for using a mobile browser as a text entry surface and pasting the submitted text into the currently active Windows app.
Run these from this project folder in PowerShell or Command Prompt:
py -3 -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
python app.pyThe server defaults to port 7777 and prints a tokenized phone URL like:
http://192.168.0.24:7777/?token=...
Open that URL on the Pixel 7 while the phone and PC are on the same Wi-Fi. The startup terminal also prints a scannable QR code for the same URL.
Double-clickable launcher files are included:
allow-mobypaste-firewall.batallows TCP port7777through Windows Firewall for private networks.start-mobypaste.batstarts the server from this project folder.stop-mobypaste.batkills matching Python server instances and Python listeners on port7777.moby-on.batrunsmp on.moby-off.batrunsmp off.
The batch files resolve the project folder from their own location. For Desktop access, create shortcuts to these repo files instead of copying them. If you really need to launch copied scripts from somewhere else, set MOBILE_PASTE_BRIDGE_PROJECT_DIR to the repo folder.
mp.bat wraps the launchers:
mp on
mp offFrom this project folder, run it as .\mp on or .\mp off in PowerShell. To use mp on and mp off from any folder, add this project folder to your Windows user PATH, then open a new terminal.
If CMD cannot find mp, run it once from the project folder as .\mp on, or double-click moby-on.bat.
- Start the server.
- Open the printed phone URL on Android.
- Click the target text field or app on Windows.
- Type or dictate into the phone textarea with your mobile device.
- Tap
Paste to PCorPaste + Enter.
The paste goes wherever Windows focus currently is. If the wrong app is focused, the text will paste there.
app.pyruns the server and Windows paste automation.index.htmlcontains the mobile page markup and client-side JavaScript.mp.batprovides themp on/mp offterminal command.mp.cmdmirrorsmp.batfor Windows command resolution.styles.csscontains the mobile page styling.
Optional .env values:
MOBILE_PASTE_BRIDGE_PORT=7777
MOBILE_PASTE_BRIDGE_TOKEN=change-this-token
MOBILE_PASTE_BRIDGE_CLIPBOARD_DELAY=0.15
MOBILE_PASTE_BRIDGE_ENTER_DELAY=0.15
MOBILE_PASTE_BRIDGE_MAX_CHARS=50000
MOBILE_PASTE_BRIDGE_QR_BORDER=2
MOBILE_PASTE_BRIDGE_PUBLIC_HOST=
If no token is configured, a new one is generated and printed on startup.
If MOBILE_PASTE_BRIDGE_PUBLIC_HOST is empty, the app auto-detects the LAN IP. Set it only when you want to force the printed phone URL/QR to use a specific hostname or IP.
If mp is not recognized, open a new CMD/PowerShell window so Windows reloads your PATH. From the project folder you can always run:
.\mp on
.\mp offIf the QR opens on the phone but paste does not happen, check the server terminal or .runtime.log. A healthy phone page load logs Phone connected from ..., and a healthy paste logs Pasted ... characters from ....
If there is no Phone connected line, the request is not reaching the PC. On a new Wi-Fi network:
- Restart MobyPaste and scan the fresh QR, because the PC LAN IP may have changed.
- Run
allow-mobypaste-firewall.batas administrator to allow inbound TCP port7777on private networks. - Make sure the phone is on the same normal Wi-Fi network as the PC, not a guest network or client-isolated network.
If Phone connected appears but paste still does not land, click the target Windows app first. A non-admin MobyPaste process may also fail to paste into an app running as administrator.
- Do not expose this server to the public internet.
- Windows Firewall may ask for permission the first time.
- Run with Windows Python, not WSL Python. WSL cannot reliably automate normal Windows desktop apps.
- A non-admin server may not paste into an app running as administrator.
- The Windows clipboard is overwritten by design.
MIT. See LICENSE.
