Screen session manager with MCP support
Project description
Screen Session Manager
Manage screen sessions programmatically. Send commands, capture output, and automate workflows.
Install
pip install -e .
Quick Start
from screen_manager import ScreenSessionManager
manager = ScreenSessionManager()
# Create session and send commands
manager.create_session("work")
manager.send_command("work", "python script.py")
output = manager.capture("work")
CLI Usage
# Create and manage sessions
python -m screen_manager create work
python -m screen_manager send work "echo hello"
python -m screen_manager capture work
# Send multiple commands
python -m screen_manager send-commands work -c "echo 1" -c "echo 2"
# Execute files
python -m screen_manager send-file work script.py
# List and attach
python -m screen_manager list --all
python -m screen_manager attach work
# Smart create/attach
python -m screen_manager create-or-attach work
# Cleanup
python -m screen_manager cleanup work
MCP Server
# Run as MCP server
python -m screen_manager serve
# Or from Python
from screen_manager.mcp_server import main
main()
MCP Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"screen-manager": {
"command": "python",
"args": ["-m", "screen_manager.mcp_server"],
"description": "Manage screen sessions, send commands, and capture output"
}
}
}
API Methods
create_session(name)- Create new sessionsend_command(name, cmd)- Send single commandsend_commands(name, cmds)- Send command listsend_command_from_file(name, file)- Execute filecapture(name, lines=-1)- Get outputlist_sessions(all_sessions=False)- List sessionsattach_session(name)- Get attach instructionscreate_or_attach_session(name)- Smart create/attachcleanup_session(name)- Remove session
MCP Tools
The MCP server provides 10 tools:
create_sessionsend_commandsend_commandssend_command_from_filecapture_outputlist_sessionslist_all_sessionsattach_sessioncreate_or_attach_sessioncleanup_session
Use Case: Debugging with selective breakpoints
manager.send_commands("debug", [ "export CIPDB_IDS=validate,transform", "python script_with_cipdb.py" ])
Requirements
- Python 3.8+
screencommand (install withapt install screenorbrew install screen)
That's it. Simple screen session management for Python.
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 screen_manager-0.1.0.tar.gz.
File metadata
- Download URL: screen_manager-0.1.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e01bdac7924a0758256949c6ebb5a0c4a948ec706c431b688dcb98030dfafc8
|
|
| MD5 |
7127614cc31a3ac69525f192f0b14016
|
|
| BLAKE2b-256 |
6b5249107af3812384eb79c3e3ae5d76e333fd9251da8b5c6e717a1e15242ecd
|
File details
Details for the file screen_manager-0.1.0-py3-none-any.whl.
File metadata
- Download URL: screen_manager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37afb1dc4b6c603e9d4ca6b773441e151d5cad9e72ddf6aca063e813ae6ea5e5
|
|
| MD5 |
2fc1667a5d5c6c3c303afacc174ac92a
|
|
| BLAKE2b-256 |
8c1e32e5f3b947058cad746b2990177ec6ff02a1c85c9409598688d31ade53b6
|