Tutorial Part 1: Installation & First Run¶
Estimated time: 15 minutes
Welcome to the MAID tutorial series! This first part will guide you through installing MAID and running your first server. By the end of this tutorial, you will have a working MAID server and understand the basics of connecting and interacting with it.
What is MAID?¶
MAID (Multi AI Dungeon) is a modern MUD (Multi-User Dungeon) engine written in Python 3.12+. MUDs are text-based multiplayer games that have been around since the late 1970s, and MAID brings this classic genre into the modern era with:
- AI Integration - Built-in support for AI-powered NPCs using providers like Anthropic (Claude), OpenAI, and Ollama
- Modern Architecture - Async/await throughout, Entity Component System (ECS), and event-driven design
- Content Pack System - Modular, pluggable architecture for game content
- Multiple Connection Options - Telnet for classic MUD clients and WebSocket for modern web interfaces
What You Will Learn¶
In this tutorial, you will:
- Install MAID and its dependencies
- Start your first MAID server
- Connect to the server via Telnet and Web
- Create a character and explore basic commands
- Understand the project directory structure
Prerequisites¶
Before starting, ensure you have:
- Python 3.12 or higher - MAID uses modern Python features
- Basic Python knowledge - Familiarity with running Python scripts and using pip/package managers
- A terminal/command line - You will be running commands throughout this tutorial
- A text editor or IDE - For viewing and editing files (VS Code, PyCharm, or similar recommended)
You can verify your Python version by running:
If you see Python 3.12.x or higher, you are ready to proceed.
Installation¶
MAID uses uv, a fast Python package manager, for dependency management. This is the recommended installation method for all platforms.
All Platforms (using uv - Recommended)¶
Step 1: Install uv¶
After installation, restart your terminal or run:
After installation, restart your terminal.
Verify the installation:
Step 2: Clone the Repository¶
Step 3: Install Dependencies¶
This command will:
- Create a virtual environment automatically
- Install all required dependencies
- Install MAID in editable mode
Installation Complete
You should see output indicating packages are being installed. When complete, you are ready to start the server.
Platform-Specific Notes¶
Requirements:
- macOS 11 (Big Sur) or later is recommended
- Xcode Command Line Tools may be required for some dependencies:
Apple Silicon (M1/M2/M3):
uv and MAID work natively on Apple Silicon. No special configuration needed.
Ubuntu/Debian:
You may need to install development headers for some dependencies:
Fedora:
Arch Linux:
WSL2 (Recommended):
For the best experience on Windows, we recommend using Windows Subsystem for Linux 2 (WSL2):
- Enable WSL2 following Microsoft's guide
- Install Ubuntu from the Microsoft Store
- Open Ubuntu and follow the Linux installation instructions above
Native Windows:
MAID can run natively on Windows, but some features may have limited support:
- Ensure Python is added to your PATH during installation
- Use PowerShell or Windows Terminal for best results
- Some telnet clients may require additional configuration
Install Python from python.org and ensure you check "Add Python to PATH" during installation.
Installing with AI Provider Support¶
MAID supports multiple AI providers for NPC dialogue and content generation. Install the ones you need:
# OpenAI (GPT) support
uv sync --extra openai
# Ollama (local AI) support
uv sync --extra ollama
# All AI providers
uv sync --all-extras
AI is Optional
MAID works perfectly without AI features. You can always add AI provider support later.
Starting the Server¶
Now that MAID is installed, let us start the server.
Basic Server Start¶
You should see output similar to:
Starting MAID Server...
Telnet: 0.0.0.0:4000
Web: 0.0.0.0:8080
Discovered: maid-stdlib
Discovered: maid-classic-rpg
Loaded: maid-stdlib
Loaded: maid-classic-rpg
Server started. Press Ctrl+C to stop.
Understanding the Output¶
Let us break down what this output tells us:
| Line | Meaning |
|---|---|
Telnet: 0.0.0.0:4000 |
The Telnet server is listening on port 4000 on all network interfaces |
Web: 0.0.0.0:8080 |
The WebSocket server is listening on port 8080 on all network interfaces |
Discovered: maid-stdlib |
The standard library content pack was found |
Discovered: maid-classic-rpg |
The classic RPG content pack was found |
Loaded: maid-stdlib |
The standard library content pack was loaded successfully |
Loaded: maid-classic-rpg |
The classic RPG content pack was loaded successfully |
Default Ports¶
MAID uses two default ports:
- Port 4000 - Telnet server for traditional MUD clients
- Port 8080 - WebSocket server for web clients and the admin interface
Firewall Configuration
If you want to allow external connections (from other computers), ensure ports 4000 and 8080 are open in your firewall.
Server Options¶
You can customize the server with command-line options:
# Start with custom ports
uv run maid server start --telnet-port 5000 --web-port 9000
# Bind to localhost only (no external access)
uv run maid server start --host 127.0.0.1
# Enable debug mode for verbose logging
uv run maid server start --debug
Connecting to the Server¶
With the server running, let us connect to it. You have two options: Telnet (traditional) and Web (modern).
Connecting via Telnet¶
Telnet is the traditional way to connect to MUD servers. It provides a simple text interface.
Using the Built-in Telnet Client¶
Using a MUD Client¶
For a better experience, consider using a dedicated MUD client:
- Mudlet - Cross-platform, feature-rich, with scripting support
- TinTin++ - Powerful command-line client for Linux/macOS
- Blightmud - Modern terminal-based client
- MUSHclient - Windows-only with extensive plugin support
MUD Client Configuration:
| Setting | Value |
|---|---|
| Host | localhost (or your server IP) |
| Port | 4000 |
| Protocol | Telnet |
Connecting via Web¶
MAID provides a WebSocket interface for modern web clients. Open your web browser and navigate to:
The web interface provides:
- A text input area for commands
- An output area for server responses
- Connection status indicator
- Basic styling for readability
Admin Interface
If you have built the admin frontend, you can access the admin interface at http://localhost:8080/admin-ui/. See the Admin UI documentation for details.
Character Creation and Login¶
When you first connect, you will be greeted with a welcome message and prompted to either log in or create a new character.
Creating a New Character¶
-
Enter your character name when prompted:
-
Create a password (you will not see the characters as you type):
-
Enter the game - You will be placed in the starting location:
Logging In with an Existing Character¶
If you already have a character:
Basic Commands to Try¶
Now that you are in the game, try these basic commands:
| Command | Description | Example |
|---|---|---|
look |
See your surroundings | look |
help |
List available commands | help |
help <command> |
Get help on a specific command | help look |
who |
See who is online | who |
say <message> |
Say something to the room | say Hello, world! |
north, south, east, west |
Move between rooms | north |
inventory |
Check your inventory | inventory |
quit |
Disconnect from the server | quit |
Try It Out
After logging in, try typing look to see a description of your current location, then try help to see all available commands.
Project Directory Structure¶
Understanding the project structure will help you navigate MAID as you progress through the tutorials.
MAID/
├── packages/ # The three main packages
│ ├── maid-engine/ # Core infrastructure
│ │ └── src/maid_engine/
│ │ ├── core/ # Engine, World, ECS, Events
│ │ ├── commands/ # Command registry
│ │ ├── config/ # Settings framework
│ │ ├── plugins/ # Content pack system
│ │ ├── net/ # Networking (Telnet, WebSocket)
│ │ └── storage/ # Persistence
│ │
│ ├── maid-stdlib/ # Standard library
│ │ └── src/maid_stdlib/
│ │ ├── components/ # Health, Inventory, Position
│ │ ├── events/ # Movement, combat events
│ │ ├── commands/ # look, move, get, drop
│ │ └── utils/ # Dice, text formatting
│ │
│ └── maid-classic-rpg/ # Classic MUD content pack
│ └── src/maid_classic_rpg/
│ ├── systems/ # Combat, magic, quests
│ ├── commands/ # Game-specific commands
│ └── data/ # NPCs, items, areas
│
├── docs/ # Documentation
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lock file
└── CLAUDE.md # Development instructions
Package Architecture¶
MAID is organized as a monorepo with three packages that build on each other:
┌────────────────────────────────────────┐
│ maid-classic-rpg │ <- Game content (what players see)
├────────────────────────────────────────┤
│ maid-stdlib │ <- Common components & utilities
├────────────────────────────────────────┤
│ maid-engine │ <- Pure infrastructure
└────────────────────────────────────────┘
| Package | Purpose | You Would Modify This For |
|---|---|---|
maid-engine |
Core infrastructure - networking, ECS, events | Building new engine features |
maid-stdlib |
Reusable components and utilities | Adding common game mechanics |
maid-classic-rpg |
Classic MUD gameplay | Creating game content |
Exercises¶
Practice what you have learned with these exercises.
Exercise 1: Start the Server with Debug Mode¶
Start the server with debug mode enabled to see verbose logging:
What to look for:
- Additional log messages showing system initialization
- Event emissions and handler registrations
- Detailed connection information when clients connect
Press Ctrl+C to stop the server when done.
Exercise 2: Connect via Both Telnet and Web¶
- Start the server normally:
uv run maid server start - Open a terminal and connect via Telnet:
telnet localhost 4000 - Open a browser and navigate to:
http://localhost:8080 - Create characters with different names in each
- Use the
whocommand to see both characters online
What to observe:
- Both connections work simultaneously
- Commands entered in one connection do not appear in the other
- The
whocommand shows all connected players
Exercise 3: Explore Basic Commands¶
After connecting, try these commands and note what they do:
look- Describe your current roomhelp- List all available commandshelp look- Get detailed help on thelookcommandnorth(or another direction) - Move to an adjacent roomlookagain - See the new room descriptioninventory(ori) - Check what you are carryingsay Hello everyone!- Say something out loudquit- Disconnect gracefully
Challenge: Find the starting NPC and try talking to them using the talk command.
Troubleshooting¶
Connection Refused¶
If you see "Connection refused" when trying to connect:
- Verify the server is running - Check the terminal where you started the server
- Check the port - Ensure you are connecting to port 4000 (Telnet) or 8080 (Web)
- Try localhost explicitly:
Port Already in Use¶
If you see "Address already in use":
# Check what is using the port
lsof -i :4000
# Use different ports
uv run maid server start --telnet-port 5000 --web-port 9000
Python Version Issues¶
If you see errors about Python version:
# Check your Python version
python --version
# Use a specific Python version with uv
uv python install 3.12
uv sync
What's Next?¶
Congratulations! You have successfully installed MAID, started a server, and connected as a player. In the next part of this tutorial, we will dive deep into MAID's architecture to understand how all the pieces fit together.
Coming up in Part 2: Architecture Deep Dive
- Understanding the Entity Component System (ECS)
- How the event bus enables decoupled systems
- The tick-based game loop
- Content packs and how they work together
< Back to Tutorial Index Next: Part 2 - Architecture >
Quick Reference¶
Useful Commands¶
| Command | Description |
|---|---|
uv run maid server start |
Start the server with defaults |
uv run maid server start --debug |
Start with debug logging |
uv run maid --help |
Show all CLI commands |
telnet localhost 4000 |
Connect via Telnet |
Default Ports¶
| Service | Port |
|---|---|
| Telnet | 4000 |
| WebSocket | 8080 |
In-Game Commands¶
| Command | Alias | Description |
|---|---|---|
look |
l |
Look around |
help |
? |
Get help |
inventory |
i |
Check inventory |
quit |
- | Disconnect |