Skip to main content
Glama

connect

Open a serial port or network console and start a background reader so you can send commands to and read responses from devices over serial, Telnet, SSH, TCP, or RFC2217.

Instructions

Open a serial port, or a console over the network, and start its background reader.

Defaults are 9600 baud, 8 data bits, no parity, 1 stop bit, no flow control ("9600 8N1"), CR line ending, which is what most console/craft ports expect. Give preset (see list_presets) to load a device family's usual settings, and override any field explicitly, e.g. "38400 with XON/XOFF" -> baud=38400, xonxoff=True. Several ports can be open at once; each gets a name and later tools default to the most recently used one. Nothing is specific to telecom gear: any device on a serial port works, including IoT gateways, alarm and control panels, UPS and PDU menus and lab instruments; choose terminal by what the device prints.

Network consoles work the same way once open (every read, expect, capture and screen tool). transport="telnet" or "ssh" talks to the device itself (a Juniper or Cisco management address, a Linux box: the same CLI as its console port, minus boot loader and ROMMON) or to a console server port in front of a serial console; "rfc2217" when the server also lets us set baud, DTR/RTS and BREAK; "tcp" for raw TCP (ser2net). Or pass a URL as port: "ssh://admin@mx1", "telnet://192.0.2.1", "telnet://cs1:2003", "tcp://10.0.0.5:4001", "rfc2217://ser2net:3001". Passwords are NEVER passed or typed here: SSH uses the user's agent, keys and ~/.ssh/config (host aliases work; the host key must already be in known_hosts); a password login uses credential, the name of a password the user stored themselves (serial-console-mcp credential set NAME, or the SERIAL_CONSOLE_PASSWORD_ environment variable). For a one-off user name/password login, pass ask=True: the user types the password into a dialog on their own screen.

Args: port: System port name, e.g. "COM4" (Windows), "/dev/cu.usbserial-10" (macOS), or "/dev/ttyUSB0" (Linux). Get exact names from list_serial_ports. Or a network URL (see above). preset: Device preset name such as "cisco-console", "juniper-craft", "kenwood-cat", "icom-civ", "yaesu-rotator", "arduino", "nmea-gps". name: Nickname for this connection ("rig", "rotator"). Defaults to the port's short name. Use it in other tools' connection argument. baud: Baud rate. Common values: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. Unknown? Use detect_baud first. bytesize: Data bits: 5, 6, 7, or 8. Almost always 8. parity: "N" none, "E" even, "O" odd. Almost always "N". stopbits: 1, 1.5, or 2. Almost always 1. rtscts: Hardware (RTS/CTS) flow control. Off unless the manual says so and the cable carries those lines. xonxoff: Software (XON/XOFF) flow control. Off by default. Never for binary protocols (it swallows 0x11 / 0x13 bytes). line_ending: Default line ending for send_text/query_text on this connection: "CR" (most rigs, consoles), "LF" (Unix, Arduino), "CRLF", or "NONE" (Kenwood-style CAT ending in ';'). prompt: Default prompt for read_until_prompt/query_text on this connection, e.g. "# ", "> ", ";" (CAT replies). Say what the device shows, with its trailing space. prompt_regex: Treat prompt as a regular expression. terminal: How to interpret what the device sends. "dumb" (default): raw bytes, right for CAT, CI-V, rotators and most CLIs. "ansi": strip color/escape sequences and apply CR/backspace overwrites so shells and colored prompts read cleanly (the console presets use it); prompts are also matched on the last line as displayed, so a line redrawn with spaces and backspaces (Junos after ? or Ctrl-U) still ends in its prompt. "vt100"/"xterm": additionally keep a real screen for full-screen menus, BIOS/BMC consoles, vi/top; read it with the screen tool, navigate with send_keys. cols: Screen width for vt100/xterm (default 80). rows: Screen height for vt100/xterm (default 24). transport: "serial" (default), "telnet", "ssh", "tcp" or "rfc2217". Baud, parity and flow control apply to serial and rfc2217 only; over telnet, tcp and ssh there is no baud rate to set (through a console server, its port settings decide). host: Host name, address or ~/.ssh/config alias for a network transport. "host:port" is accepted. tcp_port: TCP port. telnet defaults to 23 and ssh to ~/.ssh/config or 22. A console server maps each serial line to its own port (often 2000-4000+); tcp and rfc2217 always need it. username: Login name for ssh (else ~/.ssh/config User, else the local user) or for a telnet login. Not a secret. credential: NAME of a stored password, never the password itself. For ssh it is offered for password/keyboard-interactive login; for telnet/tcp/serial it answers the "login:" and "Password:" prompts that appear right after connecting (the device's own over telnet, or a console server's). For a login that comes later, use expect with send_credential. ask: Ask the user, in a dialog on this computer and never in the chat, for what is missing: the password (and user name) when the device asks for one, and whether to trust an SSH host key seen for the first time (its fingerprint is shown; a changed key is always refused). Use it when the user wants to type a password for an ad-hoc connection. With credential, a stored password is used first and the dialog only if none is stored.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "connect"
  }
}

Input Schema

NameRequiredDescriptionDefault
askNo
baudNo
colsNo
hostNo
nameNo
portNo
rowsNo
parityNo
presetNo
promptNo
rtsctsNo
xonxoffNo
bytesizeNo
stopbitsNo
tcp_portNo
terminalNo
usernameNo
transportNoserial
credentialNo
line_endingNo
prompt_regexNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.4.1
    • addedInput schema / properties / ask
      Added value: +{
      +  "default": false,
      +  "title": "Ask",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / credential
      Added value: +{
      +  "default": "",
      +  "title": "Credential",
      +  "type": "string"
      +}
    • addedInput schema / properties / host
      Added value: +{
      +  "default": "",
      +  "title": "Host",
      +  "type": "string"
      +}
    • addedInput schema / properties / port / default
      Added value: +""
    • addedInput schema / properties / tcp_port
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tcp Port"
      +}
    • addedInput schema / properties / transport
      Added value: +{
      +  "default": "serial",
      +  "enum": [
      +    "serial",
      +    "telnet",
      +    "ssh",
      +    "tcp",
      +    "rfc2217"
      +  ],
      +  "title": "Transport",
      +  "type": "string"
      +}
    • addedInput schema / properties / username
      Added value: +{
      +  "default": "",
      +  "title": "Username",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "port"
      -]
  2. Changed28 schema fields changedv0.3.2
    • addedInput schema / properties / baud / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / baud / default
      Previous value: -9600New value: +null
    • removedInput schema / properties / baud / type
      Removed value: -"integer"
    • addedInput schema / properties / bytesize / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / bytesize / default
      Previous value: -8New value: +null
    • removedInput schema / properties / bytesize / type
      Removed value: -"integer"
    • addedInput schema / properties / cols
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Cols"
      +}
    • addedInput schema / properties / line_ending
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "CR",
      +        "CRLF",
      +        "LF",
      +        "NONE"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Line Ending"
      +}
    • addedInput schema / properties / name
      Added value: +{
      +  "default": "",
      +  "title": "Name",
      +  "type": "string"
      +}
    • addedInput schema / properties / parity / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "N",
      +      "E",
      +      "O"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / parity / default
      Previous value: -"N"New value: +null
    • removedInput schema / properties / parity / enum
      Removed value: -[
      -  "N",
      -  "E",
      -  "O"
      -]
    • removedInput schema / properties / parity / type
      Removed value: -"string"
    • addedInput schema / properties / preset
      Added value: +{
      +  "default": "",
      +  "title": "Preset",
      +  "type": "string"
      +}
    • addedInput schema / properties / prompt
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Prompt"
      +}
    • addedInput schema / properties / prompt_regex
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Prompt Regex"
      +}
    • addedInput schema / properties / rows
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Rows"
      +}
    • addedInput schema / properties / rtscts / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / rtscts / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / rtscts / type
      Removed value: -"boolean"
    • addedInput schema / properties / stopbits / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / stopbits / default
      Previous value: -1New value: +null
    • removedInput schema / properties / stopbits / type
      Removed value: -"number"
    • addedInput schema / properties / terminal
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "dumb",
      +        "ansi",
      +        "vt100",
      +        "xterm"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Terminal"
      +}
    • removedInput schema / properties / timeout
      Removed value: -{
      -  "default": 1,
      -  "title": "Timeout",
      -  "type": "number"
      -}
    • addedInput schema / properties / xonxoff / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / xonxoff / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / xonxoff / type
      Removed value: -"boolean"
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: it discloses that a background reader is started, that several connections may coexist, that later tools default to the most recent one, that passwords are never passed through this call, that SSH requires the host key to already be in known_hosts (changed keys refused), and how credential storage and the ask dialog behave.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then a defaults paragraph, then per-argument docs in an Args block — good structure for a 21-parameter tool. It is long and contains a few expendable asides (the "Nothing is specific to telecom gear" device catalog and repeated baud lists), but almost every sentence conveys usable instruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 21-parameter, multi-transport connection tool with no annotations, the description covers defaults, per-transport semantics, authentication, terminal interpretation, and cross-tool conventions (connection naming, MRU default). An output schema exists, so return values need not be explained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 21 parameters, so the description must compensate — and it documents every one of them: port formats per OS, preset/name, the whole line setting group, line_ending and prompt semantics, the three terminal modes with their consequences, transport-specific applicability (baud ignored over telnet/tcp/ssh), host/tcp_port defaults, and the credential/ask distinction.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource: "Open a serial port, or a console over the network, and start its background reader." It also clarifies state scope (multiple ports open at once, each with a `name`, later tools default to the most recently used), which distinguishes it from `disconnect`, `reconnect_last`, and `list_serial_ports`.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: use `preset` for a device family (see `list_presets`), use `detect_baud` when the baud is unknown, pick `transport` per network topology, and choose `terminal` by what the device prints. It also states the alternatives for authentication (stored `credential` vs `ask=True` vs SSH agent/keys) and when not to use a feature (xonxoff "Never for binary protocols").

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.