DeepResearch
STDIOIntelligent research assistant that conducts iterative research through web searches and analysis.
Intelligent research assistant that conducts iterative research through web searches and analysis.
DeepResearch MCP is a powerful research assistant built on the Model Context Protocol (MCP). It conducts intelligent, iterative research on any topic through web searches, analysis, and comprehensive report generation.
┌────────────────────┐ ┌─────────────────┐ ┌────────────────┐
│ │ │ │ │ │
│ MCP Server Layer ├────►│ Research Service├────►│ Search Service │
│ (Tools & Prompts) │ │ (Session Mgmt) │ │ (Firecrawl) │
│ │ │ │ │ │
└────────────────────┘ └─────────┬───────┘ └────────────────┘
│
▼
┌─────────────────┐
│ │
│ OpenAI Service │
│ (Analysis/Rpt) │
│ │
└─────────────────┘
Clone the repository
git clone <repository-url> cd deep-research-mcp
Install dependencies
npm install
Configure environment variables
cp .env.example .env
Edit the .env
file and add your API keys:
OPENAI_API_KEY=sk-your-openai-api-key
FIRECRAWL_API_KEY=your-firecrawl-api-key
Build the project
npm run build
Start the server on stdio for MCP client connections:
npm start
Run research on a specific topic with a specified depth:
npm run client "Your research topic" 3
Parameters:
Example:
npm run client "the impact of climate change on coral reefs" 3 complete
The DeepResearch MCP will produce a comprehensive report that includes:
Resource Path | Description |
---|---|
research://state/{sessionId} | Access the current state of a research session |
research://findings/{sessionId} | Access the collected findings for a session |
Tool Name | Description | Parameters |
---|---|---|
initialize-research | Start a new research session | query : string, depth : number |
execute-research-step | Execute the next research step | sessionId : string |
generate-report | Create a final report | sessionId : string, timeout : number (optional) |
complete-research | Execute the entire research process | query : string, depth : number, timeout : number (optional) |
DeepResearch MCP can be integrated with Claude Desktop to provide direct research capabilities to Claude.
Copy the sample configuration
cp claude_desktop_config_sample.json ~/path/to/claude/desktop/config/directory/claude_desktop_config.json
Edit the configuration file
Update the path to point to your installation of deep-research-mcp and add your API keys:
{ "mcpServers": { "deep-research": { "command": "node", "args": [ "/absolute/path/to/your/deep-research-mcp/dist/index.js" ], "env": { "FIRECRAWL_API_KEY": "your-firecrawler-api-key", "OPENAI_API_KEY": "your-openai-api-key" } } } }
Restart Claude Desktop
After saving the configuration, restart Claude Desktop for the changes to take effect.
Using with Claude Desktop
Now you can ask Claude to perform research using commands like:
Can you research the impact of climate change on coral reefs and provide a detailed report?
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; async function main() { // Connect to the server const transport = new StdioClientTransport({ command: "node", args: ["dist/index.js"] }); const client = new Client({ name: "deep-research-client", version: "1.0.0" }); await client.connect(transport); // Initialize research const initResult = await client.callTool({ name: "initialize-research", arguments: { query: "The impact of artificial intelligence on healthcare", depth: 3 } }); // Parse the response to get sessionId const { sessionId } = JSON.parse(initResult.content[0].text); // Execute steps until complete let currentDepth = 0; while (currentDepth < 3) { const stepResult = await client.callTool({ name: "execute-research-step", arguments: { sessionId } }); const stepInfo = JSON.parse(stepResult.content[0].text); currentDepth = stepInfo.currentDepth; console.log(`Completed step ${stepInfo.currentDepth}/${stepInfo.maxDepth}`); } // Generate final report with timeout const report = await client.callTool({ name: "generate-report", arguments: { sessionId, timeout: 180000 // 3 minutes timeout } }); console.log("Final Report:"); console.log(report.content[0].text); } main().catch(console.error);
Token Limit Exceeded: For very large research topics, you may encounter OpenAI token limit errors. Try:
Timeout Errors: For complex research, the process may time out. Solutions:
complete-research
tool with a longer timeoutAPI Rate Limits: If you encounter rate limit errors from OpenAI or Firecrawl:
ISC