Model Context Protocol Server

Integrations

  • Integrates with python-dotenv for managing environment variables, facilitating the secure storage and access of API keys and configuration settings.

  • Provides repository access and version control integration through GitHub, allowing users to clone and contribute to the project.

  • Integrates with LangChain to provide agent-based search capabilities and facilitate the creation of agentic AI systems that can search the web and retrieve information.

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. Features
    1. Architecture
      1. Project Structure
        1. Getting Started
          1. Prerequisites
          2. Installation
          3. Usage
          4. Using Ollama (Optional)
        2. Development
          1. License
            1. Acknowledgements

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                This server enables AI systems to integrate with Tavily's search and data extraction tools, providing real-time web information access and domain-specific searches.
                Last updated -
                2
                4,691
                164
                JavaScript
                MIT License
                • Apple
                • Linux
              • A
                security
                A
                license
                A
                quality
                A production-ready Model Context Protocol server that enables language models to leverage AI-powered web scraping capabilities, offering tools for transforming webpages to markdown, extracting structured data, and executing AI-powered web searches.
                Last updated -
                3
                16
                Python
                MIT License
                • Apple
              • -
                security
                F
                license
                -
                quality
                Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
                Last updated -
                JavaScript
                • Apple
              • -
                security
                A
                license
                -
                quality
                This server implementation allows AI assistants to interact with Asana's API, enabling users to manage tasks, projects, workspaces, and comments through natural language requests.
                Last updated -
                65
                TypeScript
                MIT License

              View all related MCP servers

              ID: iqudnbc9bd