A PTY runner for MCP
Project description
pty-mcp
A lightweight PTY runner for MCP (Model Context Protocol).
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.
Features
- Spawn shell commands in a real PTY
- Read incremental output from a ring buffer
- Wait for pattern matching (
read_until) - Send interactive input (
write) - Resize terminal (
cols/rows) - Process control (
status,wait,signal,close)
Requirements
- Python 3.10+
Installation
pip install pty-mcp
CLI Entrypoint
After installation, the package exposes:
pty-mcp
This starts the MCP server over stdio.
MCP Tools
pty_spawnpty_readpty_read_untilpty_writepty_resizepty_closepty_close_allpty_statuspty_waitpty_signalpty_list
Notes
- PTY sessions are in-memory and have idle timeout cleanup.
- The server is intended for local trusted environments.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pty_mcp-0.1.3.tar.gz.
File metadata
- Download URL: pty_mcp-0.1.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
159a931ea65f5706b8814d628f4c62830a4b90fc555687e996668ef2de233f3e
|
|
| MD5 |
b8e3486f1046235ae5ce0b9c4af227bd
|
|
| BLAKE2b-256 |
fe57196bc8e3efdea40e9c93891b57abe156d2fd810e5c410b27d1bf8b2cfd34
|
File details
Details for the file pty_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pty_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb37a78565f6f7f5a5b81e739fb4e488201b1e88d5a3f9bd5307a85e44a2899c
|
|
| MD5 |
de753947c1d7ea306cf6170366d35189
|
|
| BLAKE2b-256 |
20170b0ba85f4b71a70e14e6391613476feebb0796196ad12c70a21c758db47e
|