MCP Server providing fully interactive terminal sessions for AI agents - TUI support, keyboard control, screen capture
Project description
Vitjas Interactive Terminal MCP Server
A Model Context Protocol (MCP) server providing fully interactive terminal sessions for AI agents.
🎯 Purpose
This server enables AI agents to interact with any command-line application, including:
- TUI applications: htop, top, btop, ncdu, nmtui, etc.
- Text editors: nano, vim, emacs
- Pagers: less, more
- File managers: midnight commander (mc), ranger
- Interactive CLIs: python REPL, node REPL, mysql, psql
- Long-running processes: downloads, builds, tests
✨ Key Features
- 🖥️ True Interactive Terminals - Not just command execution!
- ⌨️ Full Keyboard Support - Arrow keys, Ctrl, Alt, Function keys
- 📜 Scrollback History - 50,000 lines of history
- 🔄 Session Persistence - Terminals persist between commands
- 📊 Screen Capture - Read terminal output anytime
- 🎮 TUI Navigation - Navigate menus, lists, editors
- 🔍 Buffer Search - Search through terminal history
📦 Installation
From PyPI (Recommended)
pip install vitjas-interactive-terminal
Prerequisites
# Ensure tmux is installed
apt-get install tmux # Debian/Ubuntu
brew install tmux # macOS
⚙️ Configuration
For Claude Desktop / Agent Zero
Add to your MCP configuration:
{
"mcpServers": {
"InteractiveTerminal": {
"command": "vitjas-interactive-terminal",
"args": []
}
}
}
No paths needed! After pip install, the command is available system-wide.
🔧 Available Tools
| Tool | Description |
|---|---|
create_terminal |
Create a new interactive terminal session |
send_text |
Send text/commands to terminal |
send_keys |
Send special keys (arrows, Ctrl, Alt, F-keys) |
get_screen |
Read terminal output with metadata |
list_terminals |
List all active terminal sessions |
delete_terminal |
Close/delete a terminal session |
search_buffer |
Search through terminal history |
⌨️ Supported Keys for send_keys
| Category | Keys |
|---|---|
| Navigation | up, down, left, right, home, end, pageup, pagedown |
| Control | ctrl+a through ctrl+z, ctrl+c (interrupt), ctrl+d (EOF) |
| Alt | alt+a through alt+z |
| Special | enter, escape, tab, backspace, delete, f1-f12 |
💡 Usage Examples
Run a Simple Command
1. create_terminal(directory="/home/user")
2. send_text("ls -la\n")
3. get_screen() # See the directory listing
Navigate htop
1. create_terminal()
2. send_text("htop\n")
3. send_keys("down") # Move selection down
4. send_keys("enter") # View process details
5. send_keys("q") # Quit htop
Edit File in nano
1. create_terminal(directory="/tmp")
2. send_text("nano myfile.txt\n")
3. send_text("Hello World!")
4. send_keys("ctrl+o") # Save
5. send_keys("enter") # Confirm filename
6. send_keys("ctrl+x") # Exit
🔧 Technical Details
- Backend: tmux sessions
- History: 50,000 lines scrollback
- Default size: 120 cols × 40 rows
- Session persistence: Until deleted or server restart
📄 License
MIT License
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 vitjas_interactive_terminal-1.0.2.tar.gz.
File metadata
- Download URL: vitjas_interactive_terminal-1.0.2.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f547b3deeb589d47aabb2096527e18609016d8e5afbf1eb869e9a884d4ae185
|
|
| MD5 |
b6d899963cb1378b8c1e1952b40a97e4
|
|
| BLAKE2b-256 |
c36145d5e54d15e36b200219bd3d3828bc177e12ab27dc469aaf17cb2fac06c9
|
File details
Details for the file vitjas_interactive_terminal-1.0.2-py3-none-any.whl.
File metadata
- Download URL: vitjas_interactive_terminal-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7721cb1efb02c76e6eb6d54c78c40b88cf1a4aa2eadc1aa72ddc10479cfd6a7
|
|
| MD5 |
0d907e18a57af516b691d17cb6673fa7
|
|
| BLAKE2b-256 |
b3d7d7d0a7b7924034ba1ba3ad7a5bc4ab514422ee288a89fa24f8e4501c5902
|