# Pexpect

> Use this tool when you need to automate interactions with command-line programs, debuggers, or interactive shells, and require real-time input/output control. It solves problems in automated debugging sessions, system administration tasks, and scenarios where AI assistants need to interact with terminal applications. The tool takes Python code as input, launches processes, sends commands, and captures output, making it a valuable asset for tasks that require remote process control and debugging capabilities.

Canonical page: https://skillsregistry.net/skills/mitsuhiko-pexpect  
JSON: https://api.skillsregistry.net/v1/skills/mitsuhiko-pexpect

## Description

This MCP server provides remote process control and debugging capabilities through Python's pexpect library, enabling AI assistants to spawn, interact with, and control command-line programs, debuggers, and interactive shells. Built by Mitsuhiko using FastMCP with timeout handling and session persistence, it executes Python code that can launch processes like lldb, gdb, or any terminal application, then send commands and capture output through expect patterns. The implementation maintains global session state across tool calls and includes a demo buggy C program for testing debugging workflows, making it valuable for automated debugging sessions, system administration tasks, and scenarios where AI assistants need to interact with command-line tools that require real-time input/output control.

## Trust

- **Trust score (0–1):** 0.50
- **Verification tier:** unverified

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** productivity
- **Updated:** 2026-04-25

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/mitsuhiko-pexpect)
- **Repository:** <https://github.com/mitsuhiko/pexpect-mcp>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "mitsuhiko-pexpect"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/mitsuhiko-pexpect` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/mitsuhiko-pexpect/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
