Skip to main content
Glama

HT-MCP

by memextech
Apache 2.0
67
  • Apple
  • Linux

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

Demo

ht-mcp in Memex

ht-mcp in Memex

ht-mcp in Claude Code

ht-mcp in Claude Code

Installation

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

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.

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

-
security - not tested
A
license - permissive license
-
quality - not tested

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.

  1. Features
    1. Demo
      1. ht-mcp in Memex
      2. ht-mcp in Claude Code
    2. Installation
      1. 🍺 Homebrew (Recommended)
      2. 📦 Pre-built Binaries
      3. 🦀 Cargo
      4. 🔧 Build from Source
    3. MCP Tools
      1. Configuration
        1. Usage Example
          1. Response Format
            1. Requirements
              1. Development
                1. Troubleshooting
                  1. Performance
                    1. License
                      1. Contributing
                        1. Fixed submodule commit reference

                          Related MCP Servers

                          • -
                            security
                            A
                            license
                            -
                            quality
                            An enhanced MCP server that grants AI assistants the ability to execute terminal commands on a user's system with improved security controls, designed for use in controlled environments.
                            Last updated -
                            Python
                            MIT License
                            • Apple
                          • A
                            security
                            A
                            license
                            A
                            quality
                            A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.
                            Last updated -
                            1
                            76
                            2
                            TypeScript
                            MIT License
                            • Linux
                            • Apple
                          • -
                            security
                            F
                            license
                            -
                            quality
                            An MCP server that allows AI models to execute system commands on local machines or remote hosts via SSH, supporting persistent sessions and environment variables.
                            Last updated -
                            10
                            1
                            TypeScript
                          • -
                            security
                            A
                            license
                            -
                            quality
                            An MCP server that bridges AI agents with GUI automation capabilities, allowing them to control mouse, keyboard, windows, and take screenshots to interact with desktop applications.
                            Last updated -
                            Python
                            MIT License
                            • Apple
                            • Linux

                          View all related MCP servers

                          MCP directory API

                          We provide all the information about MCP servers via our MCP API.

                          curl -X GET 'https://glama.ai/api/mcp/v1/servers/memextech/ht-mcp'

                          If you have feedback or need assistance with the MCP directory API, please join our Discord server