Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI → MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE ↗ (opens in a new tab)
  • llms.txt ↗ (opens in a new tab)
  • Catalog JSON ↗ (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub ↗ (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. 🖥️ Command Line
  3. Terminal History MCP
Terminal History MCP logo
Health: ActiveRecent health check succeeded.Last checked 9/9/2026, 7:01:52 PM

Terminal History MCP

User RatingsBe the first to rate and review this MCP server!
View Repository4 GitHub StarsTotal stargazers on GitHub for the source repository (4 stars).Visit Website
shell-historycommand-linesqlitesearchdeveloper-tools

Search local zsh, bash, and fish history with SQLite FTS5, metadata capture, and pre-insert secret redaction.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.

Add to CursorAdd to VS Code
Automated check passed— started and listed 5 tools correctly (1mo ago).
Manual Client & Custom JSON ConfigExpand JSON ▾

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "hasanjahidul-terminal-history-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcpize"
      ]
    }
  }
}

💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Tool Schemas (5) Directory Badge Claim listing Alternatives🖥️ More in Command Line

Overview

This local-only MCP server indexes shell history from zsh, bash, and fish in a SQLite FTS5 database. It supports full-text search, recent commands by directory, failed-command lookup, command-chain inspection, and reindexing. An optional shell hook captures working directory, exit code, and duration.

Use cases

•Search past shell commands by keyword or prefix
•Find recent commands run in a specific directory
•Review commands that exited unsuccessfully
•Inspect commands run around a matched command
•Reindex history files after adding or changing history data

Key features

•SQLite FTS5 full-text and prefix search
•Support for zsh, bash, and fish history
•Pre-insert redaction for 11 secret patterns
•Optional cwd, exit code, and duration capture
•Local database stored at ~/.terminal-history-mcp/history.db
•History and extended-log reindexing

Capabilities & Tool Schemas (5) ~840 tokensApproximate context cost of this server’s tool schemas (~4 chars/token), before any tool is called. Actual usage depends on your client and model.Verified live Verified liveCaptured by calling this server’s live tools/list endpoint.

Inspect callable tools, capabilities, and parameters exposed to AI agents by Terminal History MCP.

reindex

Re-parses the local shell history files (`~/.zsh_history`, `~/.bash_history`) and the hook's extended log into the SQLite index. Idempotent — already-indexed commands are skipped by hash, so it is safe to call repeatedly. Run it after a burst of shell activity to make recent commands searchable. Reads only local files; writes only to `~/.terminal-history-mcp/`. Takes no arguments. Returns counts of parsed / inserted / skipped entries.

search_history

Read-only. Full-text search (SQLite FTS5, stemmed, Unicode-aware) over all indexed shell commands. Supports keyword and prefix queries — e.g. `docker build`, `git reb*`. Returns the most recent matches first, each with timestamp, shell, cwd, and exit code when available. Local index only; nothing is sent anywhere. If a query returns nothing you may need `reindex` first.

recent_in_dir

Read-only. Lists the most recent commands that were run with a given working directory — answers "what was I doing in this project?". Requires the shell hook to have been installed (legacy entries have no cwd and won't appear). Returns newest first with timestamps and exit codes. Local index only.

failed_commands

Read-only. Lists recent commands that exited non-zero — a quick "what just broke?" feed. Optionally restrict to commands after a given epoch-millisecond timestamp. Requires the shell hook for exit-code capture (legacy entries have no exit code). Newest first. Local index only.

command_chains

Read-only. For each command matching `query`, returns the commands run within a time window around it (default ±5 min) — surfacing multi-step sequences like `cd → npm run build → deploy`. Useful for reconstructing "how did I do X last time?". Returns up to `limit` chains, each a time-ordered list of command rows. Local index only.

Documentation Overview

terminal-history-mcp logo

terminal-history-mcp

MCPize mcp.so terminal-history-mcp MCP server CI npm version License: MIT

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.

demo

What you can ask

  • "When did I last ssh into the staging server?"
  • "Show recent failed commands."
  • "What did I run yesterday in /etc/nginx?"
  • "What's that long docker compose flag I used 3 weeks ago?"
  • "Show command chains around kubectl apply."

Install

Terminal
npm install -g terminal-history-mcp
terminal-history-mcp index           # one-time backfill from existing history

(Or run from a clone: git clone … && npm install && npm run build && npm link.)

Wire to Claude Code

Terminal
claude mcp add --scope user terminal-history -- terminal-history-mcp
claude mcp list

Wire to other MCP clients

Anywhere that takes a stdio MCP server config:

config.json
{
  "mcpServers": {
    "terminal-history": {
      "command": "terminal-history-mcp"
    }
  }
}

Connect via MCPize

Use this MCP server instantly with no local installation:

Terminal
npx -y mcpize connect @HasanJahidul/terminal-history --client claude

Or connect at: https://mcpize.com/mcp/terminal-history

Capture cwd + exit code (recommended)

By default zsh/bash history files store only the command. To unlock recent_in_dir and failed_commands, install the shell hook:

bash
terminal-history-mcp install-hook zsh    # or bash, or fish
exec $SHELL                              # reload

The hook appends pipe-delimited lines to ~/.terminal-history-mcp/extended.log. Reindex picks them up.

To inspect the snippet first:

bash
terminal-history-mcp print-hook zsh

To remove:

bash
terminal-history-mcp uninstall-hook zsh

Tools

ToolWhat 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
reindexRe-parse history files + extended log

Privacy

Everything is local. The DB lives at ~/.terminal-history-mcp/history.db. Nothing is uploaded.

Secrets are scrubbed before insert. Detected patterns:

  • GitHub PATs (ghp_*, gho_*, …)
  • OpenAI keys (sk-*)
  • Slack tokens (xox[baprs]-*)
  • AWS access keys (AKIA…)
  • Authorization: Bearer/Basic <value>
  • X-*-Token: …, X-*-Key: …, X-*-Secret: … headers
  • Env vars containing TOKEN / KEY / SECRET / PASSWORD / API_KEY
  • CLI flags --token=…, --api-key …, -k …
  • URL basic-auth https://user:pass@host
  • JWTs (eyJ.*.*)

If you find a leak, please open an issue. To wipe and re-index after upgrading patterns:

bash
rm ~/.terminal-history-mcp/history.db*
terminal-history-mcp index

Development

bash
git clone https://github.com/hasanjahidul/terminal-history-mcp
cd terminal-history-mcp
npm install
npm run build
npm test

License

MIT — see LICENSE.

Read the full README →View source on GitHub →

Related MCP Servers

View all in Command Line View all alternatives
  • Backscroll logoBackscroll

    Answers "what did that command print?" from your real terminal history: a per-command PTY session recorder (OSC 133) stores every command's full output, exit code, cwd, and duration in local SQLite/FTS5, and the MCP server searches, retrieves, and diffs those outputs — secret redaction on by default before anything reaches the model.

    🖥️ Command Line2 views
    Compare vs Backscroll →
  • Sage logoSage

    Local-first CLI and MCP wrapper for AI coding agents. Routes shell commands through sage run --, stores command history locally, and returns compressed terminal output to reduce context noise.

    🖥️ Command Line5 views
    Compare vs Sage →
  • Hop logoHop

    Fast SSH connection manager with TUI dashboard and MCP server for discovering, searching, and executing commands on remote hosts.

    🖥️ Command Line4 views
    Compare vs Hop →
  • MCP Ssh Manager logoMCP Ssh Manager

    Manage multiple SSH servers from one MCP: command execution, file transfer/rsync, database dump/import/query (MySQL/PostgreSQL/MongoDB), backups & restore, health monitoring, persistent sessions, tunnels, ProxyJump/bastion, and opt-in per-server security modes (readonly/restricted) with audit log. Linux, macOS & Windows OpenSSH.

    🖥️ Command Line7 views
    Compare vs MCP Ssh Manager →

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars
4
Stargazers on the source repository.
npm downloads
447
Package downloads in the last 30 days.
Last commit
4mo ago
Most recent push to the default branch.
Availability
100%
Our rolling endpoint + install checks that succeeded.
Install check
Passed
Our sandbox started it and listed its tools.
Tools exposed
5
Callable tools this server registers over MCP.
Directory activity
1 views
Config copies, upvotes, and views on AllMCPs.

Reviews

No reviews yet — be the first to share how this listing worked for you.

Frequently Asked Questions about Terminal History MCP

No. The server is local-only, and its database is stored at ~/.terminal-history-mcp/history.db.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTerminal History MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/hasanjahidul-terminal-history-mcp?style=directory)](https://allmcps.com/mcp/hasanjahidul-terminal-history-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/hasanjahidul-terminal-history-mcp"><img src="https://allmcps.com/api/badge/hasanjahidul-terminal-history-mcp?style=directory" alt="Terminal History MCP on AllMCPs" /></a>

Technical Specs & Signals

Category🖥️Command Line
PricingFree
More technical detailsExpand ▾
TransportSTDIO
RuntimeNode.js
AuthNo auth required
LicenseMIT
ClientsCursor, Cline / VS Code
Last updatedAug 9, 2026
11/11 checks healthy over the last 33d
Views1
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars4
GitHub Star CountTotal stargazers on GitHub representing community popularity (4 stars).
Last commit4mo ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on May 11, 2026
npm downloads447/mo
Monthly npm DownloadsAverage monthly package installs recorded from npm registry statistics.
70Quality signal: Great · 70/100How this signal is calculated ▾
Server availability25/25
Verified ownership10/20
Documentation & tools30/30
Adoption & activity5/15
Community engagement0/10

A guidance signal from public completeness & health data — not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 27d ago via OSV.dev · mcpize (npm)

★ FeaturedAllMCPs Server logo

AllMCPs Server

The official MCP server for AllMCPs.com - submit and manage tools directly from your AI. The open directory for MCP servers. Connect Claude, Cursor, Windsurf, and AI agents to databases, tools, files, and APIs. Explore 10,000+ servers. AllMCPs is the premier, open directory for discovering, evaluating, and installing Model Context Protocol (MCP) servers to equip AI agents and LLMs with real-world superpowers.

Explore Server →

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge — proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it — no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in 🖥️ Command Line →Best MCP servers for Command Line & Terminal →Alternatives to Terminal History MCP →Install in Claude DesktopInstall in CursorInstall in VS Code