
Terminal History MCP
Developers: Search your zsh, bash, or fish shell history from Claude Code, Cline, Cursor, Zed, or any MCP client using tools like search_history (full-text with timestamp/CWD/exit code), recent_in_dir, failed_commands, and command_chains for multi-step sequences. Reindex after new activity. Local-only SQLite FTS5 with secrets redacted before storage.
Overview
The Terminal History MCP server indexes your local shell history from zsh, bash, or fish, enabling full-text searches directly from MCP clients like Claude Code, Cline, Cursor, or Zed. It uses SQLite FTS5 for fast queries and redacts secrets before storage to protect sensitive data. This keeps all operations local, letting you retrieve past commands without switching contexts.
Key Capabilities
Use reindex to re-parse ~/.zsh_history and ~/.bash_history into the local index after new shell activity. Run search_history for full-text searches across history, returning matching commands with timestamps, working directories, and exit codes. Access recent_in_dir for commands run in a specific directory, failed_commands for recent non-zero exit code entries, and command_chains to find multi-step sequences within ±5 minutes of a query match.
Use Cases
Debug a shell error by querying failed_commands to review recent failed invocations with their exact arguments and exit codes. Reconstruct a deployment workflow using command_chains on a "deploy" search to see preceding cd, build, and test steps. Locate a one-off data processing script with recent_in_dir targeted at your analysis folder. Quickly reuse a complex git sequence via search_history filtered by timestamp or keywords.
Who This Is For
CLI-heavy developers and DevOps engineers who maintain extensive shell histories across zsh, bash, or fish. Users of MCP clients like Claude Code or Cursor with intermediate shell proficiency. Those needing to audit, reuse, or debug terminal commands without manual history scrolling.