Telnet client capabilities for LLMs with expect-style automation: - Multi-connection management with connection IDs - Basic send/read operations with auto-response - expect() for pattern matching across multiple patterns - expect_send() for classic expect-style interactions - run_script() for full automation sequences - Password hiding for sensitive data
89 lines
2.1 KiB
Markdown
89 lines
2.1 KiB
Markdown
# mctelnet
|
|
|
|
MCP server providing telnet client capabilities for LLMs. Connect to BBSes, MUDs, network devices, and any telnet-accessible system.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
uvx mctelnet
|
|
```
|
|
|
|
Or add to Claude Code:
|
|
|
|
```bash
|
|
claude mcp add mctelnet "uvx mctelnet"
|
|
```
|
|
|
|
## Features
|
|
|
|
- **Multi-connection management** - Handle multiple simultaneous telnet sessions
|
|
- **Expect-style automation** - Pattern matching for interactive prompts
|
|
- **Script execution** - Run complete login/automation sequences
|
|
- **Password hiding** - Redact sensitive data from outputs
|
|
|
|
## Tools
|
|
|
|
| Tool | Description |
|
|
|------|-------------|
|
|
| `connect` | Establish telnet connection, returns connection ID |
|
|
| `send` | Send text to connection (auto-reads response) |
|
|
| `read` | Read available data from connection |
|
|
| `expect` | Wait for one of multiple patterns |
|
|
| `expect_send` | Wait for pattern, then send text |
|
|
| `run_script` | Execute expect-style automation script |
|
|
| `list_connections` | Show all active connections |
|
|
| `disconnect` | Close a connection |
|
|
| `disconnect_all` | Close all connections |
|
|
|
|
## Usage Examples
|
|
|
|
### Basic Interaction
|
|
|
|
```python
|
|
# Connect to a server
|
|
conn = await connect("bbs.example.com", 23)
|
|
# conn returns {"id": "abc123", ...}
|
|
|
|
# Send a command
|
|
await send("abc123", "help")
|
|
|
|
# Disconnect
|
|
await disconnect("abc123")
|
|
```
|
|
|
|
### Expect-Style Login
|
|
|
|
```python
|
|
# Connect and wait for login prompt
|
|
conn = await connect("server.example.com", 23)
|
|
|
|
# Handle login sequence
|
|
await expect_send(conn_id, "login:", "myuser")
|
|
await expect_send(conn_id, "Password:", "mypass", hide_send=True)
|
|
await expect_send(conn_id, "$ ", "ls -la")
|
|
```
|
|
|
|
### Scripted Automation
|
|
|
|
```python
|
|
await run_script(conn_id, [
|
|
{"expect": "login:", "send": "admin"},
|
|
{"expect": "Password:", "send": "secret", "hide": True},
|
|
{"expect": "$ ", "send": "show version"},
|
|
{"expect": "$ ", "send": "show interfaces"},
|
|
{"expect": "$ ", "send": "exit"}
|
|
])
|
|
```
|
|
|
|
## Use Cases
|
|
|
|
- Connecting to retro BBSes and MUDs
|
|
- Network device configuration (routers, switches)
|
|
- Legacy system automation
|
|
- Interactive service testing
|
|
- Terminal-based game playing
|
|
|
|
## License
|
|
|
|
MIT
|