Langgraph Deep Search MCP Server
An MCP server that utilizes LangGraph and Google Gemini to conduct comprehensive research through multi-iteration deep searches and quick results. It provides high-quality analysis with automated citations and grounding metadata for thorough investigations.
README
Langgraph Deep Search MCP Server
Google Gemini公式実装をベースにしたLangGraphのAIエージェントを使用して包括的な調査を実行します。
🎯 実装について
Langgraph Implementation
- 完全にGoogleの公式実装をベース
- Gemini 2.5 Flashのネイティブ検索機能使用
- LangGraphによる状態管理とワークフロー
- grounding metadataによる自動引用
🌟 機能
- Deep Search: 複数回の検索イテレーションによる包括的な調査
- Quick Search: 単発検索による迅速な結果取得
- Gemini Native Search: Gemini 2.5 Flashのネイティブ検索機能を使用した高品質な検索
- AI Analysis: Gemini 2.5 Proを使用した結果の分析と統合
- MCP Integration: Model Context Protocolによる外部アプリケーションとの統合
- 自動引用: grounding metadataによる自動的なソース情報取得
🚀 クイックスタート
方法1: uvx使用 (推奨)
# 1. プロジェクトのクローン
git clone https://github.com/RyotaOzawa0/langgraph-deepsearch-mcp.git
cd deep-search-mcp-server
# 2. 環境変数設定
export GEMINI_API_KEY=your_gemini_api_key_here
# 3. MCPサーバー起動
uvx --from . langgraph-deep-search
方法2: 手動セットアップ
# 1. プロジェクトのクローン
git clone <repository-url>
cd deep-search-mcp-server
# 2. 依存関係インストール
uv sync
# 3. 環境変数設定
export GEMINI_API_KEY=your_gemini_api_key_here
# 4. MCPサーバー起動
python gemini_server.py
📋 詳細インストール手順
前提条件
- Python 3.10以上
- uv (推奨) または pip
手動インストール
# 1. リポジトリをクローン
git clone <repository-url>
cd deep-search-mcp-server
# 2. uvでプロジェクトセットアップ
uv sync
uv pip install -e .
# 3. 環境変数設定
cp .env.example .env
# .envファイルを編集してAPIキーを設定
# 4. テスト実行
uv run python gemini_server.py
API キー
- GEMINI_API_KEY: Gemini API (必須) - Google AI Studioから取得
🛠 使用方法
自然言語入力例
MCPサーバーがClaude DesktopなどのMCPホストに接続されると、以下のような自然言語でリサーチを依頼できます:
包括的な調査 (deep_search)
「React状態管理ライブラリを包括的に比較調査して」
「Terraformベストプラクティスを深く調べて」
迅速な検索 (quick_search)
「Claude Codeの使用感・評判を速攻で調査して」
「Devinの最新アプデをサクッと検索して」
サーバー状態確認
「検索ツールの状態を確認してください」
「MCPサーバーの設定情報を教えてください」
MCP Tools (開発者向け)
deep_search
包括的な調査を実行します。
パラメータ:
query(str): 調査したいトピックmax_iterations(int, default=3): 最大イテレーション回数max_results_per_query(int, default=5): クエリごとの最大結果数language(str, default="en"): 検索言語
quick_search
単発検索による迅速な結果取得。
get_search_tools
利用可能な検索ツールの状態を確認。
MCP Resources
search-config
サーバーの設定情報と利用可能なツールの状態を取得。
主要コンポーネント
- GoogleSearchManager: Google検索の統合管理
- DeepResearchGraph: LangGraphによる調査ワークフロー
- FastMCP Server: MCPプロトコルでのツール公開
🔧 Claude Desktop連携
uvxを使用した設定
claude_desktop_config.jsonに以下を追加:
{
"mcpServers": {
"langgraph-deep-search": {
"command": "uvx",
"args": ["--from", "/path/to/deep-search-mcp-server", "langgraph-deep-search"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
uv run使用での設定
{
"mcpServers": {
"langgraph-deep-search": {
"command": "uv",
"args": ["run", "--directory", "/path/to/deep-search-mcp-server", "python", "gemini_server.py"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
直接実行での設定
{
"mcpServers": {
"langgraph-deep-search": {
"command": "python",
"args": ["/path/to/deep-search-mcp-server/gemini_server.py"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key"
}
}
}
}
開発モード
# MCP Inspector付きで開発
mcp dev gemini_server.py
🔍 トラブルシューティング
よくあるエラー
-
ModuleNotFoundError: No module named 'mcp':
- 解決策:
uv syncで依存関係をインストール - または:
uv run python gemini_server.pyを使用
- 解決策:
-
Agent not initialized:
- 解決策:
GEMINI_API_KEY環境変数を設定
- 解決策:
-
Process exited with code 1:
- 解決策: 絶対パスと
uv runを使用 - WSLの場合:
uv run python gemini_server.pyを含むコマンドを使用
- 解決策: 絶対パスと
-
Import errors:
- 解決策:
uv syncで依存関係をインストール
- 解決策:
ログ確認
サーバー実行時にコンソールに出力されるログで状態を確認できます。
デバッグモード
# 詳細ログ付きで実行
mcp dev gemini_server.py
📄 ライセンス
MIT License
🤝 貢献
- Forkしてfeatureブランチを作成
- 変更をcommit
- Pull Requestを作成
📚 参考
- Model Context Protocol
- MCP Python SDK - 公式Python SDK
- LangGraph
- Gemini Fullstack LangGraph Quickstart
- MCP Server Development Guide
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.