Skip to main content
Glama

mcp-histfile

by rajpdus

MCPコマンド履歴

MCP(Model Control Protocol)インターフェースを介してシェルコマンド履歴を探索、検索、管理するための強力なツールです。このプロジェクトを使用すると、以前に実行したシェルコマンドに簡単にアクセス、検索、取得できます。

特徴

  • コマンド履歴アクセス: プログラムでシェルのコマンド履歴にアクセスする
  • 強力な検索: テキストクエリを使用してコマンド履歴を検索します
  • 最近実行したコマンド: 最近実行したコマンドを素早く取得します
  • MCP統合:カーソルやその他のMCP互換ツールとシームレスに統合します

インストール

前提条件

  • Python 3.6以上
  • 履歴サポート付きのシェル (Bash、Zsh など)

ソースからインストール

# 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

デフォルトでは、サーバーはHISTFILE環境変数で指定された場所からシェル履歴を読み取るか、 ~/.bash_historyにフォールバックします。

カーソルの使用

サーバーが実行される場合は、Cursor で次の MCP ツールを使用できます。

  1. 最近のコマンドを取得:
    Please show me my most recent shell commands.
  2. コマンド履歴の検索:
    Please search my command history for 'git commit' and show me the results.
  3. 特定のコマンドの取得: 最近のコマンドを検索または一覧表示した後、ID で特定のコマンドを取得できます。

APIリファレンス

MCPツール

  • search_commands(query: str) : シェル履歴内のコマンドを検索する
  • get_recent_commands(limit: int = 10) : 履歴から最新のコマンドを取得します。
  • get_command(command_id: int) : IDで特定のコマンドを取得する

MCPリソース

  • history://recent/{limit} : 最近のコマンドを取得する (HTTP エンドポイント)
  • history://search/{query} : コマンドの検索(HTTPエンドポイント)

貢献

貢献を歓迎します!ガイドラインについてはCONTRIBUTING.mdをご覧ください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

MCP(Model Control Protocol)インターフェースを介してシェルコマンド履歴を探索、検索、管理するための強力なツールです。このプロジェクトを使用すると、以前に実行したシェルコマンドに簡単にアクセス、検索、取得できます。

  1. 特徴
    1. インストール
      1. 前提条件
      2. ソースからインストール
    2. 使用法
      1. サーバーの起動
      2. カーソルの使用
    3. APIリファレンス
      1. MCPツール
      2. MCPリソース
    4. 貢献
      1. ライセンス

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          This 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 -
          3
          514
          296
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          A 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 -
          1
          74
          Python
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          A secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).
          Last updated -
          1
          12
          1
          JavaScript
          MIT License
          • Apple
        • -
          security
          -
          license
          -
          quality
          A secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.
          Last updated -
          Python

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/rajpdus/mcp-histfile'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server