Skip to content

Implement GMCP Core (Telnet Option 201) #161

@mystiker

Description

@mystiker

Summary

Implement the GMCP Core protocol layer (Telnet option 201) in the client.
Scope is strictly limited to Core functionality, no MUD-specific modules and no UI integration.


Background

GMCP (Generic MUD Communication Protocol) is a de-facto standard used by many MUDs to exchange structured (JSON) data over Telnet.

This issue implements:

  • GMCP transport & parsing
  • Core namespace handling
  • Capability negotiation

Non-Core modules (Char, Room, Comm, etc.) are explicitly out of scope.

Reference:


Scope

✅ In scope

1. Telnet / Transport

  • Support TELOPT_GMCP (201)
  • Handle WILL / DO negotiation
  • Receive and send GMCP sub-negotiation payloads as UTF-8 text

2. GMCP Message Parsing

  • Parse messages in the form:
    <Package>.<Command> [JSON payload]
    
  • Package and command are case-insensitive
  • JSON payload is optional
  • Unknown or malformed payloads must not crash the client

3. Core Namespace Support

Implement handling for the following Core messages:

Core.Hello
  • Accept both directions (Client ↔ Server)
  • Payload is a JSON object
  • No strict schema validation (store raw object)
Core.Supports
  • Client → Server
  • Support:
    • Core.Supports.Set
    • Core.Supports.Add
    • Core.Supports.Remove
  • Payload: JSON array of strings (e.g. "Char 1")
  • No assumptions about server responses
Core.Ping
  • Bidirectional
  • Respond with Core.Ping when received (no payload)
Core.Goodbye
  • Server → Client
  • Graceful connection shutdown handling

4. Dispatch & Logging

  • Central GMCP dispatcher
  • Unknown packages / commands must be logged (debug level)
  • Core handlers must be clearly separated from non-Core logic

❌ Out of scope

  • Non-Core GMCP modules (Char, Room, Comm, etc.)
  • UI bindings
  • MUD-specific profiles
  • Hard-coded payload schemas
  • Files, sound, editor, browser info, or custom extensions

Acceptance Criteria

  • GMCP negotiation works with a GMCP-capable MUD
  • Core messages are parsed and dispatched correctly
  • Client does not crash on unknown GMCP messages
  • Core implementation is isolated and reusable
  • Logging allows inspection of all incoming GMCP traffic

Notes / Design Constraints

  • GMCP is loosely specified by design
  • Avoid strict schema enforcement
  • Prefer tolerant parsing and forward compatibility
  • This implementation is intended as a foundation for later extensions

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendThis issue is specific to the backendfrontendThis issue is specific to the frontendqualifyIssues that need to be discussed further

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions