Skip to main content
Glama
hephaistools

ragifix-mcp

Official
by hephaistools

ragifix-mcp

MCP (Model Context Protocol、Streamable HTTP トランスポート) サーバーであり、互換性のあるチャットクライアントに ragifix ベースを公開します (ドキュメントの検索、追加、削除、一覧表示)。

目次


Related MCP server: docrag

Docker によるインストール

git clone <url-du-dépôt> ragifix-mcp && cd ragifix-mcp

cp config.example.yaml config.yaml              # puis l'adapter
cp deploy/ragifix-mcp.env.example ragifix-mcp.env # puis renseigner les secrets

docker build -f deploy/docker/Dockerfile -t ragifix-mcp .

docker run -d \
  --name ragifix-mcp \
  --network host \
  --env-file ragifix-mcp.env \
  -v "$(pwd)/config.yaml:/etc/ragifix/config.yaml:ro" \
  ragifix-mcp

--network host: デフォルト (server.host: 127.0.0.1) では、サーバーは ragifix とチャットクライアントもホストしているマシン上でローカルに到達可能な状態を維持する必要があります。

サービスが稼働していることを確認します (トークンなしでは 401 が期待されます — これはサーバーが応答している証拠です):

curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8422/mcp \
  -X POST -H "Content-Type: application/json" -d '{}'

.deb パッケージによるインストール

git clone <url-du-dépôt> ragifix-mcp && cd ragifix-mcp

sudo apt-get install -y devscripts debhelper python3-venv python3-pip
dpkg-buildpackage -us -uc -b

sudo apt install -y ../ragifix-mcp_0.1.0-1_all.deb

インストール (postinst) は、/opt/ragifix-mcp/venv に Python 仮想環境を構築し、PyPI から依存関係をインストールします (軽量: mcphttpxstarletteuvicornpydanticapt install 時にはネットワークアクセスが必要で、以後のサービスはオフラインで動作します)。

このパッケージは、専用のシステムユーザー、/etc/ragifix-mcp/config.yamlragifix-mcp.env (サンプルから)、および systemd ユニット ragifix-mcp.service を作成します。

sudo nano /etc/ragifix-mcp/config.yaml
sudo nano /etc/ragifix-mcp/ragifix-mcp.env
sudo systemctl enable --now ragifix-mcp
journalctl -u ragifix-mcp -f
sudo apt remove ragifix-mcp    # conserve la config
sudo apt purge ragifix-mcp     # supprime tout

開発環境でのインストール

git clone <url-du-dépôt> ragifix-mcp && cd ragifix-mcp

python3 -m venv venv
source venv/bin/activate
pip install -e .

cp config.example.yaml config.yaml   # reste à côté du code, hors /etc

export RAGIFIX_MCP_TOKEN=dev-mcp-token
export RAGIFIX_API_TOKEN=dev-token    # le token de l'API ragifix visée

ragifix-mcp --config ./config.yaml

チャットクライアントに貼り付ける設定

サーバーを起動したら、クライアントの設定に、現在の標準形式でリモート MCP サーバー (HTTP トランスポート) を宣言します:

{
  "mcpServers": {
    "ragifix": {
      "url": "http://127.0.0.1:8422/mcp",
      "headers": {
        "Authorization": "Bearer <RAGIFIX_MCP_TOKEN>"
      }
    }
  }
}

<RAGIFIX_MCP_TOKEN>ragifix-mcp.env で設定された値 (開発時は RAGIFIX_MCP_TOKEN) に置き換え、URL は 127.0.0.1:8422 と異なる場合はサーバーの実際のアドレスに置き換えてください。

一部の古いクライアントは、リモートの HTTP サーバーに直接接続できず、ローカルコマンド (command/args) のみを受け付けます。その場合は、mcp-remote のようなブリッジを使用します:

{
  "mcpServers": {
    "ragifix": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "http://127.0.0.1:8422/mcp",
        "--header", "Authorization: Bearer <RAGIFIX_MCP_TOKEN>"
      ]
    }
  }
}

この設定をどこに貼り付けるか (MCP 設定ファイル、またはコネクタ/MCP サーバー管理インターフェース) については、使用するチャットクライアントのドキュメントを参照してください。

公開ツール

ツール

説明

rag_query(query, top_k=5)

最も関連性の高い文章を検索します。

rag_list_documents(prefix=None)

ragifix にインデックスされたドキュメントを一覧表示します。

rag_get_document(doc_id)

ドキュメントの詳細。

rag_add_document(doc_id, content, extension, content_encoding="utf8", metadata=None)

ドキュメントを追加/更新します (content_encoding: プレーンテキストは "utf8"、バイナリコンテンツ — pdf/docx/pptx/xlsx/html — は "base64")。

rag_delete_document(doc_id)

ドキュメントを削除します (冪等)。

rag_health()

ragifix が到達可能かどうかを確認します。

リモートアクセス

デフォルト (server.host: 127.0.0.1) では、サーバーはローカルマシンからのみ到達可能です — 同じマシン上で動作するチャットクライアント (例: ローカルの Claude Desktop) に適しています。

リモートのチャットクライアントを使用するには、2つの変更が必要です:

  1. config.yamlserver.host: 0.0.0.0 (すべてのインターフェース) または対象のネットワークインターフェースの IP に変更します。host がローカルでない限り、この点を注意喚起するため、起動時に警告がログに記録されます。

  2. TLS: このサーバーは TLS を自身では終端しません。証明書を管理し、内部の http://127.0.0.1:<port>/mcp に中継するリバースプロキシ (nginx、Caddy、Traefik など) を前段に配置します。Caddy を使用した最小限の例:

    mcp.exemple.fr {
        reverse_proxy 127.0.0.1:8422
    }

    チャットクライアント側で宣言する url は、 https://mcp.exemple.fr/mcp になります。

専用トークン (RAGIFIX_MCP_TOKEN) は、どちらの場合もアプリケーションレベルの保護として残ります — TLS はトランスポートを保護し、トークンはアクセスを保護します。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides semantic search over markdown documentation using RAG, allowing natural language queries and integration with MCP clients.
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides RAG (Retrieval Augmented Generation) access to technical documentation through MCP, enabling LLMs to search and retrieve relevant documentation on-demand.
    4
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Exposes an existing RAG API as MCP tools, enabling health checks and document-based question answering with source evidence.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to query and manage a document knowledge base via MCP, with RAG-powered search and grounded answers with citations.
    MIT