Sponsored by Deepsite.site

mcp server for unix pty control

Created By
ianks5 months ago
The native MCP server for Unix PTY control gives AI models authentic, low-latency terminal access by spawning true pseudo-terminals—not brittle AppleScript hacks—so you can open persistent Bash, Python, or SSH sessions, run commands like “ssh prod.server,” and stream only fresh output thanks to smart buffering. Built on Tokio for fully asynchronous, non-blocking I/O, the service supports multi-session workflows, letting developers switch between concurrent prod-debug shells without interruption while JSON-RPC endpoints such as tools/call create_session handle lifecycle automation. This combination of real PTYs, session persistence, and high-performance async design makes the MCP server an ideal foundation for DevOps automation, cloud debugging, and AI-driven terminal orchestration.
Content

terminal-mcp

native mcp server for unix pty control.

what

mcp server that gives ai models real terminal access. spawn sessions, run commands, read output. that's it.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "create_session",
    "arguments": {
      "session_name": "prod-debug",
      "command": "ssh prod.server"
    }
  }
}

features

  • true ptys not applescript hacks, real unix terminals
  • async everything tokio-powered non-blocking i/o
  • smart buffering only new output, no duplicates
  • session persistence terminals stay alive between calls
  • multi-session support run multiple terminals at once and switch between them

concepts

  • sessions: named terminal instances (bash, python, ssh)
  • tools: mcp protocol endpoints the ai calls
  • ptys: pseudo-terminals for proper shell interaction
  • managers: lifecycle and cleanup automation

tools

  • create_session: spawn a new terminal
  • execute_command: run and get output immediately
  • execute_command_async: start long-running commands
  • read_streaming_output: poll async command progress
  • list_sessions: see what's running
  • destroy_session: cleanup when done
  • send_control_character: ctrl-c and friends

config

claude code:

cargo install --git https://github.com/ianks/terminal-mcp
claude mcp add --scope user terminal-mcp

dev

cargo test -- --nocapture           # see test output
RUST_LOG=debug cargo run            # verbose logging
cargo clippy                        # lint
cargo fmt                           # format

architecture

mcp api layer (json-rpc)
session manager (lifecycle)
pty engine (pty-process)
unix ptys (kernel)

philosophy

ai can interact with computers like humans do. no abstractions. just shells.

license

mit

Server Config

{
  "mcpServers": {
    "terminal-mcp": {
      "type": "stdio",
      "command": "terminal-mcp"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.