Minecraft TCP/UDP to WebSocket bridge with Cloudflare tunnel support
Reason this release was yanked:
Backend API changed
Project description
MineConnect
Minecraft TCP/UDP to WebSocket bridge with Cloudflare tunnel support
A Python module for bridging Minecraft Java and Bedrock connections through WebSocket to Cloudflare tunnels, enabling secure remote access to your local Minecraft servers.
Features
- 🎮 Dual Support: Both Minecraft Java Edition and Bedrock Edition
- 🔒 Secure Tunnels: Uses Cloudflare tunnels for encrypted connections
- 🚀 Simple API: Just a few lines of code to get started
- ⚙️ Configurable: Customize ports and tunnel modes
- 📊 Real-time Logs: See connection status and activity
- 🔧 Easy Setup: One-time tunnel configuration
- 💻 Client Included: Connect from anywhere with CLI or GUI
Components
Server (Host your Minecraft server)
Run the server-side to bridge your local Minecraft servers to Cloudflare tunnels.
Client (Connect to servers)
Connect to MineConnect servers from anywhere:
- CLI Mode: Interactive command-line interface
- Daemon Mode: Run in background
- Python API: Integrate into your code
Installation
From Source (Development)
cd c:\Projects\MineConnect\server
pip install -e .
From PyPI (Future)
pip install mineconnect
One-Time Setup
Before using MineConnect, run the tunnel setup (requires cloudflared installed):
python -m mineconnect.tunnel_setup
This will:
- Authenticate with Cloudflare
- Create two tunnels (java and bedrock)
- Configure DNS routing
- Update configuration files
Usage
Simple API
from mineconnect import mcs
# Use default ports (25565 for Java, 19132 for Bedrock)
session = mcs.config()
session.start()
Custom Ports
from mineconnect import mcs
# Custom Minecraft server ports
session = mcs.config(tcp_port=25566, udp_port=19133)
session.start()
Single Tunnel Mode
from mineconnect import mcs
# Use one tunnel with two ingress rules instead of two separate tunnels
session = mcs.config(tcp_port=25565, udp_port=19132, single_tunnel=True)
session.start()
Full Example
from mineconnect import mcs
def main():
# Configure server with custom ports
session = mcs.config(
tcp_port=25565, # Minecraft Java Edition port
udp_port=19132, # Geyser/Bedrock port
single_tunnel=False # Use two separate tunnels
)
# Start server - blocks and shows logs until Ctrl+C
try:
session.start()
except KeyboardInterrupt:
print("Server stopped by user")
if __name__ == "__main__":
main()
Client Usage
Interactive CLI
mineconnect-client
Interactive commands: connect, disconnect, status, quit
Daemon Mode
# Connect both tunnels
mineconnect-client --both
# Connect Java only
mineconnect-client --java
# Custom domain
mineconnect-client --both --domain yourdomain.com
Python API (Client)
from mineconnect.client import MineConnectClient
# Create client
client = MineConnectClient(domain="ideadev.me")
# Connect to server
client.connect_both() # or connect_java() / connect_bedrock()
# ... play Minecraft on localhost:25565 or localhost:19132 ...
# Disconnect
client.disconnect()
See CLIENT_GUIDE.md for complete client documentation.
Parameters
Server API
mcs.config(tcp_port, udp_port, single_tunnel)
- tcp_port (int, default: 25565): Port where your Minecraft Java Edition server is running
- udp_port (int, default: 19132): Port where your Geyser/Bedrock server is running
- single_tunnel (bool, default: False): Use single tunnel with two ingress rules instead of two separate tunnels
session.start()
Starts all services:
- TCP WebSocket bridge (port 8764)
- UDP WebSocket bridge (port 8765)
- Cloudflared tunnel(s)
Logs are displayed in real-time. Press Ctrl+C to stop all services gracefully.
Prerequisites
- Python 3.8+
- cloudflared: Install from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/
- Minecraft Java Server: Running on specified tcp_port (default: localhost:25565)
- Geyser (for Bedrock support): Running on specified udp_port (default: localhost:19132)
Architecture
Minecraft Client → Cloudflare Tunnel → WebSocket Bridge → Local MC Server
- TCP Bridge: Handles Java Edition connections via persistent WebSocket
- UDP Bridge: Handles Bedrock Edition connections via WebSocket
- Cloudflared: Creates secure tunnels from Cloudflare edge to local bridges
Troubleshooting
"Cannot start TCP-WS-Bridge" or "Cannot start UDP-WS-Bridge"
Make sure the websockets package is installed:
pip install websockets
"Cannot reach MC" errors
Ensure your Minecraft server is running on the configured port before starting MineConnect.
Cloudflared not found
Install cloudflared and make sure it's in your PATH:
- Windows: Download from Cloudflare and add to PATH
- Linux:
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 - macOS:
brew install cloudflared
Development
To modify the package:
- Clone the repository
- Install in editable mode:
pip install -e server/ - Make changes to files in
server/mineconnect/ - Changes take effect immediately
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Priyadarshan Mahankuda (httperry)
- Website: ideadev.me
- GitHub: @httperry
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with Python and WebSockets
- Uses Cloudflare tunnels for secure connections
- Supports both Minecraft Java Edition and Bedrock Edition (via Geyser)
Support
For issues, questions, or contributions, please visit the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mineconnect-0.1.3.tar.gz.
File metadata
- Download URL: mineconnect-0.1.3.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aaceb8cf1db1ee9f7beb6ea4894c5e6dcfaafb34e72b1a8ef511944967c8017
|
|
| MD5 |
9f233c6647700bfec4b3b1362b4cb9d0
|
|
| BLAKE2b-256 |
8d211bdb6187f451ef372a6765da7faa16ce334f36d88f39c4300e683e663eee
|
File details
Details for the file mineconnect-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mineconnect-0.1.3-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2940850633c8390ce768f68726cea4beaf15117581d989e0991463715636f39
|
|
| MD5 |
ea24f2018c4c36b5a2d35e5f0b9f6de7
|
|
| BLAKE2b-256 |
db1ba9fe0000fdb6348766145803daf82eefac860f4200a6d979a36058c293ab
|