PTY MCP Server
# PTY MCP Server
**pty-mcp** is a Model Context Protocol (MCP) server designed to manage pseudo-terminal (PTY) sessions. Built with **TypeScript** and the **Effect** ecosystem, it provides a robust and type-safe interface for spawning, controlling, and interacting with terminal processes programmatically.
## Features
- **Spawn Sessions:** Create new PTY sessions with custom commands, arguments, and environment variables.
- **Interactive Control:** Write data to stdin and read from stdout/stderr in real-time.
- **Session Management:** List active sessions, monitor status, and terminate processes.
- **Effect Ecosystem:** Leverages the power of the Effect library for error handling, concurrency, and resource management.
- **MCP Integration:** Seamlessly exposes PTY capabilities to MCP-compliant clients.
## Installation
```bash
pnpm install
```
## Usage
### Build
```bash
pnpm run build
```
### Start Server
```bash
pnpm start
```
### Testing
```bash
pnpm run test
```
## Author
**Ali Almahdi**
*Digital Innovation Architect & AI Enthusiast*
Crafting the future of technology at the intersection of AI and human experience.
- **Website:** [ali.ac](https://ali.ac)
- **GitHub:** [@almahdi](https://github.com/almahdi)
- **X (Twitter):** [@alialmahdi](https://twitter.com/alialmahdi)
## License
This project is licensed under the **AGPL-3.0 License**. See the [LICENSE](LICENSE) file for details.
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: pty_spawn creates sessions, pty_list enumerates them, pty_write sends input, pty_read retrieves output, and pty_kill terminates sessions. The descriptions reinforce these distinct roles, making tool selection unambiguous for an agent.
All tools follow a consistent 'pty_' prefix with descriptive action suffixes (spawn, list, write, read, kill) in snake_case. This uniform pattern makes the tool set predictable and easy to navigate, with no deviations in naming conventions.
With 5 tools, this server is well-scoped for managing pseudo-terminal sessions. Each tool serves a clear, necessary function (create, list, input, output, destroy), providing complete lifecycle coverage without bloat or redundancy, which is ideal for the domain.
The tool set offers complete CRUD/lifecycle coverage for PTY management: spawn (create), list (read), write (update input), read (retrieve output), and kill (delete). There are no obvious gaps; agents can fully manage sessions from creation to termination with all necessary interactions.