MCP サーバー: Ollama Deep Researcher
これは、LangChain Ollama Deep Researcherのモデルコンテキストプロトコル(MCP)サーバー版です。モデルコンテキストプロトコルエコシステム内で利用可能なMCPツールとしてディープリサーチ機能を提供し、AIアシスタントがOllamaを介してローカルLLMを用いてトピックに関する詳細なリサーチを実行できるようにします。
コア機能
サーバーは、 Ollamaがホストする任意の LLM を使用して、MCP ツールとリソースを通じて研究機能を提供します。
研究プロセス
トピックを指定すると、次のようになります。
ウェブ検索クエリを生成する
TavilyまたはPerplexity API経由でウェブ検索結果を収集する
検索結果を要約する
要約を振り返り、知識のギャップを調べる
ギャップを埋めるための新しい検索クエリを生成する
複数の調査サイクルを通じて要約を反復的に改善する
使用したすべてのソースを含む最終的なマークダウンの概要を提供する

Related MCP server: MCP Ollama Server
前提条件
ターミナル/コマンドプロンプトからNode.jsとnpmが実行できることを確認してください。インストールは次のコマンドで確認できます。
node --version
npm --version
python --version
これらのコマンドが失敗した場合は、次の操作が必要になる可能性があります。
インストール後に端末/コンピュータを再起動してください
システム PATH に Node.js を追加します。
インストール
オプション1: 標準インストール
お使いのプラットフォームにOllamaをダウンロードしてインストールします
このリポジトリをクローンし、依存関係をインストールします。
git clone https://github.com/Cam10001110101/mcp-server-ollama-deep-researcher
cd mcp-server-ollama-deep-researcher
npm install
Python の依存関係をインストールします。
まず、uv をインストールします (パフォーマンスと依存関係の解決を向上させるために推奨されます)。
# Windows
pip install uv
# macOS/Linux
pip3 install uv
次に、pyproject.toml を使用してプロジェクトの依存関係をインストールします。
注: これにより、pyproject.toml で指定されたすべての依存関係を含む、編集可能なモードでプロジェクトがインストールされます。pip を使用する場合は、以下のコマンドを実行します。
pip install . # Windows
pip3 install . # macOS/Linux
TypeScript コードをビルドします。
Ollamaからローカル LLM を取得します。
ollama pull deepseek-r1:8b
オプション2: Dockerのインストール
Docker を使用して MCP サーバーを実行することもできます。これにより、セットアップ プロセスが簡素化されます。
お使いのプラットフォーム用のDockerをダウンロードしてインストールします
このリポジトリをクローンします:
git clone https://github.com/Cam10001110101/mcp-server-ollama-deep-researcher
cd mcp-server-ollama-deep-researcher
API キーを使用して.envファイルを作成します ( .env.exampleからコピーできます)。
cp .env.example .env
# Edit the .env file with your API keys
ヘルパー スクリプトを実行可能にします。
Docker コンテナをビルドして実行します。
ホストマシン上で 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 デスクトップ アプリの場合:
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"
}
}
}
}
注: パスをシステムの絶対パスに置き換えてください。
macOS/Linux の場合は、以下も追加する必要があります。
オプション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 と統合され、研究プロセスの包括的な追跡と監視を実現します。
操作追跡:
すべてのLLMインタラクションがトレースされる
ウェブ検索操作は監視されている
研究ワークフローのステップが追跡される
パフォーマンス監視:
デバッグと最適化:
トラブルシューティングのための詳細なトレース
パフォーマンスのボトルネックの特定
クエリ最適化の洞察
設定したプロジェクト名でhttps://smith.langchain.comにあるすべてのトレースにアクセスします。
MCPリソース
研究結果は MCP リソースとして自動的に保存され、次のことが可能になります。
永続アクセス
リソースパネルの統合
コンテキスト管理
会話の中での研究の効率的な再利用
リソース参照によるトークン使用量の削減
研究文脈の選択的包含
利用可能なツール
設定
研究パラメータを設定します。
{
"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番目のサブクエリに対応するドキュメントを取得します。
プロセスは次のように機能します。
ユーザーが指定したトピックに基づいて、ローカル LLM ( Ollama経由) を使用して Web 検索クエリを生成します。
検索エンジン( Tavily用に構成)を使用して関連するソースを検索します
LLM を使用して、ユーザーが提供した研究トピックに関連する Web 検索からの結果を要約します。
次に、LLMを使用して要約を振り返り、知識のギャップを特定します。
知識ギャップを埋めるために新しい検索クエリを生成する
このプロセスは繰り返され、要約はウェブ検索からの新しい情報で繰り返し更新されます。
研究のウサギの穴に落ちて繰り返すことになる
設定可能な反復回数だけ実行します
出力
出力は、研究プロセス中に使用されたすべてのソースへの引用を含む、研究概要を含むマークダウン ファイルです。
調査中に収集されたすべてのソースは保存され、最終出力で参照できます。
システム統合の概要
graph TD
subgraph "Claude Desktop App"
A[Claude Assistant] --> B[Task Planning]
B --> C[Tool Selection]
C --> D[Resource Selection]
D --> E[Prompt Templates]
end
subgraph "MCP Client Layer"
F[Tool Registry] --> G[Protocol Handler]
G --> H[Server Manager]
I[Resource Manager] --> G
J[Prompt Manager] --> G
end
subgraph "MCP Server"
K[Tools API] --> L[Research Controller]
L --> M[Configuration Manager]
L --> N[State Manager]
O[Resource API] --> L
P[Prompt API] --> L
end
subgraph "External Services"
Q[Ollama] --> L
R[Search APIs] --> L
end
%% Feature Support Flow
C -->|"use_mcp_tool"| F
D -->|"access_resource"| I
E -->|"use_prompt"| J
H -->|"Execute"| K
H -->|"Read"| O
H -->|"Get"| P
%% Status Flow
L -->|"Results"| H
H -->|"Response"| C
%% Feature Support Notes
classDef support fill:#e1f3d8,stroke:#333
classDef partial fill:#fff3cd,stroke:#333
%% Full Support Features
A:::support
F:::support
I:::support
J:::support
トラブルシューティング
発生する可能性のある一般的な問題に対する解決策は次のとおりです。
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 サーバーの問題
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
ビルドの問題
Pythonの問題
ウィンドウズ:
macOS/Linux:
エラー処理
サーバーは、次の場合に明確なエラー メッセージを提供します。
APIキーが見つからないか無効です
構成の問題
検索APIの問題
LLM処理エラー
必要な機能強化
建築
サーバーのアーキテクチャと実装の詳細については、 .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