Labsco
M-Pineapple logo

Claude Command Runner

β˜… 17

from M-Pineapple

MCP server for Warp Terminal. Drives Claude commands into your active Warp tab via warp:// deeplinks and OSC 777 events. Works from Claude Desktop or Warp's native agent panel. macOS, Swift.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

Claude Command Runner

Claude Command Runner β€” terminal prompt, Warp glyph, Claude asterisk

Lets Claude actually use your terminal. You ask, Claude types the command into your Warp tab, captures the output, and tells you what happened. It's a Model Context Protocol (MCP) server with 40 tools β€” command execution, project setups, file watching, SSH, clipboard, environment intelligence β€” and the same binary works from both Claude Desktop and Warp's built-in AI agent panel. macOS, Swift, open source.

Built for Warp Terminal (free, open source AGPL-3.0). The 5 most powerful tools route commands visibly into your active Warp tab β€” that's the magic of this MCP. If you don't use Warp yet, grab it here β€” it pairs with this MCP for what's probably the closest thing to "Claude with a real terminal" you can get right now.

πŸš€ What's New in v6.0.0 β€” Warp re-pivot

Triggered by Warp going open source under AGPL-3.0 (github.com/warpdotdev/warp) in May 2026. v6.0 re-establishes Warp as the primary integration target and adds a new install path: Warp's native agent panel.

  • Dual-consumer architecture: register claude-command-runner in ~/.warp/.mcp.json and Warp's built-in agent (which uses your configured LLM β€” Claude Sonnet, Opus, etc.) calls the same tools Claude Desktop calls. Same binary, same code, two consumers. See docs/WARP_AGENT.md.
  • Deeplinks replace AppleScript for tab/window operations: open_terminal_tab now uses warp://action/new_tab?path=.... No menu-clicking, no Accessibility permission for the open path.
  • OSC 777 emitter (emit_warp_event): build printf invocations that surface structured events into Warp's notification UI. Schema reimplemented from upstream event/v1.rs (no vendoring).
  • Workspace profiles β†’ Warp launch configs: save_workspace_profile accepts include_warp_launch_config: true to also write a YAML to ~/.warp/launch_configurations/, making the profile appear in Warp's launch UI.
  • Optional shell shim (Tier E, opt-in): helper/install-shim.sh adds zsh/bash hooks that emit preexec/command_finished events to a per-uid Unix socket the MCP listens on. Auto-disables outside Warp panes. Observability surface in v6.0; auto-routing execute_command through it is deferred to v6.0.x.
  • Cleanup: ~460 LOC of dead code removed (obsolete Warp DB integration, orphan TCP listener, unreachable background monitor). Tool count corrected: README claimed 30, reality was 36, v6.0 ships 39.
  • Reproducible build: swift-sdk pinned to 0.10.x with a deterministic scripts/patch-swift-sdk.sh so a fresh clone builds without manual patches.

Honest caveat: the "Claude" replying in Warp's agent panel is Warp's agent (running whichever LLM you configure in Warp's AI settings), not your Claude Desktop instance. Both can call the MCP; they don't share conversations. v6.0 does not bridge them.

What's New in v5.0.0 (history)

v5.0.0: 36 tools, up from 12.

  • Clipboard Bridge: Read from and write to the macOS clipboard without leaving the conversation
  • macOS Notifications: Get native notifications when long-running commands finish
  • Environment Intelligence: Probe your terminal context (git branch, active venv, Node version, Docker containers) in one call
  • Output Parsers: Structured JSON parsing for git status, docker ps, test results, and more
  • Environment Snapshots: Capture and diff environment variables before/after installs or config changes
  • Workspace Profiles: Save and restore project contexts (directory, env vars, common commands) per project
  • Multi-Terminal Sessions: Open, name, and send commands to multiple terminal tabs
  • Interactive Command Detection: Smart detection of interactive commands (vim, ssh, python REPL) with graceful handling
  • File System Watchers: Watch directories for changes and trigger commands automatically
  • SSH Remote Execution: Run commands on remote hosts via SSH key authentication

Previous Releases (Included)

  • v4.0: Command pipelines, output streaming, reusable templates
  • v3.0: Smart auto-retrieve, SQLite history, configurable security

Overview

Claude Command Runner is a dual-consumer MCP server β€” the same binary serves Claude Desktop and Warp's native agent panel. It enables an LLM (whichever you've configured in either client) to:

  • Execute terminal commands directly from conversations
  • Chain commands with conditional logic using pipelines
  • Stream output in real-time for long builds
  • Save and reuse command templates with variables
  • Automatically capture output with intelligent timing
  • Track command history and patterns
  • Read/write the macOS clipboard
  • Probe environment context (git, venv, Docker, Node)
  • Parse command output into structured JSON
  • Manage workspace profiles per project (with optional emission as Warp launch configs)
  • Open terminal tabs (via warp:// deeplinks; AppleScript fallback for non-Warp terminals) and send commands to the active tab
  • Watch files and trigger commands on changes
  • Execute commands on remote hosts via SSH
  • (v6.0) Surface tool-execution status to Warp's UI as OSC 777 warp://cli-agent events
  • (v6.0, opt-in) Stream clean preexec / command-finished events from your shell to the MCP via a per-uid Unix domain socket

🧭 Which Claude product does this work with?

claude-command-runner is an MCP server, so any Anthropic surface that consumes MCP servers can call its 40 tools β€” but the value-add varies sharply by consumer, and you should pick deliberately.

ConsumerWhere to registerValue-addRecommended?
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonHigh. execute_command types into your Warp tab so terminal action is visible alongside the chat. Chat stays focused on reasoning; the terminal becomes the work surface.βœ… Primary use case
Cowork (inside Claude Desktop)Same config as Claude DesktopHigh. Same model β€” your collaborators see the chat; commands run in your Warp pane.βœ… Yes
Warp's native agent panel~/.warp/.mcp.json (see docs/WARP_AGENT.md)High. Type into Warp's agent panel, agent calls our tools, output renders inline in Warp's chat. Same MCP, same code, second consumer.βœ… Yes β€” see WARP_AGENT.md
Claude Code (CLI)~/.claude.jsonMarginal β€” only if you want commands in a different Warp tab from the one Claude Code is in. Claude Code already runs inside a terminal pane (Warp or otherwise) and has its own built-in Bash tool that spawns subprocesses with pipes. For routine command execution Claude Code's built-in is shorter, faster, and doesn't need TCC permissions. The MCP is only worth registering if you want commands to land visibly in a separate Warp tab you control β€” e.g. as a "scratch" pane you can scroll through later.⚠️ Optional, niche
Other terminals (iTerm2, Terminal.app, Alacritty)Any of the aboveLow. Most of v6.0's value is Warp-specific: warp:// deeplinks, OSC 777 events, Warp agent integration, launch configs. The 24 server-side tools (clipboard, SSH, env snapshots, file watcher, etc.) work everywhere β€” but at that point you're using maybe two-thirds of the surface area.❌ Look elsewhere

Quick decision tree

  • You use Warp + Claude Desktop and want commands visible in your terminal? β†’ Register here. Primary use case.
  • You use Warp + Claude Code and want everything in one pane? β†’ Don't bother. Claude Code's built-in Bash tool is enough.
  • You use Warp + Claude Code and want commands in a separate observable Warp tab? β†’ Register and use execute_command deliberately.
  • You use Warp's native agent panel? β†’ Register in ~/.warp/.mcp.json.
  • You don't use Warp? β†’ This isn't the right MCP for you. Look at simpler subprocess-based MCPs.

The "40 tools" headline is honest but slightly misleading: 5 of those tools (the AppleScript-keystroke ones β€” execute_command, execute_with_auto_retrieve, execute_with_streaming, run_template, send_to_session) are the Warp-routing crown jewels, and 25 of them are pure server-side utilities that any subprocess-based MCP could provide. The remaining 10 sit in between (deeplinks, OSC 777, profiles, file watchers). If the Warp-routing 5 don't appeal, the rest of this MCP is fine but unremarkable.

🎯 Key Features

Command Pipelines

Chain multiple commands with intelligent failure handling:

{
  "steps": [
    {"name": "Build", "command": "swift build", "on_fail": "stop"},
    {"name": "Test", "command": "swift test", "on_fail": "continue"},
    {"name": "Package", "command": "swift build -c release", "on_fail": "stop"}
  ]
}

Failure modes:

  • stop – Halt pipeline on failure
  • continue – Log error and proceed to next step
  • warn – Show warning and continue

Output Streaming

Real-time output for long-running commands:

{
  "command": "swift build -c release",
  "update_interval": 3,
  "max_duration": 180
}

Perfect for:

  • Long compilation processes
  • Test suites
  • Any command that previously "hung" waiting for output

Command Templates

Save reusable patterns with variable substitution:

// Save a template
{
  "name": "swift-release",
  "template": "cd {{project}} && swift build -c release",
  "category": "Swift Development",
  "description": "Build Swift project in release mode"
}

// Run with variables
{
  "name": "swift-release",
  "variables": {"project": "~/GitHub/MyApp"}
}

Templates are stored in ~/.claude-command-runner/templates.json and persist across sessions.

Smart Auto-Retrieve

The execute_with_auto_retrieve command intelligently detects command types and adjusts wait times:

  • Quick commands (echo, pwd): 2-6 seconds
  • Moderate commands (git, npm): up to 20 seconds
  • Build commands (swift build, make): up to 77 seconds
  • Test commands: up to 40 seconds

πŸ“Š Why Warp Terminal?

Warp Terminal is the primary integration target. The other terminals work for the basics β€” what Warp uniquely unlocks in v6.0 is documented integration surfaces:

FeatureWarpTerminal.appiTerm2
warp:// deeplinks for tab/windowβœ… (v6.0 uses these)❌❌
Native MCP agent panel β€” chat with Claude in the terminalβœ… (~/.warp/.mcp.json)❌❌
OSC 777 cli-agent event channel for status surfacingβœ…βŒβŒ
Workspace profile β†’ recognized launch configβœ… (~/.warp/launch_configurations/)❌❌
AppleScript-driven new tab + keystroke sendβœ…βœ…βœ…
Modern UI/UXβœ…βš οΈβš οΈ

Output capture (/tmp/<id>.json polling) and the 24 tools that don't touch the terminal at all (clipboard, SSH, file watch, env snapshots, etc.) work identically across all terminals.

πŸ’‘ Get Warp: Download Warp Terminal – it's free, open source (AGPL-3.0), and makes the v6.0-specific surfaces above available to you.

πŸ€” Frequently Asked Questions

Q: What's new in v6.0.0?

A: Re-pivot to Warp after Warp went open source. Dual-consumer architecture (register the same binary in ~/.warp/.mcp.json to use it from Warp's native agent panel, in addition to Claude Desktop). warp:// deeplinks replace AppleScript menu-clicking for tab/window operations. New OSC 777 emitter (emit_warp_event) surfaces structured events into Warp's UI. New optional shell shim emits clean preexec/command-finished events to the MCP. Workspace profiles can now also emit Warp-native launch configs. ~460 LOC of dead code removed. Tool count goes from a previously-undercounted 36 (the v5 README claimed 30) up to 39. See CHANGELOG.md and docs/WARP_AGENT.md for the full story.

Q: What was new in v5.0.0?

A: Ten new feature categories bringing the tool count from 12 to 36 (the v5 README under-counted as 30; the dispatch table actually registered 36). Highlights: clipboard integration, macOS notifications, environment intelligence, structured output parsing, workspace profiles, multi-terminal sessions, file watchers, SSH remote execution.

Q: When should I use pipelines vs regular commands?

A: Use pipelines when you need:

  • Multiple sequential commands
  • Conditional logic (stop on build failure, continue on test failure)
  • A summary of all steps with timing
  • CI/CD-style workflows

Q: Why does my command "hang" with execute_with_auto_retrieve?

A: For very long commands, use execute_with_streaming instead. It provides real-time output updates and handles commands that run for minutes. This was the main motivation for adding streaming in v4.0.

Q: How do I use templates with multiple variables?

A: Define variables in your template with {{variable_name}} syntax:

{
  "template": "cd {{project}} && git checkout {{branch}} && swift build -c {{config}}"
}

Then provide all variables when running:

{
  "variables": {"project": "~/MyApp", "branch": "main", "config": "release"}
}

Q: Where are my templates stored?

A: In ~/.claude-command-runner/templates.json. They persist across sessions and Claude Desktop restarts.

Q: How long will auto-retrieve wait for my command?

A: It depends on the command type:

  • Simple commands: 6 seconds
  • Git/npm commands: 20 seconds
  • Build commands: 77 seconds
  • Unknown commands: 30 seconds

For longer commands, use execute_with_streaming instead.

Q: Can I use this with Terminal.app or iTerm2?

A: Yes, basic command execution works with any terminal. However, automatic output capture and advanced features require Warp Terminal. Get Warp free here.

Q: Is it secure to let Claude run commands?

A: Commands are sent directly to your terminal and execute automatically β€” there is no manual "press Enter" step. However, you can configure blocked commands and patterns in the config file to prevent dangerous operations. Always review the command Claude proposes before confirming in the chat interface.

Q: What happens if a pipeline step fails?

A: Depends on the on_fail setting:

  • stop – Pipeline halts immediately, remaining steps are skipped
  • continue – Error is logged, pipeline continues to next step
  • warn – Warning is shown, pipeline continues

Q: Can I nest pipelines or run templates inside pipelines?

A: Not directly. You can create templates that contain multiple commands separated by && or ;, or compose by calling run_template and execute_pipeline from the same conversation.

Q: Where is my command history stored?

A: In an SQLite database at ~/.claude-command-runner/claude_commands.db. It tracks all commands, outputs, exit codes, and execution times.

Architecture

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Claude Desktop  β”‚                     β”‚   Warp Agent     β”‚
  β”‚   (TS client)    β”‚                     β”‚  (rmcp client)   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ stdio                                  β”‚ stdio
           β”‚ MCP                                    β”‚ MCP
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   claude-command-runner v6.0    β”‚
              β”‚      (Swift, MCP server)        β”‚
              β”‚      β€’ 40 tools                 β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚         β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         └──────────────┐
              β–Ό                                  β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   Warp Terminal    β”‚          β”‚   Optional shell shim   β”‚
   β”‚  warp:// deeplinks │◀────────▢│ /tmp/ccr-shell-shim-    β”‚
   β”‚  OSC 777 events    β”‚          β”‚   <uid>.sock (NIO)      β”‚
   β”‚  AppleScript (typ) β”‚          β”‚   preexec/finished      β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚   Remote Hosts  β”‚
               β”‚    (via SSH)    β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Two MCP consumers, one server. Tab/window operations use Warp's warp:// URL scheme; status events use OSC 777 (printf-built); typing into a specific tab still uses AppleScript keystrokes (no Warp API exists for that). Optional shell shim adds clean preexec / command_finished events over a per-uid Unix socket.

πŸ’– Support This Project

If Claude Command Runner has helped enhance your development workflow or saved you time with intelligent command execution, consider supporting its development:

Your support helps me:

  • Maintain and improve Claude Command Runner with new features
  • Keep the project open-source and free for everyone
  • Dedicate more time to addressing user requests and bug fixes
  • Explore new terminal integrations and command intelligence

Thank you for considering supporting my work! πŸ™