Deep Research MCP Serverのロゴ

Deep Research MCP Server

コミュニティ
lkk989

Your AI-Powered Research Assistant. Conduct iterative, deep research using Google Gemini 2.5 Flash with Google Search Grounding and URL context. No web-scraping dependency is required.

公開者lkk989
リポジトリDeep-Research-MCP-Server
言語TypeScript
フォーク
0
スター
16
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Deep Research MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには16件のスターと0件のフォークがあります。

Deep Research MCP Server

Node.js TypeScript Gemini API MCP License: MIT

Your AI-Powered Research Assistant. Conduct iterative, deep research using Google Gemini 2.5 Flash with Google Search Grounding and URL context. No web-scraping dependency is required.


Table of Contents

The goal of this project is to provide the simplest yet most effective implementation of a deep research agent. It's designed to be easily understood, modified, and extended, aiming for a codebase under 500 lines of code (LoC).

Key Features:

  • MCP Integration: Runs as a Model Context Protocol (MCP) server/tool for seamless agent integration.
  • Gemini 2.5 Flash Pipeline: Long-context reasoning, structured JSON outputs, and tool use (Google Search Grounding, Code Execution, Functions) via env flags.
  • Iterative Deep Dive: Query refinement + result analysis with learned context carried forward.
  • Depth & Breadth Control: Tune exploration scope precisely.
  • Semantic/Recursive Splitting: Token-aware chunking for robust summarization and analysis.
  • Batching + Caching: Concurrency-limited batched model calls with LRU caches across prompts/results.
  • Professional Reports: Generates structured Markdown (Abstract, ToC, Intro, Body, Methodology, Limitations, Key Learnings, References).

Why This Project

  • Gemini-first, modern pipeline: Built around Gemini 2.5 Flash with optional tools (Search Grounding, Code Execution, Functions).
  • Minimal, understandable core: Plain TypeScript; easy to audit and extend.
  • Deterministic outputs: Zod-validated JSON and consistent report scaffolding.
  • Agent-ready: Clean MCP server entry; works with Inspector and MCP-aware clients.

Workflow Diagram

Persona Agents

What are Persona Agents?

In deep-research, we utilize the concept of "persona agents" to guide the behavior of the Gemini language models. Instead of simply prompting the LLM with a task, we imbue it with a specific role, skills, personality, communication style, and values. This approach helps to:

  • Focus the LLM's Output: By defining a clear persona, we encourage the LLM to generate responses that are aligned with the desired expertise and perspective.
  • Improve Consistency: Personas help maintain a consistent tone and style throughout the research process.
  • Enhance Task-Specific Performance: Tailoring the persona to the specific task (e.g., query generation, learning extraction, feedback) optimizes the LLM's output for that stage of the research.

Examples of Personas in use:

  • Expert Research Strategist & Query Generator: Used for generating search queries, this persona emphasizes strategic thinking, comprehensive coverage, and precision in query formulation.
  • Expert Research Assistant & Insight Extractor: When processing web page content, this persona focuses on meticulous analysis, factual accuracy, and extracting key learnings relevant to the research query.
  • Expert Research Query Refiner & Strategic Advisor: For generating follow-up questions, this persona embodies strategic thinking, user intent understanding, and the ability to guide users towards clearer and more effective research questions.
  • Professional Doctorate Level Researcher (System Prompt): This overarching persona, applied to the main system prompt, sets the tone for the entire research process, emphasizing expert-level analysis, logical structure, and in-depth investigation.

By leveraging persona agents, deep-research aims to achieve more targeted, consistent, and high-quality research outcomes from the Gemini language models.

How It Works

Core modules:

  • src/deep-research.ts — orchestrates queries, batching, analysis, and synthesis
    • generateSerpQueries() uses Gemini to propose SERP-style queries from your prompt and prior learnings
    • processSerpResult() splits content, batches Gemini calls with tools enabled, extracts learnings and citations
    • conductResearch() runs analysis passes over semantic chunks
    • writeFinalReport() builds the final professional Markdown report
  • src/ai/providers.ts — GoogleGenAI wrapper for Gemini 2.5 Flash, batching, token control, optional tools
  • src/ai/text-splitter.ts — RecursiveCharacter and Semantic splitters
  • src/mcp-server.ts — MCP server entry point and types
  • src/run.ts — CLI entry point

Pipeline highlights:

  • Structured JSON outputs validated with Zod
  • Concurrency-limited batching (generateBatch, generateBatchWithTools)
  • LRU caches for prompts, SERP proposals, and reports
  • Optional Gemini tools via flags: Google Search Grounding, Code Execution, Functions

Project Structure

text
deep-research-mcp-server/
├─ src/
│  ├─ ai/
│  │  ├─ providers.ts           # Gemini wrapper, tools, batching, caching
│  │  └─ text-splitter.ts       # Semantic/recursive splitters
│  ├─ mcp-server.ts             # MCP server entry/types
│  ├─ deep-research.ts          # Orchestrator: queries → analysis → synthesis
│  ├─ prompt.ts                 # System + templates
│  ├─ feedback.ts               # Refinement/feedback loop
│  ├─ output-manager.ts         # Report/output formatting
│  ├─ progress-manager.ts       # CLI progress
│  ├─ terminal-utils.ts         # CLI helpers
│  ├─ types.ts                  # Zod schemas/types
│  └─ utils/                    # JSON/sanitize helpers
├─ dist/                        # Build output
├─ .env.example                 # Environment template
├─ package.json                 # Scripts/deps
└─ README.md

Requirements

Setup

Node.js

  1. Clone the repository:

    bash
    git clone [your-repo-link-here]
  2. Install dependencies:

    bash
    npm install
  3. Set up environment variables: Create a .env.local file in the project root:

    bash
    # Required
    GEMINI_API_KEY="your_gemini_key"
    
    # Recommended defaults
    GEMINI_MODEL=gemini-2.5-flash
    GEMINI_MAX_OUTPUT_TOKENS=65536
    CONCURRENCY_LIMIT=5
    
    # Gemini tools (enable as needed)
    ENABLE_GEMINI_GOOGLE_SEARCH=true
    ENABLE_GEMINI_CODE_EXECUTION=false
    ENABLE_GEMINI_FUNCTIONS=false
  4. Build the project:

    bash
    npm run build

Usage

As MCP Tool

To run deep-research as an MCP tool, start the MCP server:

bash
node --env-file .env.local dist/mcp-server.js

You can then invoke the deep-research tool from any MCP-compatible agent using the following parameters:

  • query (string, required): The research query.
  • depth (number, optional, 1-5): Research depth (default: moderate).
  • breadth (number, optional, 1-5): Research breadth (default: moderate).
  • existingLearnings (string[], optional): Pre-existing research findings to guide research.

Example MCP Tool Arguments (JSON shape):

json
{
  "name": "deep-research",
  "arguments": {
    "query": "State of multi-agent research agents in 2025",
    "depth": 3,
    "breadth": 3,
    "existingLearnings": [
      "Tool use improves grounding",
      "Batching reduces latency"
    ]
  }
}
typescript
const mcp = new ModelContextProtocolClient(); // Assuming MCP client is initialized

async function invokeDeepResearchTool() {
  try {
    const result = await mcp.invoke("deep-research", {
      query: "Explain the principles of blockchain technology",
      depth: 2,
      breadth: 4
    });

    if (result.isError) {
      console.error("MCP Tool Error:", result.content[0].text);
    } else {
      console.log("Research Report:\n", result.content[0].text);
      console.log("Sources:\n", result.metadata.sources);
    }
  } catch (error) {
    console.error("MCP Invoke Error:", error);
  }
}

invokeDeepResearchTool();

Standalone CLI Usage

To run deep-research directly from the command line:

bash
npm run start "your research query"

Example:

bash
npm run start "what are latest developments in ai research agents"

MCP Inspector Testing

For interactive testing and debugging of the MCP server, use the MCP Inspector:

bash
npx @modelcontextprotocol/inspector node --env-file .env.local dist/mcp-server.js

MCP Integration Tips

  • Environment: Provide GEMINI_API_KEY to the MCP server process; model and tool flags via env.
  • Stateless calls: The server derives behavior from env; keep flags in sync with your client profile.
  • Latency: Enable batching and reasonable CONCURRENCY_LIMIT to balance speed vs rate limits.

Configuration

  • GEMINI_API_KEY — required
  • GEMINI_MODEL — defaults to gemini-2.5-flash
  • GEMINI_MAX_OUTPUT_TOKENS — defaults to 65536
  • CONCURRENCY_LIMIT — defaults to 5
  • ENABLE_GEMINI_GOOGLE_SEARCH — enable Google Search Grounding tool
  • ENABLE_GEMINI_CODE_EXECUTION — enable code execution tool
  • ENABLE_GEMINI_FUNCTIONS — enable function calling

Optional providers (planned/behind flags): Exa/Tavily can be integrated later; Firecrawl is not required for the current pipeline.

Quickstart

  1. Clone and install
bash
git clone https://github.com/ssdeanx/deep-research-mcp-server
cd deep-research-mcp-server
npm i && npm run build
  1. Create .env.local (see Setup)

  2. Run as MCP server (Inspector)

bash
npx @modelcontextprotocol/inspector node --env-file .env.local dist/mcp-server.js
  1. Or run as CLI
bash
npm run start "state of multi-agent research agents in 2025"

Example Output

markdown
# Abstract
Concise overview of the research goal, scope, method, and key findings.

# Table of Contents
...

# Introduction
Context and framing.

# Body
Evidence-backed sections with citations.

# Methodology
How sources were found and analyzed.

# Limitations
Assumptions and risks.

# Key Learnings
Bulleted insights and takeaways.

# References
Normalized citations to visited URLs.

Support

  • Issues: Use GitHub Issues for bugs and feature requests.
  • Discussions: Propose ideas or ask questions.
  • Security: Do not file public issues for sensitive disclosures; contact maintainers privately.

Contributing

  • PRs welcome: Please open an issue first for significant changes.
  • Standards: TypeScript 5.x, Node.js 22.x, lint/type-check before PRs.
  • Checks: npm run build and tsc --noEmit must pass.
  • Docs: Update README.md and .env.example when changing env/config.

Roadmap

  • Exa search integration (behind ENABLE_EXA_PRIMARY), Google grounding for augmentation.
  • Provider cleanup: Remove Firecrawl after Exa migration (explicit approval required).
  • CI/CD: Add GitHub Actions for build/lint/test and badge.
  • Examples: Add sample reports and prompts.

Troubleshooting

  • Missing API key: Ensure GEMINI_API_KEY is set in .env.local and processes are started with --env-file .env.local.
  • Model/tool flags: If grounding or functions aren’t active, verify ENABLE_GEMINI_GOOGLE_SEARCH, ENABLE_GEMINI_CODE_EXECUTION, ENABLE_GEMINI_FUNCTIONS.
  • Rate limits/latency: Lower CONCURRENCY_LIMIT (e.g., 3) or rerun with fewer simultaneous queries.
  • Output too long: Reduce depth/breadth or lower GEMINI_MAX_OUTPUT_TOKENS.
  • Schema parse errors: Rerun; the pipeline validates/repairs JSON, but extreme prompts may exceed budgets—trim prompt or reduce chunk size.

License

MIT License - Free and Open Source. Use it freely!


🚀 Let's dive deep into research! 🚀

Recent Improvements (v0.3.0)

✨ Highlights of the latest changes. See also Roadmap.

  • ✅ Input validation: Minimum 10 characters + 3 words
  • 📈 Output validation: Citation density (1.5+ per 100 words)
  • 🔍 Recent sources check (3+ post-2019 references)
  • ⚖️ Conflict disclosure enforcement
  • Consolidated on Gemini 2.5 Flash (long-context, structured JSON)
  • Optional tools via env flags: Search Grounding, Code Execution, Functions
  • Semantic + recursive splitting for context management
  • Robust batching with concurrency control and caching
  • Enhanced context management via semantic search
  • Improved error handling and logging
  • 🚀 Added concurrent processing pipeline
  • Removed redundant academic-validators module
  • 🛡️ Enhanced type safety across interfaces
  • 📦 Optimized dependencies (≈30% smaller node_modules)
  • 📊 Research metrics tracking (sources/learnings ratio)

Performance:

  • 🚀 30% faster research cycles
  • ⚡ 40% faster initial research cycles
  • 📉 60% reduction in API errors
  • 🧮 25% more efficient token usage

インストール

TypingMind
{
  "mcpServers": {
    "deep-research-mcp-server": {
      "command": "node",
      "args": [
        "--env-file",
        ".env.local",
        "dist/mcp-server.js"
      ]
    }
  }
}

Deep Research MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Deep Research MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Deep Research MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Deep Research MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "deep-research-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "deep-research"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてDeep Research MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Deep Research MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Deep Research MCP Serverを使ってこのタスクを手伝ってもらえますか?
Deep Research MCP Server
はい、読みました。
Deep Research MCP Serverで調べた結果をお伝えします。

よくある質問

Deep Research MCP Server MCPサーバーは何に使いますか?

Deep Research MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでDeep Research MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでDeep Research MCP Serverを利用できます。

TypingMindでDeep Research MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Deep Research MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Deep Research MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Deep Research MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでDeep Research MCP Server MCPのどのようなツールを利用できますか?

Deep Research MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Deep Research MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Deep Research MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇