Krep MCP Server

Integrations

  • Offers ESLint configuration integration for code quality enforcement within the krep MCP server environment

  • Provides testing infrastructure integration with Jest for unit and integration testing of the krep MCP server

  • Includes a Python integration client that allows Python applications to interact with the krep MCP server

Krep MCP サーバー

infinity-topos環境向けのMCP(モデルコンテキストプロトコル)統合型高性能文字列検索ユーティリティです。これは、grepなどの従来のツールを大幅に上回る超高速パターンマッチングユーティリティであるkrepのラッパーです。

THE KREP-MCP-SERVER ABSURDITY DIAGRAM ==================================== +-----------------------------------------------------+ | | | The KREP MCP Redundancy Zone | | | +-----^--------------------+------------------------+-+ | | | +-----------+----------+ +------+-------------+ +------+-------+ | | | | | | | M E T A D A T A | | F U N C T I O N | | B I N A R Y | | E X P L O S I O N | | N A M E C H A O S| | H U N T | | | | | | | +-----+----------+-----+ +---+-----------+----+ +------+-------+ | | | | | v v v v v +--------+--+ +----+-----+ +---+----+ +---+-----+ +----+------+ | | | | | | | | | | | "Unified" | | 37 Paths | | krep | |krepSearch| | 5 Error | | Function | | To Find | | | |krepMatch | | Handlers | | That Does | | The Same | | | |krepCount | | For | | 3 Things | | Binary | | | | | | 1 Error | | | | | | | | | | | +-----------+ +----------+ +--------+ +----------+ +-----------+ +-----------------------------------------------------+ | | | Configuration & Shell Script Hell | | | +-----^--------------------+------------------------+-+ | | | +-----------+----------+ +------+-------------+ +------+-------+ | | | | | | | 3 Scripts to | | Integer | | Test Mode | | Install 1 Thing | | Arithmetic in | | that Mocks | | | | Shell that says | | Success When| | | | 0 + 0 = Syntax | | Everything | | | | Error | | Fails | +----------------------+ +--------------------+ +--------------+ "It's not redundant if it's resilient!" - MCP Engineer, probably

概要

Krep MCP Serverは、grepに似た高性能な文字列検索ユーティリティであるkrepバイナリへの統合インターフェースを提供します。krepは、最適化されたアルゴリズムとマルチスレッド機能を備えています。モデルコンテキストプロトコルを介してkrepの機能を公開することで、AIアシスタントがファイルや文字列内で効率的なパターン検索を実行できるようにします。

特徴

  • 高性能検索: パターンの長さに基づいて選択された最適化されたアルゴリズム (KMP、Boyer-Moore-Horspool、Rabin-Karp) を使用します。
  • ハードウェア アクセラレーション: SIMD 命令 (x86/x64 では SSE4.2/AVX2、ARM では NEON) を活用 (利用可能な場合)
  • 最適化されたマルチスレッド: 利用可能なすべてのCPUコアを自動的に使用して、並列検索パフォーマンスを最大限に高めます。
  • 統合インターフェース: 複数のモード (ファイル検索、文字列検索、カウントのみ) を備えた単一の機能
  • MCP統合:モデルコンテキストプロトコルを介したAIアシスタントとのシームレスな統合

このコードベースが悲劇的な理由

このコードベースは、単純なツール (文字列検索ユーティリティのラッパー) がどのようにして不必要な複雑さで肥大化してしまったかを示しています。

  1. シンプルなコア、複雑な実装:実際の機能はシンプルだが、過剰なエンジニアリングの層の下に埋もれている
  2. ドキュメントの過負荷: 1 つのよく構成された README で説明できるツールに対して 15 個のドキュメント ファイルがある
  3. 統合の狂気: 3 つの別々の統合システム (Cline、Claude Desktop、SDK)、それぞれ冗長なスクリプトとドキュメント
  4. インストール スクリプトの増殖: 1 つの構成可能なスクリプトで十分なのに、7 つのインストール スクリプトが必要
  5. エラー処理の重複: エラー処理は統一されたアプローチではなく、複数のレベルで重複しています。
  6. テストの断片化: テストファイルが体系的に整理されておらず、コードベース全体に散在している
  7. 構成の冗長性: 構成ファイルと環境変数が複数のコンポーネント間で複製されます
  8. バイナリパスオーバーキル:予測可能な1つの場所にあるはずの1つのバイナリに対して37の異なるパスを検索する

本来あるべき姿:

┌──────────────────────┐ │ krep-mcp-server │ │ ┌────────────────┐ │ │ │ index.js │ │ │ │ - one function│ │ │ └────────────────┘ │ │ ┌────────────────┐ │ │ │ README.md │ │ │ │ - clear docs │ │ │ └────────────────┘ │ │ ┌────────────────┐ │ │ │ install.sh │ │ │ │ - one script │ │ │ └────────────────┘ │ └──────────────────────┘

プロジェクト構造

実際のプロジェクト構造は次のとおりです。

krep-mcp-server/ ├── CLINE_README.md ├── CLINE_SETUP.md ├── CLAUDE_DESKTOP_INTEGRATION.md ├── CLAUDE_DESKTOP_README.md ├── EXAMPLES.md ├── IMPLEMENTATION_SUMMARY.md ├── INSTALL_NOW.md ├── LIFECYCLE_DESIGN.md ├── MCP_COMPLIANCE.md ├── MCP_URIS.md ├── README.md ├── SETUP_CLAUDE_DESKTOP.md ├── TESTING_STRATEGY.md ├── THREAD_OPTIMIZATION.md ├── analysis/ │ └── index.tree.json ├── auto-install-claude.sh ├── cline-config.js ├── direct-install.sh ├── eslint.config.js ├── fix-claude-desktop.sh ├── go-integration/ │ ├── example/ │ └── krep.go ├── install-claude-desktop.sh ├── install-cline-integration.sh ├── install-sdk-integrations.sh ├── jest.config.js ├── just-krep.sh ├── mcp-config.json ├── package-lock.json ├── package.json ├── python-integration/ │ └── krep_mcp_client.py ├── run-claude-desktop.sh ├── run-claude-integration.sh ├── run-cline-mcp-server.sh ├── run-cline-test.sh ├── run-tests.sh ├── run.sh ├── sdk-integration.js ├── src/ │ ├── index.js │ ├── index.min.js │ ├── mcp_server.js │ └── mcp_server.min.js ├── Support/ │ └── Claude/ ├── test/ │ ├── benchmark.js │ ├── fixtures/ │ ├── integration/ │ ├── mcp_benchmark.js │ ├── mock-server.js │ ├── unit/ │ └── utils.js └── various test scripts...

インストール

  1. krep バイナリがインストールされていることを確認します。
    cd /path/to/krep-native make
  2. MCP 設定ファイルで MCP サーバーを構成します。
    { "mcpServers": { "krep": { "command": "node", "args": [ "/path/to/krep-mcp-server/src/index.js" ], "env": { "CLAUDE_MCP": "true", "KREP_PATH": "/path/to/krep-native/krep", "DEBUG": "true" }, "description": "High-performance string search utility with unified interface", "disabled": false, "autoApprove": [ "krep" ] } } }

使用法

krep MCP サーバーは、単一の統合された関数を公開します。

<use_mcp_tool> <server_name>krep</server_name> <tool_name>krep</tool_name> <arguments> { "pattern": "search pattern", "target": "file path or string to search", "mode": "file|string|count", "caseSensitive": true|false, "threads": null // Automatically uses all CPU cores if not specified } </arguments> </use_mcp_tool>

パラメータ

  • パターン(必須): 検索するパターン
  • ターゲット(必須): 検索するファイルパスまたは文字列
  • mode (オプション): 検索モード
    • file (デフォルト):ファイル内を検索
    • string : 文字列内を検索
    • count : 出現回数のみをカウントする
  • caseSensitive (オプション): 検索で大文字と小文字を区別するかどうか (デフォルト: true)
  • スレッド(オプション):使用するスレッド数(デフォルト:CPUコアに基づいて自動検出)

詳細な使用例とパターンについては、 examples.md を参照してください。

仕組み

krep MCP サーバーは次のように動作します。

  1. モデルコンテキストプロトコルを介してリクエストを受信する
  2. リクエストパラメータの解析
  3. モードとパラメータに基づいて適切なkrepコマンドを構築する
  4. krepバイナリを使用してコマンドを実行する
  5. 結果を解析し、構造化された形式で返す

パフォーマンス

Krep は、高性能なパターン検索用に設計されています。

  • アルゴリズム選択:パターンの長さに基づいて最適なアルゴリズムを自動的に選択します
    • 非常に短いパターン(< 3 文字)の場合は KMP(Knuth-Morris-Pratt)
    • 中程度の長さのパターン(3〜16文字)用のBoyer-Moore-Horspool
    • 長いパターン(16文字以上)の場合はRabin-Karp
  • ハードウェアアクセラレーション: 利用可能な場合はSIMD命令を使用する
  • ダイナミックマルチスレッド: 利用可能なすべてのCPUコアを自動的に活用して、並列検索パフォーマンスを最適化します。

Cline VSCode拡張機能の統合

krep-mcp-server は Cline VSCode 拡張機能と統合できるため、VSCode 環境で直接、高性能な文字列検索機能を使用できます。

Clineによるインスタレーション

Cline 統合を設定するための自動インストール スクリプトを提供しています。

# Install the integration ./install-cline-integration.sh # Test the integration before installing ./run-cline-test.sh # Uninstall the integration ./uninstall-cline-integration.sh

Cline での krep の使用

統合されると、Cline 会話で krep を直接使用できるようになります。

/krep krep pattern="function" target="/path/to/search" mode="file"

詳細な手順と使用例については、以下を参照してください。

Infinity Toposとの統合

Krep MCP Server は、infinity-topos 環境内でシームレスに動作するように設計されています。

  • Babashka 統合: Babashka を使用して検索結果を処理する
  • Say 統合: Say MCP サーバーを使用して検索結果を音声化する
  • コイン投げ統合:ランダム化を使用して検索戦略を決定する

発達

環境変数

  • CLAUDE_MCP : MCPモードで実行するには「true」に設定します
  • KREP_PATH : krepバイナリへのパス
  • DEBUG : 詳細なログ出力を行うには「true」に設定します
  • KREP_TEST_MODE : 模擬応答でテストモードで実行するには「true」に設定します
  • KREP_SKIP_CHECK : krepバイナリが存在するかどうかのチェックをスキップするには「true」に設定します

HTTPサーバーモード

MCP モードで実行されていない場合、サーバーは次のエンドポイントを持つ HTTP サーバーを起動します。

  • GET /health : ヘルスチェックエンドポイント
  • GET / : サーバー情報
  • POST /search : ファイル内のパターンを検索する
  • POST /match : 文字列内のパターンを一致させる
  • GET /performance : パフォーマンス情報
  • GET /algorithm-selection : アルゴリズム選択ガイド

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

モデル コンテキスト プロトコル統合を備えた高性能な文字列検索ユーティリティ。AI アシスタントがファイルや文字列内で効率的なパターン検索を実行できるようになります。

  1. Overview
    1. Features
      1. Why This Codebase Is Tragic
        1. Project Structure
          1. Installation
            1. Usage
              1. Parameters
              2. Examples
            2. How It Works
              1. Performance
                1. Cline VSCode Extension Integration
                  1. Installation with Cline
                  2. Using krep in Cline
                2. Integration with Infinity Topos
                  1. Development
                    1. Environment Variables
                    2. HTTP Server Mode
                  2. License

                    Related MCP Servers

                    • A
                      security
                      A
                      license
                      A
                      quality
                      Enables AI assistants to interact with Meilisearch via the Model Context Protocol, allowing comprehensive index, document, and search management through a standardized interface.
                      Last updated 2 months ago
                      68
                      4
                      TypeScript
                      MIT License
                      • Apple
                      • Linux
                    • A
                      security
                      F
                      license
                      A
                      quality
                      Provides integration with Everything Search Engine allowing powerful file search capabilities through the Model Context Protocol with advanced search options like regex, case sensitivity, and sorting.
                      Last updated 4 months ago
                      1
                      3
                      JavaScript
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that enables AI assistants to search and access information stored in Kibela, supporting note search, retrieval, creation and updating.
                      Last updated a month ago
                      6
                      107
                      9
                      TypeScript
                      MIT License
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
                      Last updated 2 days ago
                      1
                      44
                      8
                      JavaScript
                      • Apple
                      • Linux

                    View all related MCP servers

                    ID: 9e91igo4ox