MCPSERV.CLUB
rajpdus

MCP Command History Server

MCP Server

Access and search your shell history via MCP

Stale(50)
1stars
2views
Updated Mar 23, 2025

About

A lightweight server that exposes your shell command history over the MCP interface, allowing programmatic search, retrieval of recent commands, and integration with tools like Cursor.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

MCP Command History Overview

The MCP Command History server gives AI assistants instant, structured access to a user’s shell history. By exposing the command log as an MCP resource, developers can build intelligent tools that query past commands, surface frequently used patterns, or even suggest next steps based on historical context. This eliminates the need for custom shell scripts or manual file parsing, allowing assistants to treat command history as first‑class data.

At its core, the server reads the shell’s (or a fallback like ) and offers three primary MCP tools: , , and . Each tool translates natural language prompts into precise queries against the history dataset. For example, a user can ask for “my last ten commands” or request a search for “git commit,” and the assistant will return structured JSON containing command IDs, timestamps, and text. This capability is especially valuable for developers who rely on repetitive shell workflows; it turns a static history file into an interactive knowledge base.

Key features include:

  • Programmatic access to the entire command history, enabling deep analysis and custom filtering.
  • A text‑based search that supports simple keyword queries, making it easy to locate specific commands without scrolling through logs.
  • Retrieval of recent commands by limit, which is useful for quick reference or context‑aware suggestions.
  • Exposure of the data through both MCP tool calls and HTTP endpoints ( and ), allowing integration with a wide range of AI clients.

Typical use cases span from enhancing coding assistants that can recall previous build or deployment commands, to creating audit tools that track command usage over time. In a CI/CD pipeline, an AI helper could suggest the most recent command or remind a developer of the last . For data scientists, the server can surface common Jupyter or R commands, speeding up experimentation cycles.

Integration is straightforward: once the server runs, any MCP‑compatible client—such as Cursor or a custom web interface—can invoke the tools with natural language prompts. The server handles parsing, searching, and returning results in a consistent format, freeing developers from boilerplate code. Its lightweight Python implementation ensures minimal overhead, while the clear API design allows easy extension or replacement of the underlying history source if needed.

In summary, MCP Command History turns a simple shell log into a powerful, AI‑ready resource. It empowers developers to build contextually aware assistants that remember and learn from past commands, streamline repetitive tasks, and provide actionable insights—all through a clean, standardized MCP interface.