mcp-deep-research
Version:
[](https://smithery.ai/server/@baranwang/mcp-deep-research) [](https://www.npmjs.com/package/mcp-deep-research) .default('general').describe('Search topic'),
rounds: __WEBPACK_EXTERNAL_MODULE_zod__.z.number().default(1).describe('Current search round, defaults to 1')
});
async function deepResearch(args) {
if (!CONFIG.TAVILY_API_KEY) return {
isError: true,
content: [
{
type: 'text',
text: 'Please configure the `TAVILY_API_KEY` environment variable, get it from https://tavily.com/'
}
]
};
const { question, reference = '', keywords = [], topic, rounds } = DeepResearchToolSchema.parse(args);
let searchResults = reference;
if (keywords.length) {
const results = await Promise.allSettled(keywords.map((keyword)=>searchTavily(keyword, {
topic
})));
searchResults += results.filter((result)=>'fulfilled' === result.status).map((result)=>result.value).join('\n');
}
return {
content: [
{
type: 'text',
text: generatePrompt(question, searchResults, rounds)
}
]
};
}
async function main() {
const mcpServer = new __WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_server_mcp_js_2c42c5d0__.McpServer({
name: 'DeepResearch',
version: CONFIG.PACKAGE_VERSION
}, {
capabilities: {
tools: {}
}
});
mcpServer.server.setRequestHandler(__WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_types_js_fc45a208__.ListToolsRequestSchema, ()=>({
tools: [
{
name: 'deep-research',
description: 'Deep web information search tool that can conduct multi-round in-depth research based on keywords and topics',
inputSchema: (0, __WEBPACK_EXTERNAL_MODULE_zod_to_json_schema_a1d75503__.zodToJsonSchema)(DeepResearchToolSchema)
}
]
}));
mcpServer.server.setRequestHandler(__WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_types_js_fc45a208__.CallToolRequestSchema, (request)=>deepResearch(request.params.arguments));
const transport = new __WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_server_stdio_js_4f861174__.StdioServerTransport();
await mcpServer.connect(transport);
}
main().catch((error)=>{
console.error(error);
process.exit(1);
});