Pexpect
Provides remote process control and debugging capabilities through Python's pexpect library, enabling spawning, interaction with, and control of command-line pr

Install Pexpect in Claude Desktop, Claude Code & Cursor
Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
$ unyly install pexpectFirst time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Step-by-step: how to install Pexpect
About
Provides remote process control and debugging capabilities through Python's pexpect library, enabling spawning, interaction with, and control of command-line programs, debuggers, and interactive shells with session persistence and timeout handling.
README
An MCP (Model Context Protocol) server that provides remote pexpect session control for debugging and process interaction.
Overview
This MCP server enables AI assistants to execute Python code with pexpect functionality, allowing for interactive debugging sessions with tools like LLDB, GDB, and other command-line utilities that require programmatic interaction.
In some sense this is less of a pexpect MCP as one that is just maintaining a stateful Python session.
Installation
uv tool install git+https://github.com/mitsuhiko/pexpect-mcp
Usage
As an MCP Server
Add to your Claude Code configuration:
{
"mcpServers": {
"pexpect": {
"command": "pexpect-mcp"
}
}
}
Tool Usage
The server provides a single tool: pexpect_tool
Parameters:
code(string): Python code to execute with pexpect supporttimeout(optional int): Timeout in seconds (default: 30)
Example Usage:
# Start a debugging session
child = pexpect.spawn('lldb ./my-program')
child.expect('(lldb)')
# Run the program
child.sendline('run')
child.expect('(lldb)')
print(child.before.decode())
# Get backtrace
child.sendline('bt')
child.expect('(lldb)')
print(child.before.decode())
Demo
The repository includes a demo with a buggy C program (demo-buggy.c) that can
be debugged using LLDB through the pexpect interface. This demonstrates the
server's capability for interactive debugging sessions.
The program `./demo-buggy` crashes when executed. Use LLDB to:
- Start the program under the debugger
- Identify where and why it crashes
- Examine variables, memory, and call stack
- Report the root cause of the crash
Requirements
- Python ≥ 3.12.1
- pexpect ≥ 4.9.0
- mcp ≥ 1.13.0
License
See LICENSE file for details.
FAQ
Is Pexpect MCP free?
Yes, Pexpect MCP is free — one-click install via Unyly at no cost.
Does Pexpect need an API key?
No, Pexpect runs without API keys or environment variables.
Is Pexpect hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Pexpect in Claude Desktop, Claude Code or Cursor?
Open Pexpect on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
GitHubPRs, issues, code search, CI status
Filesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Unyly Deploy
UnylyDeploy sites and MCP servers to Unyly straight from your AI agent
Template MCP Server
mcpdotdirectA CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
Server Sequential Thinking
GitHub ActionsMCP server for sequential thinking and problem solving
gnomancer
com.gnomancerLocal raw DNA analysis: haplogroups, traits, ClinVar, pharmacogenomics. Nothing is uploaded.
Amap Maps Mcp Server
duxiaohuiMCP server for using the AMap Maps API
PayMCP
blustAILightweight payments layer for MCP servers: turn tools into paid endpoints with a two-line decorator. [PyPI](https://pypi.org/project/paymcp/) · [npm](https://w
demo
yoojoohans-jpgdemo — MCP server via Smithery
Compare Pexpect with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
