Skip to content

feat: add tmux MCP tools for LLM communication#265

Merged
ck3mp3r merged 4 commits intomainfrom
feature/tmux-mcp-tools
Oct 5, 2025
Merged

feat: add tmux MCP tools for LLM communication#265
ck3mp3r merged 4 commits intomainfrom
feature/tmux-mcp-tools

Conversation

@ck3mp3r
Copy link
Owner

@ck3mp3r ck3mp3r commented Oct 5, 2025

Summary

  • Add tmux MCP tools that allow LLMs to communicate with and execute commands in tmux sessions
  • Nix package for easy installation
  • Documentation with usage examples

Changes

  • tmux.nu: Helpful MCP tools for LLM-tmux interaction

    • List sessions, windows, and panes in tabular format
    • Send commands to specific panes
    • Capture pane content for analysis
    • Find panes by name or context (e.g., "docs", "build")
    • Get process information from panes
  • Nix package: mcp-tools derivation for easy installation

    • Installs to share/nushell/mcp-tools/tmux/
    • Version synced with Cargo.toml
  • Documentation: Concise README with installation and usage

    • Installation instructions for Nix and manual setup
    • Configuration examples for nu-mcp integration

Features

  • Tabular data hints in tool descriptions for proper LLM display
  • Context-aware pane finding for intuitive usage
  • Command logging following k8s-tools pattern
  • Structured output for informational commands, raw text for content

Scope

These are utility tools for LLM communication with tmux, not a full tmux session manager. The tools provide essential commands for:

  • Discovering what's running in a tmux session
  • Sending commands to specific panes
  • Retrieving output for analysis
  • Finding panes by contextual information

Test plan

  • Verify tmux.nu implements all MCP tools correctly
  • Test tabular data output formatting
  • Confirm command logging follows k8s pattern consistently
  • Validate Nix derivation builds and installs to correct path
  • Test context-based pane finding functionality

Add comprehensive tmux session management and interrogation tools:

- tmux.nu: Full-featured tmux MCP tool with 8 different capabilities
  - Session listing with nested window/pane structure
  - Command execution to specific panes
  - Content capture from panes
  - Smart pane finding by name or context
  - Detailed session information with expandable tables
  - Process information retrieval
  - Context-aware pane resolution (e.g., "docs pane", "build pane")

- Nix package: mcp-tools derivation for easy installation
  - Installs to share/nushell/mcp-tools/tmux/
  - Version synced with Cargo.toml

- Documentation: Comprehensive README with usage examples
  - Installation instructions for Nix and manual setup
  - Configuration examples for nu-mcp integration
  - Security considerations and practical examples

Features:
- Command logging following k8s-tools pattern
- Robust error handling with helpful suggestions
- Nested table output with --expand support
- Context-based pane finding for intuitive usage
- Reduce README from 150+ to 70 lines by removing verbose explanations
- Remove JavaScript examples (this is Nushell!)
- Fix YAML args format to use proper list syntax
- Focus on essential information: what's available, how to install, how to use
- Remove shebang to standardize script mode
- Change argument list syntax from comma-separated to space-separated for all function definitions
- Update required argument arrays to use space separation for consistency
- Refactor formatting in match blocks and table generation for improved readability
- Consolidate multi-line pipelines into single lines where appropriate
- Standardize whitespace and indentation throughout code for clarity
- Replace string-based output in session, pane, and process listing functions with tabular data structures
- Aggregate session, window, and pane details into unified item lists for table rendering
- Update pane search functions to return selected fields in table format for multiple matches
- Refactor process information output to emit a single-row table with detailed fields
- Remove legacy string formatting and output accumulation logic in favor of direct data mapping
@ck3mp3r ck3mp3r changed the title feat: add tmux MCP tools for session management feat: add tmux MCP tools for LLM communication Oct 5, 2025
@ck3mp3r ck3mp3r merged commit f6a9a13 into main Oct 5, 2025
1 check passed
@ck3mp3r ck3mp3r deleted the feature/tmux-mcp-tools branch October 5, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant