terminal-history-mcp

Terminal History MCP Server

terminal-history-mcp lets developers and AI coding agents search local shell history through MCP clients such as Claude Code, Cursor, Cline, and Zed. Its tools retrieve past commands, directory activity, failures, and surrounding command sequences.

Server facts

terminal-history-mcp

Project

License
Not specified

Tech

Runtime / language
Not specified
Transports
stdio
Remote available
No
Authentication
Not specified

Activity

GitHub stars
5
Last commit
Data as of

Tags

  • Local First
  • Shell
  • Sqlite
  • Terminal
  • bash
  • cli
  • developer tools
  • fish
  • fts5
  • history
  • mcp
  • memory
  • privacy
  • search
  • zsh

Overview

Shell history becomes searchable context for coding assistants with terminal-history-mcp, which indexes commands from zsh, bash, and fish in SQLite FTS5. The search_history tool accepts keywords and prefixes, returning recent matches with timestamps and available shell, directory, and exit information. For reconstructing a workflow rather than locating one command, command_chains gathers nearby commands around matching entries in chronological order. The reindex tool refreshes the index from history files and the extended hook log, skipping entries already recorded through hash-based deduplication.

An optional shell hook records working directories, exit codes, and durations. That captured metadata supports recent_in_dir for revisiting activity in a particular project and failed_commands for finding commands with unsuccessful exits, optionally after a specified timestamp. Older history entries without directory or exit metadata do not appear in those respective views. Processing stays on the local machine, with secrets redacted before database insertion. Developers can connect through stdio from an MCP client to recall previous terminal work without manually searching history files.

terminal-history-mcp setup notes

  • terminal-history-mcp records stdio only; confirm a network transport upstream before planning remote access.
  • terminal-history-mcp has no recorded license; confirm reuse terms in its repository.

Related MCP servers