Includes installation scripts and configuration options for Google-based MCP clients to enable console automation functionality
Enables automated interaction with MySQL command-line interface, allowing for automated database operations and SQL command execution through console automation
Allows automated interaction with npm commands and development server monitoring, including the ability to run and monitor npm scripts like development servers
Provides installation scripts and configuration support for OpenAI-based MCP clients to integrate console automation tools
Enables automated test execution and monitoring, with built-in error detection for test failures and comprehensive test result analysis
Provides automated interaction with Python interpreters and debugging sessions, including support for running Python scripts and interactive debugging with pdb
Planned integration for terminal multiplexing support, enabling advanced session management and terminal sharing capabilities
MCP Console Automation Server
Production-Ready Model Context Protocol (MCP) server that enables AI assistants to fully interact with console applications, monitor output, detect errors, and automate terminal workflows - similar to how Playwright works for web browsers.
Production Status ✅
This server is fully production-ready with:
- ✅ No native compilation required (removed node-pty dependency)
- ✅ Full cross-platform support (Windows, macOS, Linux)
- ✅ Streaming support for long-running processes
- ✅ Multiple console type support (cmd, PowerShell, bash, zsh, sh)
- ✅ Resource management and automatic cleanup
- ✅ Comprehensive error handling and recovery
- ✅ Easy installation scripts for all major MCP clients
- ✅ All tests passing (see test-functionality.js)
Features
- Full Terminal Control: Create and manage multiple console sessions simultaneously
- Interactive Input: Send text input and special key sequences (Enter, Tab, Ctrl+C, etc.)
- Real-time Output Monitoring: Capture and analyze console output as it happens
- Streaming Support: Efficient streaming for long-running processes
- Multiple Console Types: Support for cmd, PowerShell, bash, zsh, sh
- Automatic Error Detection: Built-in patterns to detect errors, exceptions, and stack traces
- Session Management: Create, stop, and manage up to 50 concurrent sessions
- Resource Management: Memory monitoring, automatic cleanup, session limits
- Command Execution: Run commands and wait for completion with timeout support
- Pattern Matching: Wait for specific output patterns before continuing
- Cross-platform: Works on Windows, macOS, and Linux without native dependencies
Quick Installation
Windows (PowerShell as Administrator)
macOS/Linux
Manual Installation
Configuration
For Claude Desktop
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
For other MCP clients
Available Tools (12 Total)
console_create_session
Create a new console session for running commands.
Parameters:
command
(required): The command to executeargs
: Array of command argumentscwd
: Working directoryenv
: Environment variables objectdetectErrors
: Enable automatic error detection (default: true)timeout
: Session timeout in milliseconds
Example:
console_send_input
Send text input to an active console session.
Parameters:
sessionId
(required): Session IDinput
(required): Text to send
console_send_key
Send special key sequences to a console session.
Parameters:
sessionId
(required): Session IDkey
(required): Key to send (enter, tab, up, down, ctrl+c, escape, etc.)
console_get_output
Retrieve output from a console session.
Parameters:
sessionId
(required): Session IDlimit
: Maximum number of output lines to return
console_wait_for_output
Wait for specific output pattern in console.
Parameters:
sessionId
(required): Session IDpattern
(required): Regex pattern to wait fortimeout
: Timeout in milliseconds (default: 5000)
console_execute_command
Execute a command and wait for completion.
Parameters:
command
(required): Command to executeargs
: Command argumentscwd
: Working directoryenv
: Environment variablestimeout
: Execution timeout
console_detect_errors
Analyze console output for errors and exceptions.
Parameters:
sessionId
: Session ID to analyzetext
: Direct text to analyze (if not using session)
console_stop_session
Stop an active console session.
Parameters:
sessionId
(required): Session ID to stop
console_list_sessions
List all active console sessions.
console_resize_session
Resize terminal dimensions for a session.
Parameters:
sessionId
(required): Session IDcols
(required): Number of columnsrows
(required): Number of rows
console_clear_output
Clear the output buffer for a session.
Parameters:
sessionId
(required): Session ID
Use Cases
1. Running and monitoring a development server
2. Interactive debugging session
3. Automated testing with error detection
4. Interactive CLI tool automation
Error Detection Patterns
The server includes built-in patterns for detecting common error types:
- Generic errors (error:, ERROR:, Error:)
- Exceptions (Exception:, exception)
- Warnings (Warning:, WARNING:)
- Fatal errors
- Failed operations
- Permission/access denied
- Timeouts
- Stack traces (Python, Java, Node.js)
- Compilation errors
- Syntax errors
- Memory errors
- Connection errors
Development
Building from source
Running in development mode
Running tests
Type checking
Linting
Architecture
The server is built with:
- node-pty: For creating and managing pseudo-terminals
- @modelcontextprotocol/sdk: MCP protocol implementation
- TypeScript: For type safety and better developer experience
- Winston: For structured logging
Core Components
- ConsoleManager: Manages terminal sessions, input/output, and lifecycle
- ErrorDetector: Analyzes output for errors and exceptions
- MCP Server: Exposes console functionality through MCP tools
- Session Management: Handles multiple concurrent console sessions
Requirements
- Node.js >= 18.0.0
- Windows, macOS, or Linux operating system
- No additional build tools required!
Testing
Run the included test suite to verify functionality:
Troubleshooting
Common Issues
- Permission denied errors: Ensure the server has permission to spawn processes
- node-pty compilation errors: Install build tools for your platform
- Session not responding: Check if the command requires TTY interaction
- Output not captured: Some applications may write directly to terminal, bypassing stdout
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
MIT License - see LICENSE file for details
Support
For issues, questions, or suggestions, please open an issue on GitHub: https://github.com/yourusername/mcp-console-automation/issues
Roadmap
- Add support for terminal recording and playback
- Implement session persistence and recovery
- Add more error detection patterns for specific languages
- Support for terminal multiplexing (tmux/screen integration)
- Web-based terminal viewer
- Session sharing and collaboration features
- Performance profiling tools
- Integration with popular CI/CD systems
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables AI assistants to fully interact with console applications, monitor output, detect errors, and automate terminal workflows across multiple sessions. Similar to how Playwright works for web browsers but for command-line interfaces.
Related MCP Servers
- -securityAlicense-qualityProvides code manipulation, execution, and version control capabilities. It allows AI assistants to read, write, and execute code while maintaining a history of changes.Last updated -9MIT License
- -securityFlicense-qualityEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Last updated -
- -securityFlicense-qualityA server that enables AI assistants to control a browser through tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Last updated -
- -securityFlicense-qualityEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Last updated -