MCP Command History
A powerful tool for exploring, searching, and managing your shell command history through the MCP (Model Control Protocol) interface. This project allows you to easily access, search, and retrieve your previously executed shell commands.
Features
- Command History Access: Access your shell command history programmatically
- Powerful Search: Search through your command history with text queries
- Recent Commands: Quickly retrieve your most recently executed commands
- MCP Integration: Seamlessly integrates with Cursor and other MCP-compatible tools
Installation
Prerequisites
- Python 3.6 or higher
- A shell with history support (Bash, Zsh, etc.)
Install from Source
# Clone the repository
git clone https://github.com/yourusername/mcp-cmd-history.git
cd mcp-cmd-history
# Install dependencies
pip install -r requirements.txt
Usage
Starting the Server
python mcp_history_server.py
By default, the server will read your shell history from the location specified in the HISTFILE
environment variable, or fall back to ~/.bash_history
.
Using with Cursor
Once the server is running, you can use the following MCP tools in Cursor:
Get Recent Commands:
Please show me my most recent shell commands.
Search Command History:
Please search my command history for 'git commit' and show me the results.
Get Specific Command: You can retrieve a specific command by its ID after searching or listing recent commands.
API Reference
MCP Tools
search_commands(query: str)
: Search for commands in shell historyget_recent_commands(limit: int = 10)
: Get the most recent commands from historyget_command(command_id: int)
: Get a specific command by ID
MCP Resources
history://recent/{limit}
: Get recent commands (HTTP endpoint)history://search/{query}
: Search for commands (HTTP endpoint)
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Command History Explorer
Project Details
- rajpdus/mcp-histfile
- MIT License
- Last Updated: 3/23/2025
Recomended MCP Servers
CTX: The missing link between your codebase and your LLM. Context as Code (CaC) tool with MCP server...
Web search using free google search (NO API KEYS REQUIRED)
mcp filesystem
A Model Context Protocol server for interacting with the Solana blockchain, powered by the Solana Agent Kit (https://github.com/sendaifun/solana-agent-kit)
AutoGen最新架构v0.4正式发布第一个稳定版本,v0.4是对AutoGen的一次从头开始的重写,目的是为构建Agent创建一个更健壮、可扩展、更易用的跨语言库,其应用接口采用分层架构设计,存在多套软件接口用以满足不同的场景需求 。
GibsonAI's MCP server
This is a GitHub MCP server designed to enable MCP-compatible LLMs, such as Claude, to communicate with my...
servidor mcp
testai-mcp-server