Skip to content

streamdeck_connect always grabs the first enumerated device — no way to target a specific deck when multiple are attached #44

@bandrel

Description

@bandrel

Problem

server.py:292 hardcodes self.deck = decks[0], so when more than one Stream Deck is connected (e.g. an Original and a Plus on the same machine), the MCP can only ever talk to whichever device DeviceManager().enumerate() returns first. There is no tool argument to choose, and no list_devices tool to discover what's attached.

Repro on a machine with two decks plugged in:

streamdeck_connect  →  always opens the same one regardless of intent

Suggested fix

Two small additions:

  1. New tool streamdeck_list_devices — enumerate without opening, return [{serial, deck_type, key_count}, ...]. No connection required, safe to call any time.
  2. Optional arg on streamdeck_connectserial: str | None = None. If provided, match against enumerated devices; if not, keep current behavior (open first). On a non-matching serial, error with the list of available serials so the caller can self-correct.

Sketch:

def connect(self, serial: str | None = None) -> dict[str, Any]:
    ...
    decks = DeviceManager().enumerate()
    if not decks:
        raise StreamDeckError("No Stream Deck found...")

    if serial is None:
        self.deck = decks[0]
    else:
        match = next((d for d in decks if d.get_serial_number() == serial), None)
        if match is None:
            available = [d.get_serial_number() for d in decks]
            raise StreamDeckError(f"No deck with serial {serial!r}. Available: {available}")
        self.deck = match
    ...

Out of scope (worth noting, not solving here)

State persistence (~/.streamdeck-mcp/pages.json, buttons.json) is currently global. True multi-deck support eventually wants per-serial state files, but that's a larger change — selecting which deck to open is the prerequisite and useful on its own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions