Labsco
memextech logo

Headless Terminal (ht) MCP

โ˜… 215

from memextech

A high-performance MCP server for the headless terminal (ht), implemented in Rust.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

ht-mcp

Rust License: Apache 2.0

A high-performance Rust implementation of a Model Context Protocol (MCP) server for headless terminal ht.

Features

  • ๐Ÿš€ Pure Rust: Single binary MCP server, no external dependencies
  • ๐Ÿ”— Direct Integration: Embed excellent ht headless terminal library for optimal performance
  • ๐Ÿ–ฅ๏ธ Multi-Session: Concurrent terminal session management
  • ๐ŸŒ Web Interface: Optional live terminal preview

Demo

ht-mcp in Memex

ht-mcp in Memex

ht-mcp in Claude Code

ht-mcp in Claude Code

MCP Tools

ToolDescriptionParameters
ht_create_sessionCreate new terminal sessioncommand?, enableWebServer?
ht_send_keysSend keystrokes to sessionsessionId, keys[]
ht_take_snapshotCapture terminal statesessionId
ht_execute_commandExecute command and get outputsessionId, command
ht_list_sessionsList all active sessionsNone
ht_close_sessionClose terminal sessionsessionId

Note: Parameters use camelCase (e.g., sessionId, enableWebServer) for MCP compatibility.

Response Format

This server returns human-readable text responses (not JSON), designed for natural language interaction:

# Create session response
HT session created successfully!

Session ID: abc123-def456-789...

๐ŸŒ Web server enabled! View live terminal at: http://127.0.0.1:3618
# Terminal snapshot response
Terminal Snapshot (Session: abc123...)

bash-3.2$ ls -la
total 16
drwxr-xr-x  4 user staff  128 Jun 13 10:30 .
-rw-r--r--  1 user staff   45 Jun 13 10:30 file.txt
bash-3.2$

Development

# Clone with submodules
git clone --recursive https://github.com/memextech/ht-mcp.git
cd ht-mcp

# Build
cargo build

# Run
cargo run

# Test
cargo test

Performance

Compared to the original TypeScript implementation:

  • 40x faster startup (~50ms vs ~2s)
  • 70% less memory (~15MB vs ~50MB)
  • Single binary (4.7MB vs ~200MB Node.js)
  • Zero subprocess overhead