Built as a high-performance Rust implementation, providing a Model Context Protocol server for headless terminal interactions
ht-mcp
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
Related MCP server: MCP Shell Server
Demo
ht-mcp in Memex
ht-mcp in Claude Code
Installation
šŗ Homebrew (Recommended)
š¦ Pre-built Binaries
Download from releases:
š¦ Cargo
š§ Build from Source
See docs/INSTALLATION.md for detailed installation options.
MCP Tools
Tool | Description | Parameters |
| Create new terminal session |
,
|
| Send keystrokes to session |
,
|
| Capture terminal state |
|
| Execute command and get output |
,
|
| List all active sessions | None |
| Close terminal session |
|
Note: Parameters use camelCase (e.g.,
sessionId,enableWebServer) for MCP compatibility.
Configuration
Add to your MCP client configuration:
For custom installation paths:
Usage Example
Once configured in your MCP client:
Create session:
ht_create_sessionā Returns session IDRun commands:
ht_execute_commandwith session ID and commandInteractive input:
ht_send_keysfor multi-step interactionsCheck state:
ht_take_snapshotto see current terminalClean up:
ht_close_sessionwhen finished
Response Format
This server returns human-readable text responses (not JSON), designed for natural language interaction:
Requirements
Rust: 1.75+ (install via rustup)
Supported OS: Linux, macOS, Windows (experimental)
Development
Troubleshooting
Installation Issues:
Ensure Rust 1.75+ is installed
Check internet connection for git submodules
Verify
~/.cargo/binis in PATH
Runtime Issues:
Use
ht-mcp --debugfor verbose loggingCheck MCP client configuration syntax
Verify binary path:
which ht-mcp
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
License
Apache 2.0 License
Copyright (c) 2025 Atlas Futures Inc.
See LICENSE for details.
Contributing
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
Built with MemexāØ