Skip to main content
Glama
k-rister

ephemeral-buffer

by k-rister

一時バッファMCPサーバー(ephemeral-buffer

AIコーディングアシスタント(Claude Code、Antigravity、Cursorなど)向けの、一時的なインメモリコマンド出力キャプチャ&ハイブリッド検索エンジン(BM25 + セマンティック埋め込み)。


🎯 これが解決する問題

コーディングエージェントが大量の出力(数千行のビルドログ、テスト実行、スタックトレース、JSONダンプ)を生成するコマンドを実行すると、エージェントは2つの障害モードに直面します:

  1. コンテキスト汚染: メガバイト単位の生テキストを取り込むと、トークン制限を超え、モデルの推論能力が低下します。

  2. 盲目的なBashフィルタリング: エージェントはエラーパターンを推測するために、headtailgrepawk を実行して複数のターンを無駄にします。

Related MCP server: Qurio MCP Server

💡 解決策

ephemeral-buffer は、デュアルハイブリッドインデックスを備えた一時的なインメモリリングバッファを提供します:

  • BM25 語彙検索(SQLite FTS5): エラーコード(NullPointerExceptionECONNREFUSEDexit 137、HTTP 502)の完全一致検索用。

  • 高密度セマンティックベクトル検索(FastEmbed ONNX): 曖昧な概念クエリ(「DB接続プールの障害はどこで発生しましたか?」「認証が失敗したのはなぜですか?」)用。

  • 相互ランク融合(RRF): 語彙ランキングとセマンティックランキングをブレンドし、高精度な検索を実現。

  • リングバッファの退避: 直近の $N$ 件のキャプチャ(デフォルト:10件)のみを保持し、永続ストレージの蓄積やメモリリークをゼロにします。


🏗 アーキテクチャとフロー

flowchart TD
    subgraph Ingestion["1. Ingestion Paths"]
        A["CLI Pipe: command 2>&1 | agy-cap"] --> D["Unix Socket (/tmp/ephemeral_buffer.sock)"]
        B["Agent Tool: execute_and_capture(cmd)"] --> E["Ephemeral Ring Buffer Engine"]
        C["Agent Tool: capture_text / capture_file"] --> E
        D --> E
    end

    subgraph Indexing["2. Dual Hybrid Indexing"]
        E --> F["SQLite FTS5 (BM25 Lexical)"]
        E --> G["FastEmbed ONNX (Dense Vectors)"]
    end

    subgraph Querying["3. Agent Query & Retrieval"]
        F & G --> H["Reciprocal Rank Fusion (RRF)"]
        H --> I["search_capture(query, mode='hybrid')"]
        I --> J["Precise Context Chunk + Line Numbers"]
    end

🚀 使用方法

1. ターミナルから(agy-cap によるCLIパイプ)

コマンド出力を実行中のMCPサーバーに直接パイプできます:

# Pipe any command output into the buffer
pytest -v 2>&1 | agy-cap --label "pytest run"

# Or wrap command execution
agy-cap --label "backend build" -- cargo build --verbose

2. AIエージェントからMCPツール経由

エージェントは以下のツールにアクセスできます:

ツール

目的

execute_and_capture(command, label)

シェルコマンドを実行し、すべての出力をバッファにキャプチャし、エージェントコンテキストにはコンパクトな診断サマリー(終了コード、行数、シグナル)のみを返します。

capture_text(content, label)

テキストを直接バッファに取り込みます。

capture_file(file_path, label)

ディスクからログ/出力ファイルを取り込みます。

search_capture(query, mode, top_k, context_lines)

キャプチャした出力に対するハイブリッド/BM25/セマンティック検索。周囲のコンテキスト行と正確な行番号を含む一致チャンクを返します。

get_capture_slice(start_line, end_line)

完全なスタックトレースやログを検査するための正確な行範囲を取得します。

get_capture_summary(capture_id)

診断概要(行数、エラーシグナル、先頭/末尾プレビュー)。

list_captures()

リングバッファ内のアクティブなキャプチャを一覧表示します。

clear_captures(capture_id)

バッファをクリアします。


🛠 サーバーのテスト

テストスイートを実行します:

./venv/bin/python test_engine.py
A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

UpdatingMaintainers
UpdatingResponse time
Release cycle
0Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides persistent memory for AI agents using hybrid search (vector embeddings + BM25) with neural reranking, enabling storage and retrieval of insights, debugging solutions, and patterns across coding sessions.
    8
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI coding assistants to search and retrieve information from a locally ingested knowledge base using hybrid search, grounded in user-curated documentation.
    17
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.
    29
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Provides persistent, searchable memory across AI coding agent and chat history (Claude Code, Codex, Gemini CLI, ChatGPT, and more) via retrieval-augmented generation, enabling semantic and hybrid search to retain context across sessions.
    5
    5
    MIT

View all related MCP servers

Related MCP Connectors

  • Search your knowledge bases from any AI assistant using hybrid RAG.

  • Long-term memory for AI assistants. Hybrid retrieval, query expansion, auto-topics.

  • Token-efficient search for coding agents over public and private documentation.

View all MCP Connectors

Latest Blog Posts

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/k-rister/ephemeral-buffer-mcp'

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