HT-MCP

HT-MCP

ht-mcp is useful for enabling Agents to use terminals (e.g. bash, zsh, fish) in the same way a human does. It solves the challenge of agents stalling when they encounter interactive terminal commands.

Category
Visit Server

README

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

Installation

🍺 Homebrew (Recommended)

brew tap memextech/tap
brew install ht-mcp

📦 Pre-built Binaries

Download from releases:

# macOS Intel
curl -L https://github.com/memextech/ht-mcp/releases/latest/download/ht-mcp-x86_64-apple-darwin -o ht-mcp

# macOS Apple Silicon
curl -L https://github.com/memextech/ht-mcp/releases/latest/download/ht-mcp-aarch64-apple-darwin -o ht-mcp

# Linux
curl -L https://github.com/memextech/ht-mcp/releases/latest/download/ht-mcp-x86_64-unknown-linux-gnu -o ht-mcp

# Windows (PowerShell)
curl.exe -L https://github.com/memextech/ht-mcp/releases/latest/download/ht-mcp-x86_64-pc-windows-msvc -o ht-mcp.exe

# Make executable and install
chmod +x ht-mcp && sudo mv ht-mcp /usr/local/bin/

🦀 Cargo

# From crates.io (stable)
cargo install ht-mcp

# From git (latest)
cargo install --git https://github.com/memextech/ht-mcp

🔧 Build from Source

git clone https://github.com/memextech/ht-mcp.git
cd ht-mcp
git submodule update --init --recursive
cargo install --path .

See docs/INSTALLATION.md for detailed installation options.

MCP Tools

Tool Description Parameters
ht_create_session Create new terminal session command?, enableWebServer?
ht_send_keys Send keystrokes to session sessionId, keys[]
ht_take_snapshot Capture terminal state sessionId
ht_execute_command Execute command and get output sessionId, command
ht_list_sessions List all active sessions None
ht_close_session Close terminal session sessionId

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

Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "ht-mcp": {
      "command": "ht-mcp",
      "args": ["--debug"]
    }
  }
}

For custom installation paths:

{
  "mcpServers": {
    "ht-mcp": {
      "command": "/path/to/ht-mcp",
      "args": []
    }
  }
}

Usage Example

# Start the MCP server
ht-mcp

# With debug logging
ht-mcp --debug

Once configured in your MCP client:

  1. Create session: ht_create_session → Returns session ID
  2. Run commands: ht_execute_command with session ID and command
  3. Interactive input: ht_send_keys for multi-step interactions
  4. Check state: ht_take_snapshot to see current terminal
  5. Clean up: ht_close_session when finished

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$

Requirements

  • Rust: 1.75+ (install via rustup)
  • Supported OS: Linux, macOS, Windows (experimental)

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

Troubleshooting

Installation Issues:

  • Ensure Rust 1.75+ is installed
  • Check internet connection for git submodules
  • Verify ~/.cargo/bin is in PATH

Runtime Issues:

  • Use ht-mcp --debug for verbose logging
  • Check 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

Fixed submodule commit reference

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured