π₯οΈ MCP Terminal Server
Interactive terminal sessions via Model Context Protocol (MCP)
MCP Terminal Server provides cross-platform PTY (pseudo-terminal) support for Windows, Linux, and macOS, exposing terminal sessions through both REST API and MCP protocol. Perfect for AI assistants, remote terminal access, and terminal automation.
β¨ Features
π Cross-platform: Works on Windows (cmd.exe/PowerShell), Linux, and macOS
π Real PTY: Supports interactive commands (vim, nano, htop, etc.)
ποΈ Visual Snapshots: Captures what a human would see on the terminal screen
π€ UTF-8 Support: Handles special characters and emojis correctly
π MCP Protocol: Auto-exposes all endpoints as MCP tools via fastapi-mcp
π‘ REST API: Full HTTP/REST API with FastAPI
π― Multiple Sessions: Manage multiple terminal sessions simultaneously
π¦ Installation
From PyPI
From Source
π Quick Start
Start the Server
Access the Server
Once running, you can access:
API Documentation: http://localhost:8777/docs
MCP Endpoint: http://localhost:8777/mcp
Health Check: http://localhost:8777/health
π Usage
REST API
Create a Terminal
Response:
Send Commands
Get Visual Snapshot
Response:
List Terminals
Resize Terminal
Close Terminal
MCP Tools
When using with MCP clients (like Claude Desktop), the following tools are automatically available:
create_terminal_terminals__post- Create new terminallist_terminals_terminals__get- List active terminalsget_terminal_snapshot_terminals__terminal_id__snapshot_get- Get visual snapshotsend_terminal_input_terminals__terminal_id__input_post- Send commandsresize_terminal_terminals__terminal_id__resize_put- Resize terminalclose_terminal_terminals__terminal_id__delete- Close terminal
Python API
ποΈ Architecture
π§ Configuration
Command Line Options
Environment Variables
You can also configure via environment variables:
π§ͺ Testing
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Built with FastAPI
Uses terminado for cross-platform PTY support
Uses pyte for terminal emulation
MCP integration via fastapi-mcp
π Resources
π Bug Reports
If you find a bug, please open an issue on GitHub.
π¬ Support
For questions and support, please use GitHub Discussions.
Made with β€οΈ by the MCP Terminal team