SpyWebSocket is a lightweight Paper plugin that exposes a secure WebSocket API for remotely interacting with a Minecraft server.
It allows external programs (such as Python scripts, bots, or automation tools) to authenticate, execute console commands, and retrieve live player data in real time using structured JSON messages.
⚠️ Warning:
This plugin allows remote console command execution.
Only use it on trusted servers and networks.
- 🔐 Authentication required before any action
- 📡 Built-in WebSocket server (no external services needed)
- 🧵 Thread-safe command execution on the main server thread
- 📍 Live player coordinate retrieval
- ⚙️ Configurable host, port, username, and password
- 🧩 Simple JSON-based protocol
- 📦 Shaded JAR (no runtime dependencies required)
- Platform: Paper
- Tested versions: 1.21+
- Java version: 21
- Also works on: Spigot (untested)
- Download the plugin JAR
- Place it into your server’s
plugins/folder - Start the server once to generate the config
- Edit
plugins/SpyWebSocket/config.yml - Restart the server
websocket:
host: 127.0.0.1
port: 8765
username: admin
password: strongpasswordConfiguration Notes: Use 127.0.0.1 to restrict access to the local machine (recommended)
Do not expose the port publicly unless properly secured
Use a strong password
Clients must authenticate before using any other action.
{
"type": "auth",
"username": "admin",
"password": "strongpassword"
}{
"type": "auth_ok"
}{
"type": "auth_fail"
}Executes a command as the server console.
Request json Copy code { "type": "command", "command": "say Hello from WebSocket" } Commands are executed safely on the Minecraft main thread.
Returns position and world data for all online players.
{
"type": "get_players"
}{
"type": "players",
"players": {
"Steve": {
"x": 120.5,
"y": 64.0,
"z": -32.1,
"world": "world"
}
}
}If a request is invalid or unauthorized:
{
"type": "error",
"reason": "not_authenticated"
}invalid_json
missing_type
unknown_type
not_authenticated
Python-controlled Minecraft automation
Admin dashboards or control panels
Server monitoring tools
Twitch / chat integrations
External overlays or bots
This plugin is intended for trusted environments
Keep the WebSocket bound to 127.0.0.1
Use firewalls when necessary
Do not expose this plugin to the public internet
- Adding Hot reload
- self backend handling without python as backend
Pull requests, issues, and feature ideas are welcome.
The author is not responsible for misuse of this plugin. Use responsibly.