Skip to main content

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

Python Version License

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:

  • GUI Mode: Web interface with buttons
  • 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):

mineconnect-setup

Or:

python -m mineconnect.tunnel_setup

This will:

  1. Authenticate with Cloudflare
  2. Create two tunnels (java and bedrock)
  3. Configure DNS routing
  4. 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

GUI Mode (Easiest)

mineconnect-gui

Opens a web interface at http://localhost:8080

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

  1. Python 3.8+
  2. cloudflared: Install from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/
  3. Minecraft Java Server: Running on specified tcp_port (default: localhost:25565)
  4. 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:

  1. Clone the repository
  2. Install in editable mode: pip install -e server/
  3. Make changes to files in server/mineconnect/
  4. Changes take effect immediately

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Priyadarshan Mahankuda (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mineconnect-0.1.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mineconnect-0.1.1-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file mineconnect-0.1.1.tar.gz.

File metadata

  • Download URL: mineconnect-0.1.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mineconnect-0.1.1.tar.gz
Algorithm Hash digest
SHA256 91634e6f4f233d4dac7ff3f59325d108f44e3041c6c8b5b5dea42225830b93a5
MD5 a58b90efcad9a0fdcc536ad3b298bb93
BLAKE2b-256 29fa7f32d76a4f8dd26d9f8084a49d31cb3ede5939b373f0b04c4c3dde4bd498

See more details on using hashes here.

File details

Details for the file mineconnect-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mineconnect-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mineconnect-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43284970382cb6e4d88b239666a19d7a4c3d56110c24660b4cbab638802609cb
MD5 07ff8701370fd74b37dd5f942232c362
BLAKE2b-256 e8b1fb08159d70b001f09535411431f4a1a37091e9d4e9f7aa1d7cc269baccb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page