MCP Command History
An MCP(Model Context Protocol) Server for retrieving and sharing your bash/zsh history with MCP Client (Cursor, Claude etc.)
Overview
MCP Command History is a tool that allows users to retrieve and share their bash/zsh command history through the MCP (Model Context Protocol) interface, making it easier to manage and explore previously executed shell commands.
To use MCP Command History, install the server by cloning the repository, install the dependencies, and start the server. Once running, you can interact with it using compatible MCP tools like Cursor.
- Access to shell command history programmatically - Powerful search functionality for command history - Quick retrieval of recent commands - Integration with MCP-compatible tools like Cursor
- Searching for previously executed commands to avoid retyping.
- Accessing recent commands for quick execution.
- Integrating with other tools for enhanced command management.
Add to your AI client
Use these steps to connect MCP Command History in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-histfile-rajpdus": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-histfile-rajpdus": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-histfile-rajpdus": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-histfile-rajpdus": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-histfile-rajpdus": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-histfile-rajpdus": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-histfile-rajpdus"
]
}
}
}FAQ
What shell environments are supported?
MCP Command History supports any shell with history support, including Bash and Zsh.
How do I install MCP Command History?
You can install it by cloning the repository and installing the required dependencies using pip.
Is there an API available?
Yes, MCP Command History provides an API for searching and retrieving command history.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2786,"uuid":"7f821baf-7ab2-4fbd-858d-1b38fe8dc6cf","name":"mcp-histfile","title":"MCP Command History","description":"An MCP(Model Context Protocol) Server for retrieving and sharing your bash/zsh history with MCP Client (Cursor, Claude etc.)","avatar_url":"https://avatars.githubusercontent.com/u/54466596?v=4","created_at":"2025-03-14T01:51:31.412Z","updated_at":"2025-03-14T02:23:04.550Z","status":"created","author_name":"rajpdus","author_avatar_url":"https://avatars.githubusercontent.com/u/54466596?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/rajpdus/mcp-histfile","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"MIT license\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-13 20:26:03\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]