Integrations
Allows searching command history for Git operations, helping users retrieve previously executed Git commands like 'git commit'.
Provides access to shell command history, enabling users to search, explore, and retrieve previously executed commands from Bash and other shell environments.
Supports reading command history from Zsh, allowing users to access and search their Zsh command history through the MCP interface.
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
Usage
Starting the Server
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:Copy
- Search Command History:Copy
- 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.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
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.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityThis MCP server enables users to execute shell commands in the current iTerm2 session through integration with Claude Desktop, facilitating seamless command execution via the Model Context Protocol.Last updated -3514296TypeScriptMIT License
- AsecurityAlicenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -174PythonMIT License
- AsecurityAlicenseAqualityA secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).Last updated -1121JavaScriptMIT License
- -security-license-qualityA secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.Last updated -Python