Command line & MCP
Your assistant.
Your other devices.
Send a result, link or file to your phone without leaving your terminal or AI conversation. GhostCopy uses the account and encryption settings in your running desktop app.
The CLI and MCP server are implemented. Windows packages starting with 1.0.22.0 and the Linux test installer include the companion executable. macOS currently requires building it from source. If your Store version is older, update when the new version becomes available.
1. Get the companion
On Windows, install or update GhostCopy from the Microsoft Store to package version 1.0.22.0 or later, then open a new terminal. Windows registers ghostcopy automatically. You do not need Dart or Flutter. If the command is missing, enable GhostCopy under Windows Settings → Apps → Advanced app settings → App execution aliases.
On Linux, the installer places ghostcopy in ~/.local/bin. Add that directory to your PATH, or use the full path. ghostcopy-desktop is the separate GUI launcher.
For macOS (or an older Windows build), install a Dart SDK satisfying the repository requirements (Flutter includes Dart), clone the GhostCopy repository, and run:
cd packages/ghostcopy_agent
dart pub get
dart compile exe bin/ghostcopy.dart -o ghostcopy
On Windows, use -o ghostcopy.exe instead. Move the executable to a permanent folder. Use its full path, or add that folder to PATH. It is a separate companion; do not replace the desktop app executable with it.
Open GhostCopy, sign in, and turn on Settings → Command line & AI tools. This is off by default. Keep GhostCopy running (the tray or menu bar is fine). No API key or separate CLI login is needed.
This setting allows local programs running as your user to send through your account. Turn it off to revoke access. Your AI client controls its own tool approvals.
2. Try it in a terminal
ghostcopy --help
ghostcopy devices
ghostcopy send "https://example.com" --to phone
ghostcopy send-file "/absolute/path/report.pdf" --to phone
ghostcopy devices --json
In PowerShell, use & "C:\Tools\ghostcopy.exe" devices when using a full path. send-file accepts files up to 10 MB. In a POSIX shell, ghostcopy send - < notes.txt sends a file's contents as text; in PowerShell use Get-Content -Raw notes.txt | ghostcopy send -.
--to accepts comma-separated groups: phone, desktop, ios, android, macos, windows, linux. These are platform groups, not individual device names. Omit it to use the app's Send to devices setting.
An assistant with local shell access can run these same commands. Ask it: “Use GhostCopy to send this summary to my phone.” A successful send means GhostCopy accepted the transfer; it does not confirm someone opened it.
3. Connect your AI with MCP
Use an AI client that supports local stdio MCP servers. Set the command to the companion's absolute path, and the argument to mcp. This runs on the same computer as GhostCopy. A client that only accepts a remote server URL cannot connect directly.
For Claude Desktop on Windows or macOS, open Settings → Developer → Edit Config. Merge this entry into the existing mcpServers object, preserving your other servers:
{
"mcpServers": {
"ghostcopy": {
"command": "/Users/yourname/bin/ghostcopy",
"args": ["mcp"]
}
}
}
Replace the example command with your real path. Windows Store JSON example: "command": "C:\\Users\\yourname\\AppData\\Local\\Microsoft\\WindowsApps\\ghostcopy.exe". Expand %LOCALAPPDATA% in your terminal to find your actual path. Linux clients can use "command": "/home/yourname/.local/bin/ghostcopy". Do not use ~ or an unexpanded environment variable in the command path.
Save and completely restart your AI client. In clients with an MCP settings form, use transport stdio, that same command, and one argument: mcp. JSON configuration formats differ by client; the example above is for clients using mcpServers.
First ask “List my GhostCopy devices.” Then try “Send this link to my phone with GhostCopy.” Review and approve the tool call in your client if prompted.
| Tool | What it does |
|---|---|
list_devices | Lists devices on your account. No arguments. |
send_text | Requires text; optional to array, e.g. ["phone"]. |
send_file | Requires an absolute local path; optional to array. Up to 10 MB. |
These tools send content and list devices. They do not expose a tool to read your clipboard history. File paths refer to the computer running the MCP server, not a remote assistant's filesystem.
Client setup reference: MCP's local server guide.
When it does not connect
- Command not found: use the executable's full path. Windows requires package 1.0.22.0 or later with its execution alias enabled. macOS still needs the separately built companion.
- Unreachable: start GhostCopy under the same OS user as your terminal or AI client. Run the server on the host desktop, not in a container or separate WSL environment.
- Refused: check your sign-in and enable Command line & AI tools. If encryption is enabled, unlock it in the app.
- MCP has no tools: check the absolute path and JSON escaping, then fully restart the client.
ghostcopy mcpwaiting silently in a terminal is normal: it expects protocol messages on standard input. - No answer after sending: check GhostCopy history before retrying; the send may already have succeeded.
For scripts, exit codes are 0 success, 1 usage error, 2 unreachable, 3 refused, 4 send failed, and 5 unconfirmed. Add --json for machine-readable replies.