Deep Research MCP
The Deep Research MCP server enables autonomous, AI-powered deep research through three core tools:
deep_research: Submit a research query and receive a comprehensive, structured markdown report with citations. The server decomposes complex queries, conducts real-time web searches, synthesizes findings from multiple sources, and optionally runs code for data analysis and visualization.research_status: Poll the status of a long-running research task using its task ID. Returns the current state (running,completed, orfailed) along with timestamps, so you can monitor multi-hour research jobs without blocking.research_with_context: After initiating a clarification flow, provide answers to clarifying questions along with a session ID. The server uses those answers to build an enriched, more specific query and performs full research on it.
Additional features include:
Request Clarification – Refine vague or broad queries before researching.
Custom System Instructions – Guide research focus and output style.
Webhook Callbacks – Get notified automatically when a long-running task completes.
Toggle Data Analysis – Enable or disable code interpreter tools per request.
Multiple Provider Backends – Works with OpenAI, Gemini Deep Research, DR-Tulu, and Open Deep Research, depending on server configuration.
Integrates with Ollama's local inference server via an OpenAI-compatible endpoint for running research models locally.
Integrates with OpenAI's Responses API for web search and code interpreter, or Chat Completions API for broad provider compatibility, enabling deep research tasks.
Integrates with Perplexity's Sonar Deep Research model via the OpenAI-compatible Chat Completions endpoint for web-connected research.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Deep Research MCPresearch the history and current state of nuclear fusion energy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Deep Research MCP
A Python-based agent that integrates research providers with Claude Code through the Model Context Protocol (MCP). It supports OpenAI (Responses API with web search and code interpreter, Chat Completions API for broad provider compatibility, or experimental ChatGPT subscription access through Codex OAuth), Gemini Deep Research via the Interactions API, Allen AI's DR-Tulu research agent, and the open-source Open Deep Research stack (based on smolagents).
Prerequisites
Python 3.11+
uv installed
One of:
OpenAI API access (Responses API model
gpt-5.6-sol)ChatGPT subscription with Codex access (experimental
openai-codexprovider)Gemini API access with the Interactions API / Deep Research agent enabled
DR-Tulu service running locally or remotely (see DR-Tulu setup)
Open Deep Research dependencies (installed via
uv sync --extra open-deep-research)
Claude Code, or any other assistant supporting MCP integration
Related MCP server: MCP Deep Web Research Server
Installation
Run Without Cloning
With uv and Git installed, run the packaged commands directly from GitHub.
uvx builds an isolated environment and reuses it from the local uv cache:
uvx --from "git+https://github.com/pminervini/deep-research-mcp.git@main" \
deep-research-cli --help
uvx --from "git+https://github.com/pminervini/deep-research-mcp.git@main" \
deep-research-mcp --helpFor reproducible installation, replace main with a release tag or commit SHA.
The openai-codex device login is also available without a checkout:
uvx --from "git+https://github.com/pminervini/deep-research-mcp.git@main" \
deep-research-cli auth loginSource Checkout
Recommended development setup (resolves the latest compatible versions):
# Install runtime dependencies + project in editable mode
uv sync --upgrade
# Development tooling (pytest, black, pylint, mypy, pre-commit)
uv sync --upgrade --extra dev
# Enable the pre-commit hook so black runs automatically before each commit
uv run pre-commit install
# Optional docs tooling
uv sync --upgrade --extra docs
# Optional Open Deep Research provider dependencies
uv sync --upgrade --extra open-deep-researchCompatibility setup (pip-based):
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .Code Layout
src/deep_research_mcp/agent.py: orchestration layer; owns callbacks and delegates provider work to backendssrc/deep_research_mcp/backends/: provider-specific implementations for OpenAI, OpenAI Codex subscription, Gemini, DR-Tulu, and Open Deep Researchsrc/deep_research_mcp/cli.py: installeddeep-research-cliimplementationsrc/deep_research_mcp/mcp_server.py: FastMCP server and tool entrypointscli/deep-research-cli.py: compatibility wrapper for source-checkout usagecli/deep-research-tui.py: interactive full-screen terminal UI for research, status checks, and saving output to disktests/:pytestsuite covering configuration, MCP integration, results, and UI flows
Configuration
Configuration File
Create a ~/.deep_research file in your home directory using TOML format.
Library note: ResearchConfig.load() explicitly reads this file and applies environment variable overrides. ResearchConfig.from_env() reads environment variables only.
Common settings:
[research] # Core Deep Research functionality
provider = "openai" # Available options: "openai", "openai-codex", "dr-tulu", "gemini", "open-deep-research" -- defaults to "openai"
api_style = "responses" # Only applies to provider="openai"; use "chat_completions" for Perplexity, Groq, Ollama, etc.
model = "gpt-5.6-sol" # OpenAI: model identifier; Codex: "auto" or account model slug; Dr Tulu: logical provider id; Gemini: agent id; ODR: LiteLLM model identifier
api_key = "your-api-key" # API key, optional
base_url = "https://api.openai.com/v1" # OpenAI: OpenAI-compatible endpoint; Codex uses a fixed endpoint; Dr Tulu: service base URL; Gemini: https://generativelanguage.googleapis.com; ODR: LiteLLM-compatible endpoint
# Task behavior
timeout = 1800
poll_interval = 30
cancel_on_timeout = false # When true, cancel the provider task if it exceeds timeout. Default false: the task keeps running and the result can be recovered with research_status
[logging]
level = "INFO"Note on precedence: [research] api_key and base_url map to the RESEARCH_API_KEY and RESEARCH_BASE_URL settings, which apply to every provider except openai-codex. The Codex subscription provider ignores API keys and endpoint overrides so its bearer token cannot be redirected. If you switch another provider via an environment override (e.g. RESEARCH_PROVIDER=openai) while the file is configured for a different provider, also override RESEARCH_API_KEY and RESEARCH_BASE_URL.
OpenAI provider example:
[research]
provider = "openai"
model = "gpt-5.6-sol" # OpenAI model
api_key = "YOUR_OPENAI_API_KEY" # Defaults to OPENAI_API_KEY
base_url = "https://api.openai.com/v1" # OpenAI-compatible endpoint
timeout = 1800
poll_interval = 30OpenAI Codex subscription provider example:
[research]
provider = "openai-codex"
model = "auto" # First picker-visible account model
timeout = 1800Authenticate before starting the CLI or MCP server:
# Recommended: independent device-code session
uv run deep-research-cli auth login
# Optional short-lived import; never copies the Codex refresh token
uv run deep-research-cli auth login --import-codex
uv run deep-research-cli auth statusCredentials are stored independently in ~/.deep_research_auth.json with
owner-only permissions. auth logout removes only this file. Model names are
loaded from the signed-in account's /models catalogue; an explicit model must
be present in that catalogue.
This provider uses the undocumented
https://chatgpt.com/backend-api/codex consumer endpoint. It is not an official
OpenAI API integration and can change or reject third-party clients without
notice. It identifies itself as deep_research_mcp and does not impersonate the
Codex CLI. Review the current OpenAI Terms of
Use before enabling it.
Limitations:
Native web search is enabled, but Code Interpreter is unavailable.
Calls are synchronous SSE streams;
research_status, completed-report recovery, background polling, andcancel_on_timeoutare unavailable.Imported Codex credentials cannot refresh. Run
auth loginwhen the imported access token expires.
Gemini Deep Research provider example:
[research]
provider = "gemini"
model = "deep-research-preview-04-2026" # Gemini Deep Research agent id
api_key = "YOUR_GEMINI_API_KEY" # Defaults to GEMINI_API_KEY or GOOGLE_API_KEY
base_url = "https://generativelanguage.googleapis.com"
timeout = 1800
poll_interval = 30Available Gemini Deep Research agent IDs:
Agent ID | Intended use |
| Faster, more efficient research; this is the project default |
| Maximum comprehensiveness for context gathering and synthesis |
| Older Gemini 3.1 Pro-based preview for accuracy-focused, long-running research |
Google's current Gemini Deep Research documentation
lists the April 2026 standard and Max agents as the supported versions. The
December 2025 Pro agent remains present in the Gemini API model catalogue and
has a separate model page,
but it is no longer listed among the current supported versions. Set any agent
ID above as research.model; all are preview identifiers and may change.
Dr Tulu provider example:
[research]
provider = "dr-tulu"
model = "dr-tulu" # Logical provider model id; currently informational
base_url = "http://localhost:8080/" # Dr Tulu service base URL; the backend calls /chat
api_key = "" # Optional; defaults to RESEARCH_API_KEY / DR_TULU_API_KEY if set
timeout = 1800
poll_interval = 30Running Dr Tulu locally:
Clone and configure
dr-tuluseparately.In
dr-tulu/agent/.env, set at least:SERPER_API_KEYJINA_API_KEYS2_API_KEY(optional but recommended)
Start the DR-Tulu model server:
cd /path/to/dr-tulu/agent
conda run -n vllm bash -lc '
CUDA_VISIBLE_DEVICES=0 \
vllm serve rl-research/DR-Tulu-8B \
--port 30001 \
--dtype auto \
--max-model-len 16384 \
--gpu-memory-utilization 0.60 \
--enforce-eager
'Start the Dr Tulu MCP backend:
cd /path/to/dr-tulu/agent
conda run -n vllm python -m dr_agent.mcp_backend.main --port 8000Start the Dr Tulu app service:
cd /path/to/dr-tulu/agent
conda run -n vllm python workflows/auto_search_sft.py serve \
--port 8080 \
--config workflows/auto_search_sft.yaml \
--config-overrides "search_agent_max_tokens=12000,browse_agent_max_tokens=12000"Point
deep-research-mcpat that service:
[research]
provider = "dr-tulu"
base_url = "http://localhost:8080/"
timeout = 1800The dr-tulu backend calls POST {base_url}/chat, so if you front Dr Tulu behind a different host, port, or reverse proxy, update base_url accordingly.
Perplexity (via Sonar Deep Research and Perplexity's OpenAI-compatible endpoint) provider example:
[research]
provider = "openai"
api_style = "chat_completions" # Required for Perplexity (no Responses API)
model = "sonar-deep-research" # Perplexity's Sonar Deep Research
api_key = "ppl-..." # Defaults to OPENAI_API_KEY
base_url = "https://api.perplexity.ai" # Perplexity's OpenAI-compatible endpoint
timeout = 1800Open Deep Research provider example:
[research]
provider = "open-deep-research"
model = "openai/qwen/qwen3-coder-30b" # LiteLLM-compatible model id
base_url = "http://localhost:1234/v1" # LiteLLM-compatible endpoint (local or remote)
api_key = "" # Optional if endpoint requires it
timeout = 1800Ollama (local) provider example:
[research]
provider = "openai"
api_style = "chat_completions"
model = "llama3.1" # Any model available in your Ollama instance
base_url = "http://localhost:11434/v1" # Ollama's OpenAI-compatible endpoint
api_key = "" # Not required for local Ollama
timeout = 600llama-server (local llama.cpp server) provider example:
[research]
provider = "openai"
api_style = "chat_completions"
model = "qwen2.5-0.5b" # Must match the --alias passed to llama-server
base_url = "http://127.0.0.1:8081/v1" # llama-server OpenAI-compatible endpoint
api_key = "test" # Must match the --api-key passed to llama-server
timeout = 600Generic OpenAI-compatible Chat Completions provider (Groq, Together AI, vLLM, etc.):
[research]
provider = "openai"
api_style = "chat_completions"
model = "your-model-name"
api_key = "your-api-key"
base_url = "https://api.your-provider.com/v1"
timeout = 600Optional env variables for Open Deep Research tools:
SERPAPI_API_KEYorSERPER_API_KEY: enable Google-style searchHF_TOKEN: optional, logs into Hugging Face Hub for gated models
Install The Included Skill In Claude Code Or Codex
This repository also ships a repo-specific skill guide at
skills/deep-research-mcp/SKILL.md.
Installing that file as a local skill gives Claude Code or Codex a focused
playbook for this repository's CLI, Python API, providers, and MCP server.
It does not install Python dependencies, start the MCP server, or replace
the provider configuration in ~/.deep_research. Treat it as complementary to
the MCP setup below, not a substitute for it.
Claude Code skill install
Claude Code's skills docs use these locations:
personal skill:
~/.claude/skills/<skill-name>/SKILL.mdproject skill:
.claude/skills/<skill-name>/SKILL.md
Personal install:
mkdir -p ~/.claude/skills/deep-research-mcp
cp /path/to/deep-research-mcp/skills/deep-research-mcp/SKILL.md \
~/.claude/skills/deep-research-mcp/SKILL.mdIf you prefer to keep the installed skill linked to this checkout:
mkdir -p ~/.claude/skills/deep-research-mcp
ln -sf /path/to/deep-research-mcp/skills/deep-research-mcp/SKILL.md \
~/.claude/skills/deep-research-mcp/SKILL.mdProject-local install from the repository root:
mkdir -p .claude/skills/deep-research-mcp
cp skills/deep-research-mcp/SKILL.md .claude/skills/deep-research-mcp/SKILL.mdAfter that, restart Claude Code or open a new session if the skill does not
appear immediately. The skill can be invoked directly as
/deep-research-mcp, and Claude can also load it automatically when the task
matches the skill description. For a reusable shared extension, package the
same skill into a Claude Code plugin instead of copying it by hand.
Official docs:
Claude Code skills: https://docs.claude.com/en/docs/claude-code/skills
Claude Code plugins: https://docs.claude.com/en/docs/claude-code/plugins
Codex skill install
Current Codex docs describe skills as skill folders containing SKILL.md,
stored globally in $HOME/.agents/skills or repo-locally in .agents/skills.
Personal install:
mkdir -p ~/.agents/skills/deep-research-mcp
cp /path/to/deep-research-mcp/skills/deep-research-mcp/SKILL.md \
~/.agents/skills/deep-research-mcp/SKILL.mdOr keep the installed skill linked to this checkout:
mkdir -p ~/.agents/skills/deep-research-mcp
ln -sf /path/to/deep-research-mcp/skills/deep-research-mcp/SKILL.md \
~/.agents/skills/deep-research-mcp/SKILL.mdProject-local install from the repository root:
mkdir -p .agents/skills/deep-research-mcp
cp skills/deep-research-mcp/SKILL.md .agents/skills/deep-research-mcp/SKILL.mdIf your Codex setup still follows older CLI conventions that use
~/.codex/skills or .codex/skills, mirror the same directory structure
there instead.
Codex can invoke the skill implicitly when the task matches its description, or
explicitly by mentioning $deep-research-mcp in the prompt. If the skill does
not show up immediately, restart Codex.
Official docs:
Codex skills: https://developers.openai.com/codex/skills
Codex customization and skill locations: https://developers.openai.com/codex/concepts/customization#skills
Claude Code Integration
Configure MCP Server
Choose one of the transports below.
Option A: stdio (recommended when Claude Code should spawn the server itself)
Clone-free user installation:
claude mcp add --scope user --transport stdio deep-research -- \
uvx --from "git+https://github.com/pminervini/deep-research-mcp.git@main" \
deep-research-mcpFor a source checkout with provider credentials already stored in
~/.deep_research, use:
claude mcp add deep-research -- uv run --directory /path/to/deep-research-mcp deep-research-mcpIf you want Claude Code to pass OPENAI_API_KEY through to the spawned MCP
process explicitly, use:
claude mcp add -e OPENAI_API_KEY="$OPENAI_API_KEY" \
deep-research -- \
uv run --directory /path/to/deep-research-mcp deep-research-mcpOption B: HTTP (recommended when you want to run the server separately)
Start the server in one terminal:
OPENAI_API_KEY="$OPENAI_API_KEY" \
uv run --directory /path/to/deep-research-mcp \
deep-research-mcp --transport http --host 127.0.0.1 --port 8080Then add the HTTP MCP server in Claude Code:
claude mcp add --transport http deep-research-http http://127.0.0.1:8080/mcpReplace /path/to/deep-research-mcp/ with the actual path to your cloned repository.
The verified Streamable HTTP endpoint is http://127.0.0.1:8080/mcp.
For multi-hour research, raise Claude Code's tool timeout before launching the CLI and rely on incremental status polls:
export MCP_TOOL_TIMEOUT=14400000 # 4 hours
claude --mcp-config ./.mcp.jsonKick off work with deep_research, note the returned job ID, and call research_status to stream progress without letting any single tool call stagnate.
Output size: Claude Code limits MCP tool output (about 25,000 tokens by default, configurable via MAX_MCP_OUTPUT_TOKENS). The research tools declare the anthropic/maxResultSizeChars annotation so recent Claude Code versions accept large reports without extra configuration; on older versions, raise the limit before launching the CLI:
export MAX_MCP_OUTPUT_TOKENS=50000
claudeTimeout recovery: if a research task exceeds the configured timeout, the server leaves the provider task running by default and returns its task ID; call research_status with that ID to retrieve the full report once it completes. Pass --cancel-on-timeout to deep-research-mcp (or set cancel_on_timeout = true in ~/.deep_research) to restore the old cancel behavior.
Use in Claude Code:
The research tools will appear in Claude Code's tool palette
Simply ask Claude to "research [your topic]" and it will use the Deep Research agent
OpenAI Codex Integration
Configure MCP Server
Choose one of the transports below.
Option A: stdio (recommended when Codex should spawn the server itself)
Clone-free installation:
codex mcp add deep-research -- \
uvx --from "git+https://github.com/pminervini/deep-research-mcp.git@main" \
deep-research-mcpFor a source checkout, add the MCP server configuration to
~/.codex/config.toml:
[mcp_servers.deep-research]
command = "uv"
args = ["run", "--directory", "/path/to/deep-research-mcp", "deep-research-mcp"]
# If your provider credentials live in shell env vars rather than ~/.deep_research,
# pass them through to the MCP subprocess explicitly:
env_vars = ["OPENAI_API_KEY"]
startup_timeout_ms = 30000 # 30 seconds for server startup
request_timeout_ms = 7200000 # 2 hours for long-running research tasks
# Alternatively, set tool_timeout_sec when using newer Codex clients
# tool_timeout_sec = 14400.0 # 4 hours for deep research runsReplace /path/to/deep-research-mcp/ with the actual path to your cloned repository.
If your credentials are already configured in ~/.deep_research, env_vars is
optional. It is required when you expect the spawned MCP server to inherit
OPENAI_API_KEY from the parent shell.
Option B: HTTP (recommended when you want to run the server separately)
Start the server in one terminal:
OPENAI_API_KEY="$OPENAI_API_KEY" \
uv run --directory /path/to/deep-research-mcp \
deep-research-mcp --transport http --host 127.0.0.1 --port 8080Then add this to ~/.codex/config.toml:
[mcp_servers.deep-research-http]
url = "http://127.0.0.1:8080/mcp"
tool_timeout_sec = 14400.0The verified Streamable HTTP endpoint is http://127.0.0.1:8080/mcp.
Important timeout configuration:
startup_timeout_ms: Time allowed for the MCP server to start (default: 30000ms / 30 seconds)request_timeout_ms: Maximum time for research queries to complete (recommended: 7200000ms / 2 hours for comprehensive research)tool_timeout_sec: Preferred for newer Codex clients; set this to a large value (e.g.,14400.0for 4 hours) when you expect long-running research.Kick off research once to capture the job ID, then poll
research_statusso each tool call remains short and avoids hitting client timeouts.
Without proper timeout configuration, long-running research queries may fail with "request timed out" errors.
Use in OpenAI Codex:
The research tools will be available automatically when you start Codex
Ask Codex to "research [your topic]" and it will use the Deep Research MCP server
Gemini CLI Integration
Configure MCP Server
Add the MCP server using Gemini CLI's built-in command:
gemini mcp add deep-research -- uv run --directory /path/to/deep-research-mcp deep-research-mcpOr manually add to your ~/.gemini/settings.json file:
{
"mcpServers": {
"deep-research": {
"command": "uv",
"args": ["run", "--directory", "/path/to/deep-research-mcp", "deep-research-mcp"],
"env": {
"RESEARCH_PROVIDER": "gemini",
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}Replace /path/to/deep-research-mcp/ with the actual path to your cloned repository.
Use in Gemini CLI:
Start Gemini CLI with
geminiThe research tools will be available automatically
Ask Gemini to "research [your topic]" and it will use the Deep Research MCP server
Use
/mcpcommand to view server status and available tools
HTTP transport: If your Gemini environment supports MCP-over-HTTP, you may run
the server with --transport http and configure Gemini with the server URL.
Usage
As a Standalone Python Module
import asyncio
from deep_research_mcp.agent import DeepResearchAgent
from deep_research_mcp.config import ResearchConfig
async def main():
# Initialize configuration
config = ResearchConfig.load()
# Create agent
agent = DeepResearchAgent(config)
# Perform research
result = await agent.research(
query="What are the latest advances in quantum computing?",
system_prompt="Focus on practical applications and recent breakthroughs"
)
# Print results
print(f"Report: {result.final_report}")
print(f"Citations: {result.citations}")
print(f"Research steps: {result.reasoning_steps}")
print(f"Execution time: {result.execution_time:.2f}s")
# Run the research
asyncio.run(main())As an MCP Server
Two transports are supported: stdio (default) and HTTP streaming.
# 1) stdio (default) — for editors/CLIs that spawn a local process
uv run deep-research-mcp
# 2) HTTP streaming — start a local HTTP MCP server
uv run deep-research-mcp --transport http --host 127.0.0.1 --port 8080Notes:
HTTP mode uses streaming responses provided by FastMCP. The tools in this server return their full results when a research task completes; streaming is still beneficial for compatible clients and for future incremental outputs.
The verified Streamable HTTP endpoint is
/mcp, so the default local URL ishttp://127.0.0.1:8080/mcp.If you start the server outside the client and rely on environment variables for credentials, export them before launching the server process. If you use
stdioand let the client spawn the server, make sure the client passes the required env vars through.
OAuth authentication for HTTP
HTTP OAuth is opt-in. Set both variables below before starting the server:
export MCP_AUTH_ISSUER_URL="https://firm-mermaid-02-staging.authkit.app"
export MCP_AUTH_RESOURCE_URL="http://127.0.0.1:8080/mcp"
uv run deep-research-mcp --transport http --host 127.0.0.1 --port 8080MCP_AUTH_RESOURCE_URL must exactly match the Resource Indicator configured in
WorkOS, including the /mcp path. When enabled, the server verifies each
AuthKit access token's signature, issuer, expiration, and audience and publishes
RFC 9728 protected-resource metadata for MCP clients. No WorkOS API key or
client secret is required by the server. Local stdio usage is unchanged.
In WorkOS, enable Client ID Metadata Documents (CIMD), keep Dynamic Client Registration (DCR) enabled for older clients, and add the resource URL under Connect → Configuration. See the WorkOS MCP authentication guide.
Command-Line Interface
The installed deep-research-cli command provides direct access to all
research functionality from the terminal. Its implementation lives in
src/deep_research_mcp/cli.py, while cli/deep-research-cli.py remains a
source-checkout compatibility wrapper. It supports two modes of operation:
agent mode (default) which runs DeepResearchAgent directly, and MCP
client mode which connects to a running MCP server over HTTP.
Configuration is loaded from ~/.deep_research by default. Every
ResearchConfig parameter can be overridden via CLI flags, which take
precedence over both the TOML file and environment variables.
Terminal UI
The repository also ships with a full-screen terminal UI at
cli/deep-research-tui.py. It presents the same core functionality as the
CLI in a dark, keyboard-driven interface for running deep research, task status
checks, and saving output to disk.

The TUI features a split-panel layout:
Left panel: Configuration controls for mode selection (Agent/MCP), provider settings, model configuration, query input, and system prompt
Right panel: Output display showing research results or status information
The animation above demonstrates the TUI workflow: loading a research query, running it through a local Dr Tulu-compatible demo endpoint, viewing the result in the output panel, and saving the output to a file.
Quick Start
# Start in direct agent mode
uv run python cli/deep-research-tui.py
# Start in MCP client mode
uv run python cli/deep-research-tui.py --mode mcp \
--server-url http://127.0.0.1:8080/mcp
# Start with Gemini selected
uv run python cli/deep-research-tui.py --provider geminiTUI Workflow
Use the left control panel to edit provider settings, query text, system prompt, and save path.
The TUI starts focused on the
Modeselector rather than inside the query editor.Use
Tab/Shift+Tabto move through all controls.Use
Up/Downto move between non-editor controls, including single-line inputs.Use
Left/Rightto toggle booleans and cycle through choice fields when aSwitchorSelecthas focus.Press
Enterto activate buttons, toggle switches, cycle selects, or move forward from a single-line input.TextAreawidgets such asQueryandSystem Promptkeep normal cursor-key editing behavior.Use
rto run deep research,tto check task status,sto save the current output, andqto quit.The right panel shows the latest research report or status response.
Provider Defaults
In agent mode, the TUI applies provider-aware defaults:
openai+responses: modelgpt-5.6-sol, base URLhttps://api.openai.com/v1openai+chat_completions: modelgpt-5-mini, base URLhttps://api.openai.com/v1openai-codex: modelauto, fixed base URLhttps://chatgpt.com/backend-api/codexdr-tulu: modeldr-tulu, base URLhttp://localhost:8080/gemini: modeldeep-research-preview-04-2026, base URLhttps://generativelanguage.googleapis.comopen-deep-research: modelopenai/qwen/qwen3-coder-30b, base URLhttp://localhost:1234/v1
Switching provider or OpenAI API style automatically refreshes the model and base URL defaults. You can still override those fields manually afterward.
Research and Saving Output
Run Deep Researchexecutes either the direct agent flow or the MCP client flow, depending on the selected mode.Save Outputwrites the current contents of the output panel to the configured path, creating parent directories if needed.
Notes
In
mcpmode, setMCP Server URLto a running Streamable HTTP endpoint such ashttp://127.0.0.1:8080/mcp.The TUI reuses the same config-loading behavior as
deep-research-cli, so~/.deep_researchand any startup overrides still apply.Direct-agent JSON rendering is available through the
JSON Outputtoggle; MCP mode saves the textual tool response exactly as returned by the server.The current layout is designed for terminals at least 100 columns wide and 28 rows tall.
Quick Start
Gemini Deep Research:
uv run deep-research-cli \
--provider gemini \
--model deep-research-preview-04-2026 \
--base-url https://generativelanguage.googleapis.com \
research "What is the capital of France?"Expected output (snippet):
============================================================
RESEARCH REPORT
============================================================
Task ID: v1_Chd5YUxjYVpXRUotYWxrZFVQOF9lcTRRVRIX...
Total steps: 1
Execution time: 245.94s
# Comprehensive Analysis of the French Capital: Demographic,
# Economic, and Historical Dimensions of Paris
**Key Points**
* **The capital of France is Paris**, acting as the undisputed
political, economic, and cultural epicenter of the nation.
* Data indicates that the Paris metropolitan area commands a
Gross Domestic Product (GDP) exceeding $1.03 trillion ...OpenAI GPT-5.6 Sol research:
uv run deep-research-cli \
--provider openai \
--model gpt-5.6-sol \
--base-url https://api.openai.com/v1 \
research "What is the capital of France?"Expected output:
============================================================
RESEARCH REPORT
============================================================
Task ID: resp_0e55abdae3d3ce390069dca3c7d78c819f91...
Total steps: 22
Search queries: 10
Citations: 1
Execution time: 34.34s
The capital of France is **Paris**
(www.britannica.com/place/Paris)
============================================================
CITATIONS
============================================================
1. Paris | Definition, Map, Population, Facts, & History
https://www.britannica.com/place/ParisOpenAI Codex subscription research:
uv run deep-research-cli auth login
uv run deep-research-cli \
--provider openai-codex \
research "What is the capital of France?"DR-Tulu (requires a running dr-tulu service; see Dr Tulu provider example):
uv run deep-research-cli \
--provider dr-tulu \
--base-url http://localhost:8080/ \
research "What is the capital of France?"Expected output:
============================================================
RESEARCH REPORT
============================================================
Task ID: 7f3a1b2c-...
Total steps: 4
Citations: 2
Execution time: 18.72s
The capital of France is Paris. Paris has served as the
French capital since the late 10th century ...
============================================================
CITATIONS
============================================================
1. Source 1
https://en.wikipedia.org/wiki/Paris
2. Source 2
https://www.britannica.com/place/ParisView resolved configuration or all available options:
uv run deep-research-cli config --pretty
uv run deep-research-cli --helpCommands
research QUERY -- perform deep research on a query.
# Simple research (agent mode)
uv run deep-research-cli research "Economic impact of AI adoption"
# Override provider and model for a single run
uv run deep-research-cli --provider gemini research "Climate change policies"
# Use a custom system prompt from a file
uv run deep-research-cli research "Healthcare trends" --system-prompt-file prompts/health.txt
# Or pass the system prompt inline
uv run deep-research-cli research "Healthcare trends" --system-prompt "Focus on peer-reviewed sources only"
# Output as JSON (includes metadata, citations, execution time)
uv run deep-research-cli research "AI safety" --json
# Save the report to a file
uv run deep-research-cli research "Renewable energy" --output-file report.md
# Disable code interpreter / data analysis tools
uv run deep-research-cli research "Simple topic" --no-analysis
# Notify a webhook when research completes
uv run deep-research-cli research "Long query" --callback-url https://example.com/webhookTested local OpenAI-compatible backends
The unified CLI works with local servers that expose an OpenAI-compatible
Chat Completions API. The commands below were tested against local Ollama and
local llama-server (from llama.cpp).
Ollama
Basic research flow:
uv run deep-research-cli \
--provider openai \
--api-style chat_completions \
--base-url http://localhost:11434/v1 \
--api-key test \
--model qwen3.5:0.8b \
--timeout 180 \
research "Reply with exactly: ok"Observed output:
HTTP Request: POST http://localhost:11434/v1/chat/completions "HTTP/1.1 200 OK"
============================================================
RESEARCH REPORT
============================================================
Task ID: chatcmpl-215
Total steps: 1
Execution time: 14.33s
okllama-server
Start a local OpenAI-compatible server and let it download a small GGUF model from Hugging Face automatically:
llama-server \
--host 127.0.0.1 \
--port 8081 \
--api-key test \
--ctx-size 4096 \
--alias qwen2.5-0.5b \
-hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_MThen point the CLI at the server:
uv run deep-research-cli \
--provider openai \
--api-style chat_completions \
--base-url http://127.0.0.1:8081/v1 \
--api-key test \
--model qwen2.5-0.5b \
--timeout 120 \
research "Reply with exactly: ok"Observed output:
HTTP Request: POST http://127.0.0.1:8081/v1/chat/completions "HTTP/1.1 200 OK"
============================================================
RESEARCH REPORT
============================================================
Task ID: chatcmpl-uzqSNDzRgYchZRxn1Kq2MNYyc2w6hpc6
Total steps: 1
Execution time: 0.15s
Okresearch QUERY --server-url URL -- use MCP client mode.
Instead of running the agent directly, connect to a running Deep Research MCP server over Streamable HTTP.
# First, start the MCP server in another terminal:
uv run deep-research-mcp --transport http --host 127.0.0.1 --port 8080
# Then run queries against it:
uv run deep-research-cli research "AI trends" \
--server-url http://127.0.0.1:8080/mcpstatus TASK_ID -- check the status of a running research task.
# Agent mode
uv run deep-research-cli status abc123-def456-ghi789
# MCP client mode
uv run deep-research-cli status abc123-def456-ghi789 \
--server-url http://127.0.0.1:8080/mcpconfig -- display the resolved configuration.
Shows the final configuration after merging the TOML file, environment variables, and any CLI overrides.
# JSON output (default), with secrets masked
uv run deep-research-cli config
# Human-readable output
uv run deep-research-cli config --pretty
# Show full API keys
uv run deep-research-cli config --pretty --show-secrets
# See the effect of CLI overrides
uv run deep-research-cli --provider gemini --timeout 600 config --pretty
# Skip config validation
uv run deep-research-cli config --no-validateauth {login,status,logout} -- manage the independent OpenAI Codex
subscription session.
uv run deep-research-cli auth login
uv run deep-research-cli auth status
uv run deep-research-cli auth logoutConfiguration Overrides
All global flags are placed before the subcommand and override the
corresponding ResearchConfig field:
Flag | Description |
| Path to TOML config file (default: |
| Research provider |
| Model or agent ID |
| Provider API key |
| Provider API base URL |
| OpenAI API style |
| Max research timeout |
| Task poll interval |
| Logging level |
| Enable reasoning summaries |
Configuration precedence (highest to lowest): CLI flags > environment
variables > TOML config file (~/.deep_research) > built-in defaults.
Exit Codes
Code | Meaning |
0 | Success |
1 | Research or configuration error |
2 | MCP tool error |
3 | Unexpected error |
Example Queries
# Basic research query
result = await agent.research("Explain the transformer architecture in AI")
# Research with code analysis
result = await agent.research(
query="Analyze global temperature trends over the last 50 years",
include_code_interpreter=True
)
# Custom system instructions
result = await agent.research(
query="Review the safety considerations for AGI development",
system_prompt="""
Provide a balanced analysis including:
- Technical challenges
- Current safety research
- Regulatory approaches
- Industry perspectives
Include specific examples and data where available.
"""
)API Reference
DeepResearchAgent
The main class for performing research operations.
Methods
research(query, system_prompt=None, include_code_interpreter=True, callback_url=None)Performs deep research on a query
callback_url: optional webhook notified when research completesReturns: Dictionary with final report, citations, and metadata
get_task_status(task_id)Check the status of a research task
Returns: Task status information
ResearchConfig
Configuration class for the research agent.
Parameters
provider: Research provider (openai,openai-codex,dr-tulu,gemini, oropen-deep-research; default:openai)api_style: API style for theopenaiprovider (responsesorchat_completions; default:responses). Ignored foropenai-codex,dr-tulu,gemini, andopen-deep-research.model: Model identifierOpenAI: Responses model (e.g.,
gpt-5-mini)OpenAI Codex subscription:
auto(default) or an account catalogue slugDr Tulu: logical provider id (default:
dr-tulu)Gemini: Deep Research agent id (for example
deep-research-preview-04-2026)Open Deep Research: LiteLLM model id (e.g.,
openai/qwen/qwen3-coder-30b)
api_key: API key for the configured endpoint (optional). Defaults to envOPENAI_API_KEYforopenai,DR_TULU_API_KEYfordr-tulu,GEMINI_API_KEY/GOOGLE_API_KEYforgemini. Ignored foropenai-codex.base_url: Provider API base URL (optional). Defaults tohttps://api.openai.com/v1foropenai, the fixedhttps://chatgpt.com/backend-api/codexendpoint foropenai-codex,http://localhost:8080/fordr-tulu,https://generativelanguage.googleapis.comforgemini, andhttp://localhost:1234/v1foropen-deep-research.timeout: Maximum time for research in seconds (default: 1800)poll_interval: Polling interval in seconds (default: 30)
Development
Running Tests
# Install dev dependencies
uv sync --extra dev
# Run all tests
uv run pytest -v
# Run with coverage
uv run pytest --cov=deep_research_mcp tests/
# Run specific test file
uv run pytest tests/test_agents.pyWhen ~/.deep_research_auth.json contains a current or refreshable
openai-codex session, a normal uv run pytest tests/ run automatically
executes the live Codex end-to-end test and consumes subscription allowance.
Without that session, the test is skipped. Use -m "not api" to exclude all
live provider tests explicitly.
Lint, Format, Type Check
uv run black .
uv run pylint src/deep_research_mcp tests
uv run mypy src/deep_research_mcpAvailable Tools
3 toolsdeep_researchA
Performs autonomous deep research using the configured provider with web search and analysis capabilities.
What it does:
Decomposes complex queries into research strategies
Conducts real-time web searches for current information
Executes code for data analysis and visualization (when include_analysis=True)
Synthesizes findings into comprehensive reports with citations
Best for:
Current events and recent developments
Data-driven analysis requiring statistics/charts
Complex topics needing multiple source synthesis
Academic-style research with proper citations
Returns: Structured markdown report with citations, metadata, and research insights.
Note: Uses provider-native research backends - monitor costs as research can generate substantial tokens.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| system_instructions | No | ||
| include_analysis | No | ||
| request_clarification | No | ||
| callback_url | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries full burden. It discloses key behaviors: query decomposition, real-time web search, code execution when include_analysis=True, synthesis into reports with citations, and cost monitoring. It does not cover all traits (e.g., rate limits, auth), but the main behaviors are well communicated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (What it does, Best for, Returns, Note). Every sentence adds value, and the key information is front-loaded. It is appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (5 params, output schema exists), the description covers behavior and return type reasonably but lacks parameter explanations for most fields. It omits details on async handling despite a callback_url. Combined with good output schema, it is partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must explain all 5 parameters. Only include_analysis is partially described (when include_analysis=True). The other parameters (system_instructions, request_clarification, callback_url) are not explained, leaving significant gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it performs autonomous deep research with web search and analysis, using a strong verb and resource. It does not explicitly differentiate from siblings like research_status or research_with_context, but the scope is clear enough.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'Best for' section lists ideal use cases (current events, data analysis, complex topics, academic research), providing clear context. However, no exclusions or direct comparisons to sibling tools are given, limiting guidance on when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
research_statusA
Check the current status and progress of a running research task.
Use when:
Research is taking a long time (>5 minutes)
Want to check if a task completed successfully
Need creation/completion timestamps
Returns: Task status ('running', 'completed', 'failed') with timestamps.
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the return format (status and timestamps) and implies a non-destructive read operation. Adequate for a simple check tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, uses headings and bullet points, and every sentence is useful. It is front-loaded with the purpose and efficiently conveys usage and return info.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given low complexity (one param, simple return), the description is sufficient. It covers the key behavioral aspects and return values, though it leaves out error handling and edge cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage for the only parameter, task_id. The description does not add any additional meaning, such as expected format or origin of the task_id, which is necessary given the lack of schema docs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Check the current status and progress of a running research task,' using specific verb and resource. It effectively distinguishes from siblings like deep_research by focusing on status monitoring.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit 'Use when:' scenarios including long-running tasks and completion checks. While it doesn't list alternatives or when not to use, the context is clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
research_with_contextA
Perform research using an enriched query based on clarification answers.
Use after:
Calling
deep_researchwithrequest_clarification=TrueReceiving clarifying questions and a session ID
Gathering answers from the user
What it does:
Takes your answers to clarifying questions
Creates an enriched, more specific research query
Performs comprehensive research with the enhanced query
Returns: Complete research report with citations and metadata
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| answers | Yes | ||
| system_instructions | No | ||
| include_analysis | No | ||
| callback_url | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description bears full burden. It explains the process (answers to enriched query to research) and return type, but omits behavioral traits like whether the tool is synchronous/asynchronous, potential side effects, or state changes. The callback_url parameter hints at async but is not mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is compact, uses headings and bullet points, and is front-loaded with the main purpose. Every sentence adds value, though it could be slightly more concise by merging lines. No superfluous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the return description is adequate. However, the tool is part of a multi-step workflow (deep_research → research_with_context → research_status), and the description does not explain that results may be polled via research_status. The callback_url parameter hints at async but is not contextualized.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% from description. Description only indirectly explains 'session_id' and 'answers' via usage context, but does not describe 'system_instructions', 'include_analysis', or 'callback_url'. The two required params are partially clarified, but the three optional ones are ignored.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Perform research using an enriched query based on clarification answers' and differentiates from siblings by associating with deep_research's clarification flow. The tool's role in the workflow is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly specifies 'Use after: Calling deep_research with request_clarification=True... Receiving clarifying questions... Gathering answers from user.' This provides clear when-to-use and when-not-to-use guidance relative to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
deep_research - First observed
research_status - First observed
research_with_context
TDQS
Scored across 3 tools
Each tool has a distinct purpose: deep_research performs primary research, research_status monitors progress, and research_with_context handles enriched queries after clarification. No confusion between them.
All names contain 'research', but one uses 'deep_research' while the others use 'research_', which is a minor inconsistency. Still, the pattern is mostly predictable.
Three tools cover the core research workflow adequately for a focused server. The count is slightly low but not insufficient for the stated purpose.
The tools support initiating research, checking status, and enhanced context, but lack retrieval of past results, task cancellation, or history listing, which are notable gaps.
Maintenance
Related MCP Connectors
Research-backed linting + generation for agent context files (CLAUDE.md, AGENTS.md, Cursor rules).
Retrieve citation-ready technical context and coordinate evidence-backed work between AI agents.
Fan out deep research across multiple AI providers, synthesize into one unified report.
Autonomous research agent that pays every source it cites in USDC on Arc via x402 micropayments.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables iterative deep research by integrating AI agents with search engines, web scraping, and large language models for efficient data gathering and comprehensive reporting.8 npm322MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables Claude to perform advanced web research with intelligent search queuing, enhanced content extraction, and deep research capabilities.38 npm1MIT
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables conversational LLMs to delegate complex research tasks to specialized AI agents powered by various OpenRouter models, coordinated by a Claude orchestrator.61 npm55MIT
- FlicenseNot gradedqualityDmaintenanceA multi-model research agent platform supporting Claude, Gemini, and OpenAI models with web search capabilities, thinking-enabled features, and citation support for advanced research workflows.6-