The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Terminal History MCP listing page.
Search your shell history (zsh / bash / fish) from Claude Code, Cline, Cursor, Zed, or any MCP client. Local-only. SQLite FTS5. Secret-redacted before storage.

/etc/nginx?"kubectl apply."(Or run from a clone: git clone … && npm install && npm run build && npm link.)
Anywhere that takes a stdio MCP server config:
Use this MCP server instantly with no local installation:
Or connect at: https://mcpize.com/mcp/terminal-history
By default zsh/bash history files store only the command. To unlock recent_in_dir and failed_commands, install the shell hook:
The hook appends pipe-delimited lines to ~/.terminal-history-mcp/extended.log. Reindex picks them up.
To inspect the snippet first:
To remove:
| Tool | What it does |
|---|---|
search_history(query, limit) | FTS5 keyword + prefix match across all history |
recent_in_dir(cwd, limit) | Last N commands in a working dir (needs hook) |
failed_commands(since_ts_ms, limit) | Commands with non-zero exit (needs hook) |
command_chains(query, window_ms, limit) | For each match, list commands within ±5 min |
reindex | Re-parse history files + extended log |
Everything is local. The DB lives at ~/.terminal-history-mcp/history.db. Nothing is uploaded.
Secrets are scrubbed before insert. Detected patterns:
ghp_*, gho_*, …)sk-*)xox[baprs]-*)AKIA…)Authorization: Bearer/Basic <value>X-*-Token: …, X-*-Key: …, X-*-Secret: … headersTOKEN / KEY / SECRET / PASSWORD / API_KEY--token=…, --api-key …, -k …https://user:pass@hosteyJ.*.*)If you find a leak, please open an issue. To wipe and re-index after upgrading patterns:
MIT — see LICENSE.