pexpect-mcp

by mitsuhiko

用于远程 pexpect 会话控制的 MCP 服务器,支持 AI 助手执行带有 pexpect 功能的 Python 代码,以实现交互式调试会话。需要 Python >= 3.12.1 以及 Python 包 pexpect >= 4.9.0 和 mcp >= 1.13.0。

Developer toolsstdioCommunity

Repository-wide counts · Cached 2025-11-08

Overview

The pexpect-mcp MCP server is a publicly available project. Review the upstream repository for installation instructions, supported tools, compatibility, permissions, and current maintenance status.

Configuration

Configuration, transport, authentication, and runtime requirements vary by project. Open the repository before connecting and use the smallest set of credentials and permissions required.

Open the pexpect-mcp repository to read the latest documentation.

KEEP EXPLORING

Compare source, connection, and authentication details before choosing an implementation.

View the complete category

模型上下文协议服务器

modelcontextprotocol

Community

一组用于模型上下文协议(MCP)的参考实现,展示了对大型语言模型(LLM)工具和数据源的安全且受控的访问方式。

Context7 Platform - Up-to-date Code Docs For Any Prompt

upstash

Community

Context7 MCP server providing up-to-date, version-specific documentation and code examples for libraries, enabling coding agents to fetch accurate docs and code snippets. Requires an API key for higher rate limits, passed via CONTEXT7_API_KEY header.

Playwright MCP

Microsoft Corporation

Community

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. Enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

AIHawk

feder-cr

Community

AIHawk is an anti detect browser and web browsing agent, open source, with an MCP server for coding agents: undetected, no captchas, no blocks. It requires an OpenRouter API key for the standalone web UI mode, which can be provided via the --openrouter-key flag or the OPENROUTER_API_KEY environment variable or a .env file in the running directory.

FROM THE SOURCE

Repository README

Build-time snapshot · Retrieved 2026-10-05

View original

pexpect-mcp

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 support
  • timeout (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.