๐ฅ๏ธ 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
This server cannot be installed