- Explore MCP Servers
- mcp-histfile
Mcp Histfile
What is Mcp Histfile
mcp-histfile is an MCP (Model Context Protocol) Server designed to retrieve and share shell command history from bash or zsh environments with MCP Clients like Cursor and Claude.
Use cases
Use cases for mcp-histfile include retrieving recent shell commands for quick access, searching through command history for specific commands, and integrating command history management into development tools.
How to use
To use mcp-histfile, start the server by running ‘python mcp_history_server.py’. The server reads shell history from the ‘HISTFILE’ environment variable or defaults to ‘~/.bash_history’. You can then use MCP tools in Cursor to access recent commands or search through your command history.
Key features
Key features include programmatic access to shell command history, powerful search capabilities for command queries, quick retrieval of recent commands, and seamless integration with MCP-compatible tools like Cursor.
Where to use
mcp-histfile can be used in software development environments, command-line interfaces, and any scenario where managing and retrieving shell command history is beneficial.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Histfile
mcp-histfile is an MCP (Model Context Protocol) Server designed to retrieve and share shell command history from bash or zsh environments with MCP Clients like Cursor and Claude.
Use cases
Use cases for mcp-histfile include retrieving recent shell commands for quick access, searching through command history for specific commands, and integrating command history management into development tools.
How to use
To use mcp-histfile, start the server by running ‘python mcp_history_server.py’. The server reads shell history from the ‘HISTFILE’ environment variable or defaults to ‘~/.bash_history’. You can then use MCP tools in Cursor to access recent commands or search through your command history.
Key features
Key features include programmatic access to shell command history, powerful search capabilities for command queries, quick retrieval of recent commands, and seamless integration with MCP-compatible tools like Cursor.
Where to use
mcp-histfile can be used in software development environments, command-line interfaces, and any scenario where managing and retrieving shell command history is beneficial.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
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.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










