100 GMCP resources for MUD players
GMCP (Generic MUD Communication Protocol) leverages Telnet option 201 to facilitate structured data exchange between MUD servers and clients using JSON payloads. This resource provides technical specifications and implementation patterns for developers to move beyond screen-scraping, enabling modern UI features like auto-mapping, health gauges, and dedicated communication windows.

Server-Side Protocol Implementation
- 1
Telnet Negotiation Handshake
beginnerhighSend IAC WILL GMCP (255 251 201) to the client during the initial login sequence. If the client responds with IAC DO GMCP (255 253 201), the out-of-band channel is established.
- 2
IAC SB GMCP Framing
intermediatestandardWrap all GMCP payloads in Subnegotiation markers. Format: IAC SB GMCP <Package.Message> <JSON data> IAC SE. Ensure no raw text or ANSI codes leak into this stream.
- 3
JSON Library Integration
intermediatehighUse a robust C/C++ library like cJSON or RapidJSON. Avoid manual string concatenation for JSON to prevent malformed payloads when player names contain quotes or special characters.
- 4
Core.Hello Processing
beginnerstandardParse the client's initial Core.Hello message to identify the client name and version (e.g., 'Mudlet 4.17'). Use this to toggle client-specific workarounds or features.
- 5
Core.Supports.Set Handler
intermediatestandardTrack the packages the client explicitly requests. Do not send Char.Vitals or Room.Info until the client confirms support via the Core.Supports.Set or Add messages.
- 6
Message Rate Limiting
advancedmediumImplement a throttle for high-frequency updates like Char.Vitals. Limit updates to 100ms intervals to prevent client lag during rapid combat rounds or heavy regeneration.
- 7
Null Byte Termination
intermediatemediumSome legacy clients require a null byte (\0) at the end of the JSON payload before the IAC SE. Test compatibility across Mudlet, Mushclient, and BeipMU.
- 8
Handling IAC DONT GMCP
beginnerstandardIf a player disables GMCP or switches to a non-compliant proxy, the server must receive IAC DONT GMCP and immediately stop all subnegotiation to prevent protocol desync.
- 9
Namespace Management
beginnerstandardUse standard package names (Core, Char, Room, Comm) for compatibility. Use a unique game-specific prefix (e.g., 'MyMUD.Quest') for custom game mechanics.
- 10
Asynchronous Event Triggers
advancedhighHook your GMCP broadcast functions into your game engine's event system (e.g., on_damage, on_move) rather than polling player state in the main loop.
Standard Package Specifications
- 1
Char.Vitals Structure
beginnerhighSend current and max values for hp, mana, and moves. Example: { "hp": 150, "maxhp": 200 }. Essential for client-side health bars.
- 2
Room.Info for Mapping
intermediatehighProvide 'num' (unique ID), 'name', 'zone', and 'exits' (a map of directions to room IDs). This allows Mudlet's mapper to build an accurate layout.
- 3
Comm.Channel Routing
beginnerstandardSend chat messages with 'chan' and 'msg' keys. This allows clients to capture 'gossip' or 'clan' chat into separate scrollable windows.
- 4
Char.Items.List
intermediatemediumSend a list of items in a specific location (inv, room, or container). Include 'id', 'name', and optional 'icon' for graphical inventory systems.
- 5
Char.Status Updates
beginnerstandardTransmit character-level metadata like level, race, class, and current gold. Update this only on state change to save bandwidth.
- 6
Room.Players and Room.NPCs
intermediatemediumSend arrays of entities present in the current room. Useful for creating clickable 'target' lists in the client UI.
- 7
Char.Skills.Groups
advancedstandardList skill categories available to the player. Used to populate client-side spellbooks or talent trees without querying the server manually.
- 8
Core.Ping Latency Tracking
beginnermediumRespond to a client Core.Ping with a server-side timestamp. Helps players diagnose network issues versus server processing lag.
- 9
Char.Afflictions and Defences
advancedhighSend active debuffs (poison, blind) and buffs (shield, haste). Essential for high-level automated combat scripting in modern clients.
- 10
Room.WrongDir Feedback
intermediatestandardNotify the client when a movement fails (e.g., 'The door is locked'). Prevents the client-side mapper from desyncing when a move command is sent.
Client Integration and Debugging
- 1
Mudlet event handlers
beginnerhighRegister functions using registerAnonymousEventHandler('gmcp.Char.Vitals', 'myCallback'). This is more efficient than checking the gmcp table in a loop.
- 2
Visualizing Payloads with display()
beginnerstandardUse the Mudlet command 'lua display(gmcp)' to see the current state of all received data packages in the debug console.
- 3
Geyser Gauge Binding
intermediatehighDirectly link GMCP vital values to Geyser.Gauge objects. Update the gauge's value inside the gmcp.Char.Vitals event handler.
- 4
Handling JSON Escaping Errors
intermediatestandardIf the client debug console shows 'JSON error', check for unescaped newlines or backslashes in the server-side string serialization.
- 5
Client-Side Capability Requests
beginnerstandardUse sendGMCP('Core.Supports.Add ["Comm.Channel 1"]') to tell the server your script is ready to process specific data streams.
- 6
MUSHclient Plugin Integration
advancedmediumUse the OnPluginTelnetSubnegotiation callback to capture option 201. Use a Lua JSON module to decode the buffer into a table.
- 7
Automated Map Syncing
intermediatehighTrigger centerview(gmcp.Room.Info.num) whenever the Room.Info package arrives to keep the visual map locked to the player's position.
- 8
Custom UI Widget Toggles
intermediatemediumShow or hide UI elements based on GMCP data (e.g., hide the 'Mount' gauge if gmcp.Char.Status.mounted is false).
- 9
GMCP to Discord Webhooks
advancedmediumUse client-side scripts to bridge GMCP Comm.Channel data to Discord webhooks for out-of-game monitoring of guild chats.
- 10
Debugging with Wireshark
advancedstandardUse Wireshark with the Telnet filter to inspect the raw hex bytes of GMCP subnegotiations if the client is failing to parse the JSON.