MCP Command History
@rajpdus
About MCP Command History
An MCP(Model Context Protocol) Server for retrieving and sharing your bash/zsh history with MCP Client (Cursor, Claude etc.)
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-histfile": {
"command": "python",
"args": [
"mcp_history_server.py"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP Command History?
MCP Command History provides programmatic access, search, and management of your shell command history through the Model Context Protocol (MCP) interface. It is designed for developers who want to query and interact with their command history from MCP‑compatible tools like Cursor.
How to use MCP Command History?
Install from source with Git and pip. Start the server with python mcp_history_server.py; it reads history from the HISTFILE environment variable (default: ~/.bash_history). Once running, use MCP tools such as search_commands, get_recent_commands, and get_command from a Cursor client or any MCP‑compatible host.
Key features of MCP Command History
- Access shell command history programmatically
- Search history with text queries
- Retrieve most recent commands with configurable limit
- Get a specific command by its numeric ID
- Seamless integration with Cursor and other MCP tools
- Supports Bash, Zsh, and any shell with history files
Use cases of MCP Command History
- Search for a forgotten command pattern (e.g., all
git commitoccurrences) - Quickly retrieve recently executed commands for auditing or replay
- Obtain a specific command by ID after a search or listing
- Integrate command history retrieval into automated workflows or AI assistants
FAQ from MCP Command History
How does MCP Command History access my shell history?
It reads from the HISTFILE environment variable; if that is not set, it falls back to ~/.bash_history.
What are the runtime requirements?
Python 3.6 or higher and a shell with history support (Bash, Zsh, etc.). No external authentication or networking beyond the MCP protocol.
How do I start the server?
Run python mcp_history_server.py in the repository directory after installing dependencies with pip install -r requirements.txt.
What MCP tools are provided?
Three tools: search_commands(query: str), get_recent_commands(limit: int = 10), and get_command(command_id: int).
Can I use MCP Command History with tools other than Cursor?
Yes, any MCP‑compatible client can invoke the server’s tools and resources (e.g., history://recent/{limit} and history://search/{query}).
Frequently asked questions
How does MCP Command History access my shell history?
It reads from the `HISTFILE` environment variable; if that is not set, it falls back to `~/.bash_history`.
What are the runtime requirements?
Python 3.6 or higher and a shell with history support (Bash, Zsh, etc.). No external authentication or networking beyond the MCP protocol.
How do I start the server?
Run `python mcp_history_server.py` in the repository directory after installing dependencies with `pip install -r requirements.txt`.
What MCP tools are provided?
Three tools: `search_commands(query: str)`, `get_recent_commands(limit: int = 10)`, and `get_command(command_id: int)`.
Can I use MCP Command History with tools other than Cursor?
Yes, any MCP‑compatible client can invoke the server’s tools and resources (e.g., `history://recent/{limit}` and `history://search/{query}`).
Basic information
More Developer Tools MCP servers
MCP Inspector
modelcontextprotocolVisual testing tool for MCP servers
DevDocs by CyberAGI 🚀
cyberagiincCompletely free, private, UI based Tech Documentation MCP server. Designed for coders and software developers in mind. Easily integrate into Cursor, Windsurf, Cline, Roo Code, Claude Desktop App
Grafana MCP server
grafanaMCP server for Grafana
Vibgrate MCP
VibgrateQuery your team's drift, vulnerability, and migration data from any AI assistant. Vibgrate MCP connects Cursor, Claude, ChatGPT, Windsurf, or VS Code to Vibgrate Cloud: 51 tools for DriftScores, CVEs and EOL runtimes, up
Serena
oraiosA powerful MCP toolkit for coding, providing semantic retrieval and editing capabilities - the IDE for your agent
Comments