mcpField
M
mcp server for unix pty control

mcp server for unix pty control

Local
github.com/ianksDeveloper Tools12Updated 38w ago

About mcp server for unix pty control

A Unix PTY MCP server for AI models that need interactive terminal access. It maintains named shell sessions and supports both immediate commands and asynchronous output polling.

Key features

  1. 01Create persistent terminal sessions
  2. 02Run commands synchronously or asynchronously
  3. 03Poll streaming command output
  4. 04Manage multiple named sessions
  5. 05Send control characters to terminals

Use cases

  1. 01Run commands in a persistent Bash session
  2. 02Start and monitor long-running commands
  3. 03Open an SSH session to a server

MCP support

Exposes terminal session management and command execution as MCP tools, including session creation, output reading, and cleanup.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.