Command History Explorer
STDIOA tool for exploring, searching, and managing shell command history through MCP interface.
A tool for exploring, searching, and managing shell command history through MCP interface.
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.
# Clone the repository git clone https://github.com/yourusername/mcp-cmd-history.git cd mcp-cmd-history # Install dependencies pip install -r requirements.txt
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
.
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.
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 IDhistory://recent/{limit}
: Get recent commands (HTTP endpoint)history://search/{query}
: Search for commands (HTTP endpoint)Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.