1. Conduid
  2. Developer Tools
  3. Pty MCP
MCP server · Developer Tools

Pty MCP

MCP server for debugging PTY/TTY/TUI programs. Enables Claude Code to control Claude Code, vim, and other TUI apps.

Unclaimed MIT last commit 10 months ago devtools
34Low

Scored 11 days ago · breakdown

About Pty MCP

Pty MCP is an MCP server published by so2liu in the Developer Tools category: mCP server for debugging PTY/TTY/TUI programs. Enables Claude Code to control Claude Code, vim, and other TUI apps.

The repository has 7 stars and 2 forks, with the last commit 10 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/so2liu/pty-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Pty MCP

Powered by Claude · Grounded in docs

I know everything about Pty MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

Releases

v1.0.11v1.0.11 · 19 Dec 2025Test with corrected workflow filename
v1.0.10v1.0.10 · 19 Dec 2025Test OIDC with provenance flag
v1.0.9v1.0.9 · 19 Dec 2025Debug OIDC
v1.0.8v1.0.8 · 19 Dec 2025Remove registry-url for native npm OIDC
v1.0.7v1.0.7 · 19 Dec 2025Fix: use npm install for lockfile compatibility

README

PTY Debug MCP Server

MCP server for debugging PTY/TTY/TUI programs. Enables Claude Code to spawn, interact with, and capture screen output from any terminal-based program.

Use Case: TUI Debugging

This MCP server allows Claude Code to control Claude Code itself, vim, top, and other TUI programs. This enables:

  • Automated TUI testing
  • Debugging terminal applications
  • Screen scraping from interactive programs
  • CI/CD integration for TUI apps

Demo: Claude Code controlling Claude Code

1. spawn_session({ command: "claude" })
2. send_input({ specialKey: "shift+tab" })  // cycle modes
3. send_input({ input: "what is 1+1?" })
4. send_input({ specialKey: "enter" })
5. get_snapshot()  // see Claude's response

Demo: Claude Code controlling vim

1. spawn_session({ command: "vim", args: ["test.txt"] })
2. send_input({ input: "i" })              // enter INSERT mode
3. send_input({ input: "Hello World!" })   // type text
4. send_input({ specialKey: "escape" })    // exit INSERT mode
5. send_input({ input: ":wq" })            // save command
6. send_input({ specialKey: "enter" })     // execute

Installation

Claude Code

claude mcp add pty-debug -- npx -y @so2liu/pty-mcp-server@latest

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "pty-debug": {
      "command": "npx",
      "args": ["-y", "@so2liu/pty-mcp-server@latest"]
    }
  }
}

VS Code / Copilot

Add to VS Code settings or .vscode/mcp.json:

{
  "mcpServers": {
    "pty-debug": {
      "command": "npx",
      "args": ["-y", "@so2liu/pty-mcp-server@latest"]
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "pty-debug": {
      "command": "npx",
      "args": ["-y", "@so2liu/pty-mcp-server@latest"]
    }
  }
}

Cline

Add to Cline MCP settings:

{
  "mcpServers": {
    "pty-debug": {
      "command": "npx",
      "args": ["-y", "@so2liu/pty-mcp-server@latest"]
    }
  }
}

Gemini CLI

gemini mcp add pty-debug -- npx -y @so2liu/pty-mcp-server@latest

Codex CLI

codex mcp add pty-debug -- npx -y @so2liu/pty-mcp-server@latest

MCP Tools

Tool Description
spawn_session Start a TUI program in a PTY
send_input Send text or special keys
get_snapshot Capture current screen state
resize_terminal Change terminal dimensions
list_sessions List active sessions
close_session Terminate a session

Special Keys

Supports all common shortcuts:

  • Basic: enter, tab, shift+tab, escape, backspace, delete
  • Arrows: up, down, left, right
  • With modifiers: shift+up, ctrl+right, alt+left, etc.
  • Control: ctrl+a to ctrl+z
  • Alt: alt+a to alt+z
  • Function: f1 to f12
  • Navigation: home, end, pageup, pagedown

Screen Snapshot Format

-------------------------------------------------------------------------------------
 1 |Processes: 643 total, 3 running, 640 sleeping                          17:57:23 |
 2 |Load Avg: 2.38, 2.75, 2.88  CPU usage: 13.13% user, 4.49% sys                    |
 3 |...                                                                              |
-------------------------------------------------------------------------------------

Development

# Install dependencies
bun install

# Development mode
bun run dev

# Build
bun run build

# Lint
bun run lint

Tech Stack

  • Node.js (runtime)
  • TypeScript
  • node-pty (PTY spawning)
  • @xterm/headless (terminal emulation)
  • @modelcontextprotocol/sdk (MCP server)

Publishing

Releases are automatically published to npm via GitHub Actions.

Setup (one-time)

  1. Create npm granular token at https://www.npmjs.com/settings/tokens/granular-access-tokens/new

    • Expiration: 90 days
    • Packages: @so2liu/pty-mcp-server
    • Permissions: Read and write
  2. Add NPM_TOKEN secret at https://github.com/so2liu/pty-mcp/settings/secrets/actions

  3. Set calendar reminder to rotate token every 90 days

Release new version

  1. Update version in package.json
  2. Create a GitHub release with tag (e.g., v1.0.1)
  3. GitHub Actions will automatically publish to npm

License

MIT

README fetched from the repository 7 days ago. The original is authoritative.

Questions

About Pty MCP

How do I install Pty MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Pty MCP safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 4 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Pty MCP still maintained?

The last commit was 10 months ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.