Pty MCP Server

A PTY runner for MCP

Local serverstdioPython

What is the Pty MCP server?

Pty MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. A PTY runner for MCP.

What you get

pty-mcp provides terminal session tools over MCP so clients can spawn commands in a pseudo-terminal, read interactive output, send input, resize terminal windows, and manage process lifecycle safely.

  • Spawn shell commands in a real PTY
  • Read incremental output from a ring buffer
  • Wait for pattern matching (read_until)
  • Wait for any pattern (read_until_any)
  • Send interactive input (write)
  • Send input and wait for prompt (prompt)

What the assistant can call

Once Pty is connected, these are the calls the assistant has available:

  • pty_spawn — pty_resume
  • pty_recover — pty_attach
  • pty_detach — pty_handoff
  • pty_takeover — pty_read
  • pty_read_stdout — pty_read_stderr
  • pty_read_at — pty_read_until
  • pty_read_until_any — pty_read_quiescent
  • pty_prompt — confirm_dangerous_command
  • pty_write — pty_resize
  • pty_close — pty_status
  • pty_wait — pty_list
  • confirm_dangerous_command — The confirm_dangerous_command tool exposed by this server

Configuration and credentials

  • Python 3.10+ - tmux 3.x when using backend="tmux"

Setting it up

pty-mcp on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Pty's toolset — pty_spawn, pty_recover, pty_detach and 11 more — is a fair guide to whether it matches your workflow. It is maintained by wawe; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Pty.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the pty mcp server does with a few real requests.

Available tools

ToolWhat it does
pty_spawnpty_resume
pty_recoverpty_attach
pty_detachpty_handoff
pty_takeoverpty_read
pty_read_stdoutpty_read_stderr
pty_read_atpty_read_until
pty_read_until_anypty_read_quiescent
pty_promptconfirm_dangerous_command
pty_writepty_resize
pty_closepty_status
pty_waitpty_list
confirm_dangerous_commandThe confirm_dangerous_command tool exposed by this server.
pty_resumeThe pty_resume tool exposed by this server.
pty_read_quiescentThe pty_read_quiescent tool exposed by this server.

How to install the Pty MCP server

{
  "mcpServers": {
    "pty": {
      "command": "uvx",
      "args": ["pty-mcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.10+ - tmux 3.x when using backend="tmux"

Example prompts to try

  • Use Pty to pty spawn.
  • Use Pty to pty recover.
  • Use Pty to pty detach.

Frequently asked questions

It connects Pty to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (pty_spawn, pty_recover, pty_detach, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Pty directly.