MCP-Telnet provides a comprehensive set of tools for interacting with telnet services. This document provides detailed information about each available tool.
Sets the identity information for the LLM. This identity is used during telnet negotiation to identify the client. This typically happens automatically but can be set manually if needed.
set_llm_identity with: {
"name": "Claude",
"version": "3.7 Sonnet",
"provider": "Anthropic",
"capabilities": ["text"],
"metadata": { "additional": "info" }
}
Parameters:
name: Name of the LLM (required)version: Version of the LLM (required)provider: Provider/creator of the LLM (required)capabilities: Array of capability strings (optional)metadata: Additional metadata object (optional)
Retrieves the current identity information.
get_llm_identity
Returns the current identity with name, version, provider, and other details.
Establishes a connection to a telnet server either by specifying host/port or using a saved connection name.
connect_telnet with: {
"host": "mud.example.com",
"port": 4000,
"saveName": "my-mud"
}
For SSL/TLS encrypted connections:
connect_telnet with: {
"host": "chatmud.com",
"port": 7443,
"tls": true,
"saveName": "ChatMUD-secure"
}
Or connect using a saved connection:
connect_telnet with: {
"name": "my-mud"
}
Parameters:
host: Hostname or IP address (required for new connections)port: Port number, defaults to 23 if not specifiedsaveName: Name to save this connection as (optional)name: Name of a previously saved connection to usetls: Enable SSL/TLS encryption for secure connections (optional, defaults to false)
Closes the current telnet connection.
disconnect_telnet
Gets or updates the status of the current connection.
connection_status with: {
"toggleContinuousMode": true,
"defaultDelay": 2
}
Parameters:
toggleContinuousMode: Enable or disable continuous mode (optional)defaultDelay: Set a default delay in seconds between commands (optional)
Returns information about the current connection including host, port, and state.
Lists all saved connections.
list_saved_connections
Returns an array of saved connections with their details.
Sends a command to the telnet server and returns the response. Supports two modes:
Default mode — returns after a fixed buffer wait (500ms):
send_command with: {
"command": "look",
"timeout": 30000,
"waitAfter": 3
}
waitFor mode — polls the response buffer for a regex pattern and returns as soon as it matches. Much faster than fixed waits because it resolves immediately when the expected output appears:
send_command with: {
"command": "look",
"waitFor": "You can go"
}
More examples of waitFor patterns:
send_command with: { "command": "MAP POI", "waitFor": "Enter your selection" }
send_command with: { "command": "WALK Town Square", "waitFor": "You've arrived" }
send_command with: { "command": "CREDITS", "waitFor": "credits" }
send_command with: { "command": "SALVAGE", "waitFor": "begin scanning|No debris" }
Parameters:
command: The command to send (required)timeout: Timeout in milliseconds (defaults to 30000)waitAfter: Seconds to wait after sending the command (defaults to 0, ignored ifwaitForis set)waitFor: Regex pattern to wait for in the response buffer (optional, case-insensitive). When set, the command returns as soon as the pattern is matched instead of waiting a fixed delay. If the pattern is not matched before the timeout, the accumulated buffer is returned anyway with a note that the pattern was not matched.
Gets the current response buffer without sending a command.
get_buffer
Returns the current buffer content.
Waits for a specified number of seconds before proceeding.
wait with: {
"seconds": 5
}
Parameters:
seconds: Number of seconds to wait (0-60, defaults to 1)
Sends a sequence of commands with specified delays or pattern-based waits between them. Each command can use either a fixed delay (waitAfter) or a regex pattern (waitFor) to determine when to proceed.
With fixed delays:
sequence_commands with: {
"commands": [
{ "command": "north", "waitAfter": 2 },
{ "command": "look", "waitAfter": 1 },
{ "command": "get treasure", "waitAfter": 0 }
],
"timeout": 60000
}
With waitFor patterns (faster and more reliable):
sequence_commands with: {
"commands": [
{ "command": "BUY 14", "waitFor": "Enter your selection" },
{ "command": "5", "waitFor": "Continue with purchase" },
{ "command": "yes", "waitFor": "credits" }
]
}
Mixed mode (some commands use patterns, others use delays):
sequence_commands with: {
"commands": [
{ "command": "north", "waitFor": "You can go" },
{ "command": "look", "waitAfter": 1 },
{ "command": "get treasure", "waitFor": "You pick up" }
]
}
Parameters:
commands: Array of command objects with the following structure:command: The command to send (required)waitAfter: Seconds to wait after this command (defaults to 1, ignored ifwaitForis set)waitFor: Regex pattern to wait for before proceeding to the next command (optional, overrideswaitAfter)
timeout: Default timeout in milliseconds for all commands (defaults to 30000)
Retrieves session logs with filtering options.
get_session_logs with: {
"connectionName": "medievia",
"startDate": "2023-01-01T00:00:00Z",
"endDate": "2023-01-31T23:59:59Z",
"sessionId": "a1b2c3d4-e5f6-g7h8-i9j0"
}
Parameters:
connectionName: Filter logs by connection name (optional)startDate: Filter logs by start date in ISO format (optional)endDate: Filter logs by end date in ISO format (optional)sessionId: Filter logs by specific session ID (optional)
Stores or updates memory/notes for a connection.
update_connection_memory with: {
"connectionName": "batmud",
"memory": "Market square is north of the main gate"
}
Parameters:
connectionName: Name of the saved connection (uses current if omitted)memory: Text to save as memory (required)
Retrieves the stored memory for a connection.
get_connection_memory with: {
"connectionName": "batmud"
}
Parameters:
connectionName: Name of the saved connection (uses current if omitted)
Tools can be used in sequence for more complex interactions:
- Connect to a server
- Send an initial command
- Get the buffer to check for login prompts
- Send credentials
- Wait for server response
- Send follow-up commands
All tools provide consistent error messages when issues occur. The most common errors are:
- Connection errors (server unreachable)
- Authentication failures
- Timeout errors (server didn't respond in time)
- Command failures
Always check the success status of tool returns to handle errors appropriately.
The MTTS (Mud Terminal Type Standard) is used during connection negotiation. MCP-Telnet sends:
MTTS 1 MCP-Telnet/[VERSION] [CLIENT_NAME]/[CLIENT_VERSION] ([PROVIDER]) 13
The flags value (13) indicates:
- UTF-8 text encoding (4)
- ANSI color support (1)
- 256 color support (8)
This helps servers provide appropriate formatting and identify the client properly.