Zellij MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Zellij MCP Serverlist my active sessions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Zellij MCP Server
A comprehensive Model Context Protocol (MCP) server for managing Zellij terminal workspace sessions. This server provides extensive tools for session management, pane operations, tab controls, plugin integration, layout management, and advanced LLM completion detection.
Features
🏗️ Session Management
Complete session lifecycle management with advanced operations:
Basic Operations: List, create, attach, kill, delete sessions
Advanced Operations: Clone, rename, switch, export/import session configurations
Session Information: Detailed session info and health monitoring
🔧 Pane Management
Comprehensive pane control with advanced positioning:
Basic Operations: Create, close, focus, resize, swap panes
Advanced Features: Stack panes, floating pane controls, fullscreen toggle
Content Operations: Clear, dump screen, edit scrollback, scroll controls
Positioning: Precise floating coordinate control
📑 Tab Management
Full tab lifecycle with navigation and organization:
Tab Operations: Create, close, rename, move tabs
Navigation: Go to tab by index/name, next/previous navigation
Advanced Features: Query tab names, synchronized input across panes
🔌 Plugin Management
Comprehensive plugin ecosystem integration:
Plugin Lifecycle: Launch, focus, start/reload plugins
Advanced Options: Floating, in-place, skip cache configurations
Plugin Information: List aliases, running plugins, plugin info
Configuration: Full plugin configuration support
📐 Layout Management
Complete layout system with validation:
Layout Operations: Dump, save, apply, load layouts
Advanced Features: New tab with layout, layout validation
Layout Discovery: List available layouts with custom directory support
🔄 Piping System
Advanced inter-plugin communication:
Basic Piping: Send data to plugins, broadcast to all plugins
Advanced Piping: Response capture, file-based piping
Action Piping: Force launch, skip cache, floating options
Plugin Targeting: Specific plugin URL targeting
🤖 LLM Completion Detection
Specialized tools for LLM workflow integration:
Process Monitoring: Watch pipes, poll processes, file watching
Timeout Management: Automatic timeout completion
Wrapper Scripts: LLM completion detector wrappers
Resource Cleanup: Automated cleanup of detection resources
🛡️ Security & Performance
Enterprise-grade security and performance features:
Input Validation: Comprehensive input sanitization and validation
Rate Limiting: Configurable rate limiting per tool
Caching: Intelligent caching with statistics
Health Monitoring: System health checks and diagnostics
Related MCP server: Post-Exploitation tmux MCP Server
Installation
Prerequisites
Node.js 18 or higher
Zellij installed and available in PATH
Active terminal environment
Setup
# Clone the repository
git clone https://github.com/yourusername/zellij-mcp-server.git
cd zellij-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Make the script executable
chmod +x dist/index.jsUsage
With Claude Desktop
Add this to your Claude Desktop configuration file:
{
"mcpServers": {
"zellij": {
"command": "node",
"args": ["/path/to/zellij-mcp-server/dist/index.js"]
}
}
}Direct Usage
# Start the MCP server
npm start
# Development mode with watching
npm run devTool Categories
Session Management Tools
Tool | Description |
| List all active Zellij sessions with caching |
| Create a new session with optional layout |
| Attach to an existing session |
| Kill a specific session |
| Delete a specific session |
| Get detailed session information |
| Export session configuration to JSON |
| Import session from JSON export |
| Clone an existing session |
| Rename a session |
| Switch to a different session |
Pane Management Tools
Tool | Description |
| Create a new pane with advanced options |
| Close the currently focused pane |
| Focus pane in specific direction |
| Resize the focused pane |
| Move/swap pane in specified direction |
| Stack multiple panes by their IDs |
| Toggle floating panes visibility |
| Toggle fullscreen mode for focused pane |
| Pin/unpin floating pane |
| Clear the focused pane buffer |
| Dump pane screen content to file |
| Edit pane scrollback in default editor |
| Rename the focused pane |
| Scroll in focused pane |
| Execute command in current pane |
| Write text to current pane |
| Get current pane layout information |
Tab Management Tools
Tool | Description |
| Create a new tab |
| Close the current tab |
| Rename the current tab |
| Go to tab by index |
| Go to tab by name |
| Move tab left or right |
| Get all tab names in current session |
| Toggle synchronized input across panes |
| Switch to next tab |
| Switch to previous tab |
Plugin Management Tools
Tool | Description |
| Launch a plugin with full configuration |
| Launch plugin using action command |
| Smart plugin activation |
| Start or reload a plugin |
| List available plugin aliases |
| Get information about a plugin |
| List currently running plugins |
Layout Management Tools
Tool | Description |
| Dump current layout to stdout or file |
| Save current layout to layouts directory |
| Apply a layout to current or new session |
| List available layouts |
| Load and display layout content |
| Create new tab with specific layout |
| Validate layout file syntax |
Piping System Tools
Tool | Description |
| Send data to plugins via pipe with advanced options |
| Send data to a specific plugin |
| Broadcast data to all listening plugins |
| Advanced piping with action-level options |
| Send data and capture plugin response |
| Pipe file content to plugins |
LLM Detection Tools
Tool | Description |
| Watch a pipe for specific patterns with timeout |
| Create a named pipe for bidirectional communication |
| Pipe command output with automatic timeout |
| Poll process status by PID |
| Watch file for changes with pattern matching |
| Create LLM completion detector wrapper script |
| Clean up detection resources |
System Tools
Tool | Description |
| Run command in new pane |
| Edit file in new Zellij pane |
| Switch input mode for all connected clients |
| Kill all active sessions |
| Delete all sessions |
| Clear MCP server cache |
| Get cache statistics |
| Perform system health check |
Example Usage
Creating a Development Session
{
"name": "zellij_new_session",
"arguments": {
"session_name": "development",
"layout": "dev-layout"
}
}Running Commands in Panes
{
"name": "zellij_run_command",
"arguments": {
"command": "npm run dev",
"direction": "right"
}
}Plugin Management
{
"name": "zellij_launch_plugin",
"arguments": {
"plugin_url": "file:~/.config/zellij/plugins/filepicker.wasm",
"floating": true,
"width": "50%",
"height": "50%"
}
}Layout Operations
{
"name": "zellij_save_layout",
"arguments": {
"layout_name": "my-dev-setup"
}
}LLM Integration
Creating LLM Wrapper Scripts
The zellij_create_llm_wrapper tool generates intelligent wrapper scripts that provide robust completion detection for any LLM command:
{
"name": "zellij_create_llm_wrapper",
"arguments": {
"wrapper_name": "claude-wrapper",
"llm_command": "claude chat",
"detect_marker": "<<<COMPLETE>>>",
"timeout_ms": 60000
}
}What the wrapper provides:
Multi-signal detection: Exit codes, completion markers, and status files
Automatic timeout handling: Configurable timeout with graceful cleanup
Process monitoring: Real-time status tracking and logging
Signal handling: Proper cleanup on interruption (SIGINT, SIGTERM)
Timestamped logging: Detailed execution logs for debugging
Generated files:
/tmp/llm-wrapper-{name}.sh- The executable wrapper script/tmp/llm-status-{name}- Real-time status file with timestamps/tmp/llm-output-{name}-{pid}- Captured output (temporary)
Usage example:
# After creating the wrapper, use it like:
/tmp/llm-wrapper-claude-wrapper.sh "Explain quantum computing"
# Monitor status in real-time:
tail -f /tmp/llm-status-claude-wrapper
# The wrapper handles timeouts, signals, and cleanup automaticallyStatus tracking:
running- LLM query is in progresscomplete:0- Successfully completedtimeout- Query timed outerror:N- Failed with exit code N
Architecture
Security Features
Input Validation: All inputs are validated and sanitized
Rate Limiting: Per-tool rate limiting (50 requests per minute)
Path Traversal Protection: File path validation prevents directory traversal
Command Injection Prevention: Command sanitization and validation
Performance Features
Intelligent Caching: Session lists and other data are cached
Async Operations: All operations are asynchronous
Error Handling: Comprehensive error handling with specific error types
Resource Cleanup: Automatic cleanup of temporary resources
Error Handling
The server includes comprehensive error handling with specific error types:
ValidationError: Input validation failuresSecurityError: Security-related errors (rate limiting, etc.)ZellijError: Zellij-specific command failures
Development
Project Structure
src/
├── index.ts # Main MCP server implementation
├── tools/ # Tool modules
│ ├── detection.ts # LLM completion detection tools
│ ├── layouts.ts # Layout management tools
│ ├── panes.ts # Pane management tools
│ ├── piping.ts # Piping system tools
│ ├── plugins.ts # Plugin management tools
│ └── sessions.ts # Session management tools
├── types/
│ └── zellij.ts # TypeScript type definitions
└── utils/
├── cache.ts # Caching utilities
├── command.ts # Command execution utilities
└── validator.ts # Input validation utilitiesBuilding
# Development build with watching
npm run dev
# Production build
npm run build
# Start the built server
npm startTesting
Run ./test-workflow.sh to validate the detection system functionality.
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some 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
Zellij - The amazing terminal workspace manager
Model Context Protocol - The protocol this server implements
Claude Code - Integration with Claude AI
Support
For issues, questions, or contributions, please visit the GitHub repository.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GitJuhb/zellij-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server