Skip to main content
Glama

Model Context Protocol Server

by arkeodev

RAGとMCPを備えた検索エンジン

LangChain、Model Context Protocol (MCP)、Retrieval-Augmented Generation (RAG)、Ollama を組み合わせて、Web を検索し、情報を取得し、関連する回答を提供できるエージェント AI システムを作成する強力な検索エンジンです。

特徴

  • Exa API を使用した Web 検索機能
  • FireCrawl を使用した Web コンテンツ検索
  • より関連性の高い情報抽出のためのRAG(検索拡張生成)
  • 標準化されたツール呼び出しのためのMCP(モデルコンテキストプロトコル)サーバー
  • Ollama経由のローカルLLMとOpenAI経由のクラウドベースLLMの両方をサポート
  • 直接検索、エージェントベースの検索、またはサーバーモードをサポートする柔軟なアーキテクチャ
  • 包括的なエラー処理と適切なフォールバック
  • 型ヒント付きのPython 3.13+
  • 効率的なWeb操作のための非同期処理

建築

このプロジェクトでは、いくつかの重要なコンポーネントが統合されています。

  1. 検索モジュール: Exa API を使用して Web を検索し、FireCrawl を使用してコンテンツを取得します。
  2. RAGモジュール: ドキュメントを埋め込み、チャンク化し、FAISSベクトルストアに保存します。
  3. MCPサーバー:ツール呼び出しのための標準化されたプロトコルを提供します
  4. エージェント: 検索とRAG機能を使用するLangChainベースのエージェント

プロジェクト構造

search-engine-with-rag-and-mcp/ ├── LICENSE # MIT License ├── README.md # Project documentation ├── data/ # Data directories ├── docs/ # Documentation │ └── env_template.md # Environment variables documentation ├── logs/ # Log files directory (auto-created) ├── src/ # Main package (source code) │ ├── __init__.py │ ├── core/ # Core functionality │ │ ├── __init__.py │ │ ├── main.py # Main entry point │ │ ├── search.py # Web search module │ │ ├── rag.py # RAG implementation │ │ ├── agent.py # LangChain agent │ │ └── mcp_server.py # MCP server implementation │ └── utils/ # Utility modules │ ├── __init__.py │ ├── env.py # Environment variable loading │ └── logger.py # Logging configuration ├── pyproject.toml # Poetry configuration ├── requirements.txt # Project dependencies └── tests/ # Test directory

はじめる

前提条件

  • Python 3.13以上
  • (オプション、開発用)
  • Exa と FireCrawl の API キー
  • (オプション)Ollamaをローカルにインストール
  • (オプション)OpenAI APIキー

インストール

  1. リポジトリをクローンする
git clone https://github.com/yourusername/search-engine-with-rag-and-mcp.git cd search-engine-with-rag-and-mcp
  1. 依存関係をインストールする
# Using pip pip install -r requirements.txt # Or using poetry poetry install
  1. .envファイルを作成します (docs/env_template.md を参照として使用します)

使用法

アプリケーションには主に 3 つの動作モードがあります。

1. ダイレクト検索モード(デフォルト)
# Using pip python -m src.core.main "your search query" # Or using poetry poetry run python -m src.core.main "your search query"
2. エージェントモード
python -m src.core.main --agent "your search query"
3. MCPサーバーモード
python -m src.core.main --server

カスタムホストとポートを指定することもできます。

python -m src.core.main --server --host 0.0.0.0 --port 8080

Ollamaの使用(オプション)

ローカル埋め込みと LLM 機能に Ollama を使用するには:

  1. Ollamaをインストール: https://ollama.ai/
  2. モデルをプルします:
ollama pull mistral:latest
  1. .envファイルで適切な環境変数を設定します。
OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_MODEL=mistral:latest

発達

このプロジェクトは、次のベスト プラクティスに従います。

  • コードフォーマット: 一貫したコードスタイルのための黒とisort
  • 型チェック: 静的型チェック用の mypy
  • リンティング: コード品質のためのflake8
  • テスト: 単体テストと統合テスト用の pytest
  • 環境管理: 環境変数を管理するための python-dotenv
  • ログ記録: コンソールとファイルの両方に構造化されたログ記録

ライセンス

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

謝辞

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

hybrid server

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

ツール呼び出し用の標準化されたプロトコルを提供し、LangChain、RAG、Ollama との統合を通じて AI システムが Web を検索し、情報を取得し、関連する回答を提供できるようにします。

  1. 特徴
    1. 建築
      1. プロジェクト構造
        1. はじめる
          1. 前提条件
          2. インストール
          3. 使用法
          4. Ollamaの使用(オプション)
        2. 発達
          1. ライセンス
            1. 謝辞

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                Enables seamless AI integration via Ollama's Deepseek model, providing protocol compliance and automatic configuration for clean AI-driven interactions.
                Last updated -
                1
                Python
              • 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 -
                1
                883
                14
                JavaScript
                • Apple
                • Linux
              • -
                security
                F
                license
                -
                quality
                A simple Model Context Protocol server that enables searching and retrieving relevant documentation snippets from Langchain, Llama Index, and OpenAI official documentation.
                Last updated -
                Python
                • Apple
                • Linux
              • -
                security
                F
                license
                -
                quality
                An integration that enables AI assistants to interact with network data through a standardized protocol, providing AI-ready tools and interfaces for network automation and management.
                Last updated -
                15
                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/arkeodev/search-engine-with-rag-and-mcp'

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