mcp-server-ollama-deep-researcher

by Cam10001110101
Verified

hybrid server

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

Integrations

  • Based on LangChain Ollama Deep Researcher, providing workflow orchestration for multi-step research tasks

  • Referenced as part of research workflow implementation, though listed as requiring additional validation and re-integration

  • Enables research capabilities using any local LLM hosted by Ollama, supporting models like deepseek-r1 and llama3.2

MCP サーバー: Ollama Deep Researcher

これは、LangChain Ollama Deep Researcherのモデルコンテキストプロトコル(MCP)サーバー版です。モデルコンテキストプロトコルエコシステム内で利用可能なMCPツールとしてディープリサーチ機能を提供し、AIアシスタントがOllamaを介してローカルLLMを用いてトピックに関する詳細なリサーチを実行できるようにします。

コア機能

サーバーは、 Ollamaがホストする任意の LLM を使用して、MCP ツールとリソースを通じて研究機能を提供します。

研究プロセス

トピックを指定すると、次のようになります。

  1. ウェブ検索クエリを生成する
  2. TavilyまたはPerplexity API経由でウェブ検索結果を収集する
  3. 検索結果を要約する
  4. 要約を振り返り、知識のギャップを調べる
  5. ギャップを埋めるための新しい検索クエリを生成する
  6. 複数の調査サイクルを通じて要約を反復的に改善する
  7. 使用したすべてのソースを含む最終的なマークダウンの概要を提供する

前提条件

  • Node.js(MCPサーバーの実行用)
    • https://nodejs.org/からダウンロードしてインストールします。
    • Node.jsがシステムPATHに追加されていることを確認してください
  • Python 3.10以上
  • 選択した Ollama モデルを実行できるコンピューティング能力 (CPU/GPU)
  • 大規模な言語モデルを実行するには少なくとも8GBのRAMが必要
  • 必要なAPIキー:

ターミナル/コマンドプロンプトからNode.jsとnpmが実行できることを確認してください。インストールは次のコマンドで確認できます。

node --version npm --version python --version

これらのコマンドが失敗した場合は、次の操作が必要になる可能性があります。

  1. インストール後に端末/コンピュータを再起動してください
  2. システム PATH に Node.js を追加します。
    • Windows: システム環境変数の編集 → 環境変数 → パス → Node.jsインストールディレクトリの追加
    • macOS/Linux: 通常はインストーラーによって処理されます

インストール

オプション1: 標準インストール

  1. お使いのプラットフォームにOllamaをダウンロードしてインストールします
  2. このリポジトリをクローンし、依存関係をインストールします。
git clone https://github.com/Cam10001110101/mcp-server-ollama-deep-researcher cd mcp-server-ollama-deep-researcher npm install
  1. Python の依存関係をインストールします。

まず、uv をインストールします (パフォーマンスと依存関係の解決を向上させるために推奨されます)。

# Windows pip install uv # macOS/Linux pip3 install uv

次に、pyproject.toml を使用してプロジェクトの依存関係をインストールします。

uv pip install .

注: これにより、pyproject.toml で指定されたすべての依存関係を含む、編集可能なモードでプロジェクトがインストールされます。pip を使用する場合は、以下のコマンドを実行します。

pip install . # Windows pip3 install . # macOS/Linux
  1. TypeScript コードをビルドします。
npm run build
  1. Ollamaからローカル LLM を取得します。
ollama pull deepseek-r1:8b

オプション2: Dockerのインストール

Docker を使用して MCP サーバーを実行することもできます。これにより、セットアップ プロセスが簡素化されます。

  1. お使いのプラットフォーム用のDockerをダウンロードしてインストールします
  2. このリポジトリをクローンします:
git clone https://github.com/Cam10001110101/mcp-server-ollama-deep-researcher cd mcp-server-ollama-deep-researcher
  1. API キーを使用して.envファイルを作成します ( .env.exampleからコピーできます)。
cp .env.example .env # Edit the .env file with your API keys
  1. ヘルパー スクリプトを実行可能にします。
chmod +x run-docker.sh
  1. Docker コンテナをビルドして実行します。
./run-docker.sh start
  1. ホストマシン上で Ollama が実行されていることを確認します。
ollama pull deepseek-r1:8b # or your preferred model ollama serve

ヘルパー スクリプトはいくつかのコマンドを提供します。

macOS/Linux の場合 (run-docker.sh を使用):

  • ./run-docker.sh start - Dockerコンテナをビルドして起動します
  • ./run-docker.sh stop - Dockerコンテナを停止します
  • ./run-docker.sh restart - Dockerコンテナを再起動します
  • ./run-docker.sh logs - Dockerコンテナからのログを表示します
  • ./run-docker.sh status - Dockerコンテナのステータスを確認する
  • ./run-docker.sh help - ヘルプメッセージを表示する

Windows の場合 (run-docker.bat を使用):

  • run-docker.bat start - Dockerコンテナをビルドして起動する
  • run-docker.bat stop - Dockerコンテナを停止する
  • run-docker.bat restart - Dockerコンテナを再起動します
  • run-docker.bat logs - Docker コンテナからのログを表示します
  • run-docker.bat status - Dockerコンテナのステータスを確認する
  • run-docker.bat help - ヘルプメッセージを表示する

注: Dockerコンテナは、ホストマシン上で実行されているOllamaに接続するように設定されています。コンテナ内でもOllamaを実行したい場合は、docker-compose.ymlファイルでOllamaサービスのコメントを解除してください。

クライアント構成

サーバーを MCP クライアント構成に追加します。

Claude デスクトップ アプリの場合:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cline (VS Code 拡張機能) の場合:

  • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

オプション1: 標準インストール構成

{ "mcpServers": { "ollama-deep-researcher": { "command": "node", "args": ["path/to/mcp-server-ollama-deep-researcher/build/index.js"], "env": { "LANGSMITH_TRACING": "true", "LANGSMITH_ENDPOINT": "https://api.smith.langchain.com", "LANGSMITH_API_KEY": "your-langsmith-key", "LANGSMITH_PROJECT": "ollama-deep-researcher-mcp-server", "TAVILY_API_KEY": "your-tavily-key", // Include tvly- prefix "PERPLEXITY_API_KEY": "your-perplexity-key", "PYTHONPATH": "path/to/mcp-server-ollama-deep-researcher/src" } } } }

注: パスをシステムの絶対パスに置き換えてください。

  • Windows: C:\\Users\\username\\path\\to\\mcp-server-ollama-deep-researcher使用します。
  • macOS/Linux: /Users/username/path/to/mcp-server-ollama-deep-researcher使用します

macOS/Linux の場合は、以下も追加する必要があります。

"PYTHONUNBUFFERED": "1"

オプション2: Dockerインストール構成

Docker コンテナを使用している場合は、実行中のコンテナに接続するように MCP クライアントを構成できます。

{ "mcpServers": { "ollama-deep-researcher": { "command": "docker", "args": ["exec", "-i", "ollama-deep-researcher-mcp", "node", "build/index.js"], "env": {} } } }

この設定は、Dockerコンテナが実行中であることを前提としています。環境変数はDockerコンテナに既に設定されているため、MCPクライアント設定で指定する必要はありません。

追跡と監視

サーバーは LangSmith と統合され、研究プロセスの包括的な追跡と監視を実現します。

  1. 操作追跡:
    • すべてのLLMインタラクションがトレースされる
    • ウェブ検索操作は監視されている
    • 研究ワークフローのステップが追跡される
  2. パフォーマンス監視:
    • 各操作の応答時間
    • 成功率/失敗率
    • リソースの活用
  3. デバッグと最適化:
    • トラブルシューティングのための詳細なトレース
    • パフォーマンスのボトルネックの特定
    • クエリ最適化の洞察

設定したプロジェクト名でhttps://smith.langchain.comにあるすべてのトレースにアクセスします。

MCPリソース

研究結果は MCP リソースとして自動的に保存され、次のことが可能になります。

  1. 永続アクセス
    • research://{topic} URI 経由でアクセスできる結果
    • 完了した研究の自動保存
    • メタデータを含むJSON形式のコンテンツ
  2. リソースパネルの統合
    • リサーチはMCPクライアントのリソースパネルに表示されます
    • 過去の研究トピックへの簡単なアクセス
    • 各結果のタイムスタンプと説明
  3. コンテキスト管理
    • 会話の中での研究の効率的な再利用
    • リソース参照によるトークン使用量の削減
    • 研究文脈の選択的包含

利用可能なツール

設定

  • maxLoops : 研究の反復回数(1~5)
  • llmModel : 使用するOllamaモデル(例:"deepseek-r1:1.5b"、"llama3.2")
  • searchApi : 使用する検索 API ("perplexity" または "tavily")

研究パラメータを設定します。

{ "name": "configure", "arguments": { "maxLoops": 3, "llmModel": "deepseek-r1:1.5b", "searchApi": "tavily" } }

研究

Web 検索と LLM 統合を使用して、あらゆるトピックを調査します。

{ "name": "research", "arguments": { "topic": "Austin LangChain, aimug.org" } }

ステータスを取得する

進行中の研究の現在の状況を取得します。

{ "name": "get_status", "arguments": { "_dummy": "dummy" } }

促す

デフォルトの検索 API、モデル、最大反復回数(ループ)の使用

プロンプトの例:「AIファーストのアプリケーションの研究」

デフォルト設定を変更して調査を開始する

構文: configure with <searchapi> and <model> then research <topic>
プロンプトの例:「perplexity と deepseek-r1:8b を設定して、AI ファースト アプリケーションを調査します」

Ollamaリサーチワークフロー

この研究プロセスはIterDRAGに着想を得ています。このアプローチでは、クエリをサブクエリに分解し、それぞれのサブクエリに対応するドキュメントを取得し、サブクエリに回答した後、その回答に基づいて2番目のサブクエリに対応するドキュメントを取得します。

プロセスは次のように機能します。

  1. ユーザーが指定したトピックに基づいて、ローカル LLM ( Ollama経由) を使用して Web 検索クエリを生成します。
  2. 検索エンジン( Tavily用に構成)を使用して関連するソースを検索します
  3. LLM を使用して、ユーザーが提供した研究トピックに関連する Web 検索からの結果を要約します。
  4. 次に、LLMを使用して要約を振り返り、知識のギャップを特定します。
  5. 知識ギャップを埋めるために新しい検索クエリを生成する
  6. このプロセスは繰り返され、要約はウェブ検索からの新しい情報で繰り返し更新されます。
  7. 研究のウサギの穴に落ちて繰り返すことになる
  8. 設定可能な反復回数だけ実行します

出力

出力は、研究プロセス中に使用されたすべてのソースへの引用を含む、研究概要を含むマークダウン ファイルです。

調査中に収集されたすべてのソースは保存され、最終出力で参照できます。

システム統合の概要

トラブルシューティング

発生する可能性のある一般的な問題に対する解決策は次のとおりです。

Ollama 接続の問題

  • Ollamaが実行中であることを確認する: ターミナルでollama listを実行します
  • アプリ(システムトレイ/メニューバー)を閉じて、ターミナルモードでollamaを実行してみてください。そしてollama serveを実行します。
  • Ollamaがlocalhost:11434``0.0.0.0:11434 、または127.0.0.1:11434でアクセス可能か確認します。

APIキーの問題

  • 設定ファイルにAPIキーが正しく設定されていることを確認してください
  • パス引数がこのリポジトリ内のindex.jsの実際の場所を指していることを確認してください
  • APIキーの周囲に余分なスペースや引用符がないことを確認してください
  • APIキーに十分なクレジット/権限があるかどうかを確認してください

MCP サーバーの問題

  • デバッグには MCP インスペクタを使用します。
npx @modelcontextprotocol/inspector node path/to/server/index.js --model llama3.2 --max-loops 3 --search-api tavily

Dockerの問題

  • Docker コンテナに問題がある場合:
    • コンテナが実行中かどうか確認する: docker ps
    • コンテナログの表示: docker logs ollama-deep-researcher-mcp
    • .envファイルに有効な API キーが含まれていることを確認してください
    • Ollamaがホストマシン上で実行されており、コンテナからアクセスできることを確認します。
    • host.docker.internal が機能しない場合は、OLLAMA_BASE_URL 環境変数でホストマシンの IP アドレスを使用してみてください。
    • コンテナ間のネットワークの問題については、同じDockerネットワーク上にあることを確認してください。
  • コンテナ内で Ollama を実行している場合:
    • docker-compose.yml 内の Ollama サービスのコメントを解除します。
    • Ollamaコンテナに十分なリソースが割り当てられていることを確認する
    • Ollama コンテナ内のモデルをプルします: docker exec -it ollama ollama pull deepseek-r1:8b

ビルドの問題

  • npm run build 「'node' が認識されません」というエラーで失敗した場合:
    1. Node.jsが正しくインストールされていることを確認する
    2. システム PATH に Node.js を追加します。
      • Windows: システム環境変数の編集 → 環境変数 → パス → Node.jsインストールディレクトリの追加
      • macOS/Linux: 通常はインストーラーによって処理されます
    3. 端末/コンピュータを再起動します
    4. インストールを確認するには、 node --versionを実行してみてください。

Pythonの問題

ウィンドウズ:

  • PythonがPATHにあることを確認する
  • python3の代わりにpythonを使ってみてください
  • pipがインストールされているかどうかを確認します: python -m pip --version

macOS/Linux:

  • pythonの代わりにpython3使用する
  • pipがインストールされているかどうかを確認します: python3 -m pip --version
  • pip をインストールする必要がある場合があります: sudo apt install python3-pip (Ubuntu/Debian) またはbrew install python3 (macOS)

エラー処理

サーバーは、次の場合に明確なエラー メッセージを提供します。

  • APIキーが見つからないか無効です
  • 構成の問題
  • 検索APIの問題
  • LLM処理エラー

必要な機能強化

  • 追加の興味深いユースケースのための langgraph のより緊密な再統合と検証。

建築

サーバーのアーキテクチャと実装の詳細については、 .context/index.mdを参照してください。

Glama.ai バッジ

プロンプトと出力のトランスクリプトの例

プロンプト

Configure with perplexity and deepseek-r1:8b then research AI-First Applications

構成出力

{ "searchApi": "perplexity", "llmModel": "deepseek-r1:8b", "maxLoops": 3 }

オラマ研究者の成果

Research configuration updated: Max Loops: 3 LLM Model: deepseek-r1:8b Search API: perplexity ### Complete Research Results **Updated Summary: AI-First Applications in Healthcare: Focus on PathAI** 1. **Design Principles**: - PathAI exemplifies a data-driven approach by leveraging extensive datasets to train advanced AI models like PLUTO. - Collaboration is central to their success, integrating technology into clinical workflows through partnerships with institutions such as Cleveland Clinic. 2. **Industry Transformations**: - In healthcare, PathAI has significantly impacted diagnostic accuracy and efficiency. Their foundation model, PLUTO, demonstrates superior performance in various pathology tasks, outperforming existing models while reducing costs. - Collaborations with leading institutions have facilitated the creation of digital pathology data networks, enhancing research and clinical care. 3. **Scalability and Performance**: - PathAI's PLUTO model offers enhanced efficiency and compactness, significantly reducing training and inference costs. - This innovation underscores their commitment to scalable and effective solutions in healthcare. 4. **Growth and Impact**: - PathAI's growth strategy includes strategic partnerships and collaborations, such as their partnership with Cleveland Clinic and acquisition by Quest Diagnostics. - These moves accelerate AI and digital pathology adoption, particularly in cancer diagnosis. This summary highlights PathAI's contributions to healthcare through innovative technology and strategic collaborations, emphasizing their role in driving advancements and improving patient outcomes. ## Sources ### Perplexity Search 1 1. https://intelifaz.com/insights/ai-first-software-design 2. https://www.uxdesigninstitute.com/blog/how-to-design-for-ai-first-products/ 3. https://vux.world/ai-design-principles/ 4. https://www.leanware.co/insights/ai-first-apps 5. https://adamfard.com/blog/ai-ux-design-framework 6. https://www.sgh.com/insight/artificial-intelligence-best-practices/ 7. https://www.index.dev/blog/generative-ai-application-design-principles 8. https://onstrategyhq.com/resources/ai-guiding-principles/ 9. https://orangematter.solarwinds.com/2024/04/29/introducing-ai-by-design-principles-for-responsible-ai/ 10. https://principles.design/examples/10-principles-for-design-in-the-age-of-ai ### Perplexity Search 2 1. https://cloud.google.com/transform/101-real-world-generative-ai-use-cases-from-industry-leaders 2. https://www.cloudera.com/resources/the-art-of-the-possible/ai-first-benefits-5-real-world-outcomes.html 3. https://builtin.com/artificial-intelligence/examples-ai-in-industry 4. https://www.uxforai.com/p/the-rise-of-ai-first-products 5. https://www.1051theblaze.com/ai-first-mobile-apps/ 6. https://www.techtarget.com/searchenterpriseai/tip/The-history-of-artificial-intelligence-Complete-AI-timeline 7. https://gitnation.com/contents/demystifying-ai-first-building-applications-for-the-future 8. https://fptsoftware.com/resource-center/blogs/the-ai-first-future-challenges-and-opportunities 9. https://online.maryville.edu/blog/history-of-ai/ 10. https://www.audience.io/blog/artificial-intelligence-first-party-data-the-future-of-data ### Perplexity Search 3 1. https://monday.com/blog/rnd/technical-specification/ 2. https://softwaremind.com/blog/8-steps-for-successful-software-implementation/ 3. https://www.infotech.com/research/ss/build-your-enterprise-application-implementation-playbook 4. https://interactiveimmersive.io/blog/touchdesigner-lessons/04-technical-implementation-design/ 5. https://www.indeed.com/career-advice/finding-a-job/technical-requirements 6. https://www.techtarget.com/searchcustomerexperience/definition/implementation 7. https://theobogroup.com/what-to-know-about-technical-implementations/ 8. https://www.ntietz.com/blog/whats-behind-just-implementation/ 9. https://public.cyber.mil/stigs/ ### Perplexity Search 4 1. https://www.ittbiomed.com/transforming-pathology-with-ai/ 2. https://www.pathai.com/resources/pathai-commences-new-year-with-strong-foundation-for-growth-following-key-2023-achievements-in-ai-powered-pathology-products-strategic-partnerships-and-leadership-team-hires/ 3. https://canvasbusinessmodel.com/blogs/target-market/pathai-target-market 4. https://www.pathologynews.com/industry-news/pathai-launches-new-pathologist-centric-features-on-aisight-to-enable-efficient-case-review-through-intelligent-case-prioritization-and-real-time-multi-institutional-collaboration/ 5. https://newsroom.clevelandclinic.org/2022/03/10/pathai-and-cleveland-clinic-announce-collaboration-to-build-digital-pathology-infrastructure-and-evolve-use-of-ai-powered-pathology-algorithms-in-research-and-clinical-care 6. https://academic.oup.com/jamia/article/30/9/1503/7174318 7. https://hitconsultant.net/2024/05/14/pathai-unveils-ai-foundation-model-built-for-disease-detection/ 8. https://newsroom.questdiagnostics.com/2024-05-01-Quest-Diagnostics-to-Acquire-PathAI-Diagnostics-to-Accelerate-AI-and-Digital-Pathology-Adoption-in-Cancer-Diagnosis-Forms-Licensing-Agreements-with-PathAI 9. https://www.multimodal.dev/post/ai-in-healthcare 10. https://canvasbusinessmodel.com/blogs/growth-strategy/pathai-growth-strategy

クロード最終出力

Key Principles of AI-First Applications: 1. Human-AI Collaboration - Applications are designed with AI as a core component rather than an add-on - Focus on augmenting human capabilities rather than replacing them - Clear feedback loops between AI systems and human users 2. Data-Centric Architecture - Built around robust data pipelines and continuous learning - Strong emphasis on data quality and governance - Scalable infrastructure to handle growing datasets 3. Adaptive User Experience - Interfaces that evolve based on user interaction patterns - Contextual awareness and personalization - Clear communication of AI capabilities and limitations Real-World Example: PathAI in Healthcare Core Technology: - PLUTO foundation model demonstrates superior performance in pathology tasks - Focuses on efficiency and cost reduction while maintaining high accuracy - Built for scalability and integration into existing workflows Implementation Strategy: - Strategic partnerships with healthcare institutions like Cleveland Clinic - Creation of digital pathology data networks - Focus on practical clinical applications and research Impact: - Improved diagnostic accuracy in cancer detection - Enhanced efficiency in pathology workflows - Reduced costs through optimized resource utilization Best Practices for AI-First Applications: 1. Technical Implementation - Start with clear use cases and success metrics - Build robust data pipelines and validation processes - Implement continuous monitoring and model updating 2. User Experience - Design transparent interfaces that build trust - Provide clear feedback on AI decisions and confidence levels - Allow for human oversight and intervention 3. Integration and Scaling - Focus on seamless integration with existing workflows - Build scalable infrastructure from the start - Plan for continuous improvement and iteration

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

これは、LangChain Ollama Deep Researcherのモデルコンテキストプロトコル(MCP)サーバーへの適応です。モデルコンテキストプロトコルエコシステム内で利用可能なMCPツールとしてディープリサーチ機能を提供し、AIアシスタントがOllamaを介してトピック(ローカル)に関する詳細なリサーチを実行できるようにします。

  1. Core Functionality
    1. Research Process
  2. Prerequisites
    1. Installation
      1. Option 1: Standard Installation
      2. Option 2: Docker Installation
    2. Client Configuration
      1. Option 1: Standard Installation Configuration
      2. Option 2: Docker Installation Configuration
    3. Tracing and Monitoring
      1. MCP Resources
        1. Available Tools
          1. Configure
          2. Research
          3. Get status
        2. Prompting
          1. Using the Default Search API, Model, and Max Iterations (loops)
          2. Change Default Config and Start Research
        3. The Ollama Research Workflow
          1. Outputs
          2. System Integration Overview
          3. Troubleshooting
          4. Error Handling
          5. Enhancements Needed
          6. Architecture
          7. Glama.ai Badge
        4. Example Prompt and Output Transcript
          1. Prompt
          2. Configuration Output
          3. Ollama Researcher Output
        5. Claude Final Output
          ID: r25ssxqoci