#!/usr/bin/env python3 """ Minecraft whitelist web app — lightweight self-service whitelisting. Sethian Dark theme. minecraft.sethpc.xyz """ import html import json import os import re import socket import struct import time from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.parse import parse_qs PORT = 8099 INVITE_KEY = os.environ.get("INVITE_KEY", "REDACTED_INVITE_KEY") SERVERS = [ {"name": "Paper AI", "host": "127.0.0.1", "rcon_port": 25577, "rcon_pass": "REDACTED_RCON", "show": True, "address": "sethpc.xyz:25567", "desc": "Full AI stack — pray to God, sudo commands, divine interventions"}, {"name": "Shrink World", "host": "127.0.0.1", "rcon_port": 25576, "rcon_pass": "REDACTED_RCON", "show": True, "address": "sethpc.xyz:25566", "desc": "Survival challenge — border shrinks on death, 5x creepers, pray for help"}, {"name": "Vanilla", "host": "127.0.0.1", "rcon_port": 25575, "rcon_pass": "REDACTED_RCON", "show": False, "address": None, "desc": None}, ] WHITELIST_LOG = "/var/log/mc_whitelist.log" LOGO_URL = "https://git.sethpc.xyz/Seth/Mortdecai/raw/branch/master/branding/mortdec_ai_rajdhani.png" def rcon_command(cmd, host, port, password): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(5) s.connect((host, port)) def send_packet(req_id, ptype, payload): data = struct.pack(" Mortdecai — Minecraft AI
logo mortdec.ai

Mortdecai

An AI runs on this server that listens to in-game chat and does things in the world based on what you say.

What Is This?

There's an AI character playing God on the server. It runs on local hardware — no cloud, no OpenAI — using a small open-source model we're actively training.

Every interaction you have gets logged as training data to improve the model. The more you play, the smarter it gets.

What Can You Do?

  • pray <message> — Talk to God. Pray for items, smite your enemies, or say something offensive and get punished.
  • sudo <request> — Natural language commands. "sudo give me a diamond sword" just works.
  • bug_log <description> — Report when something goes wrong. Helps us fix the AI.

What We Need

Try to break it. Ask for weird things. Confuse it. Phrase things in ways nobody would expect. Every interaction — good or bad — makes the model better.

{content}
""" FORM = """

Join the Server

{error}
""" def success_content(username, results): servers = "" for srv in SERVERS: if not srv["show"]: continue servers += f"""
{srv['name']}
{srv['address']}
{srv['desc']}
""" return f"""

Welcome, {html.escape(username)}!

You're whitelisted. Add these servers in Minecraft:

{servers}

Quick Start

pray lord give me tools — ask God for help

sudo give me a diamond sword — direct command translation

sudo set time to day — world commands work too

bug_log it gave me the wrong item — report issues

""" class Handler(BaseHTTPRequestHandler): def log_message(self, fmt, *args): pass def do_GET(self): content = FORM.format(error="") self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() self.wfile.write(PAGE.format(content=content, logo=LOGO_URL).encode()) def do_POST(self): length = int(self.headers.get("Content-Length", 0)) body = self.rfile.read(length).decode() params = parse_qs(body) username = params.get("username", [""])[0].strip() key = params.get("key", [""])[0].strip() if key != INVITE_KEY: content = FORM.format(error='

Invalid invite key.

') self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() self.wfile.write(PAGE.format(content=content, logo=LOGO_URL).encode()) return if not is_valid_username(username): content = FORM.format(error='

Invalid username. 3-16 characters, letters/numbers/underscore only.

') self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() self.wfile.write(PAGE.format(content=content, logo=LOGO_URL).encode()) return results = whitelist_player(username) try: with open(WHITELIST_LOG, "a") as f: f.write(json.dumps({"time": time.strftime("%Y-%m-%dT%H:%M:%SZ"), "username": username, "results": results}) + "\n") except: pass content = success_content(username, results) self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() self.wfile.write(PAGE.format(content=content, logo=LOGO_URL).encode()) if __name__ == "__main__": print(f"Whitelist app running on port {PORT}") print(f"Invite key: {INVITE_KEY}") HTTPServer(("0.0.0.0", PORT), Handler).serve_forever()