mcp server for unix pty control
ianks/terminal-mcp · 12 stars · Rust
MCP server 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 o
Install
The repo has no one-line install. Follow its README.
Files
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 terminalexecute_command: run and get output immediatelyexecute_command_async: start long-running commandsread_streaming_output: poll async command progresslist_sessions: see what's runningdestroy_session: cleanup when donesend_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
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 12
- Language
- Rust
- Last push
- 2026-02-05
- Forks
- 4
- Topics
- mcp, mcp-client, rust
- 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
- 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
- 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
- 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
- 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k