Skip to main content
Glama

Open Search MCP

by flyanima
MIT License
2
  • Apple
  • Linux
ultimate-setup.js7.92 kB
/** * 终极设置 - 恢复所有35个原工具 + 4个新v2.0工具 = 39个工具 */ import fs from 'fs'; import path from 'path'; import os from 'os'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); // 获取Claude Desktop配置文件路径 function getClaudeConfigPath() { const platform = os.platform(); const homeDir = os.homedir(); switch (platform) { case 'win32': return path.join(homeDir, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json'); case 'darwin': return path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'); case 'linux': return path.join(homeDir, '.config', 'Claude', 'claude_desktop_config.json'); default: throw new Error(`不支持的操作系统: ${platform}`); } } // 获取项目路径 function getProjectPath() { return path.resolve(__dirname, '..'); } async function ultimateSetup() { try { console.log('🎯 Open Search MCP v2.0 终极设置 - 39个工具版本...\n'); const configPath = getClaudeConfigPath(); const projectPath = getProjectPath(); const serverPath = path.join(projectPath, 'src', 'ultimate-server.cjs'); console.log(`📁 配置文件路径: ${configPath}`); console.log(`🚀 服务器路径: ${serverPath}`); // 检查服务器文件是否存在 if (!fs.existsSync(serverPath)) { console.error(`❌ 服务器文件不存在: ${serverPath}`); return; } // 读取现有配置 let config = {}; if (fs.existsSync(configPath)) { const content = fs.readFileSync(configPath, 'utf8'); config = JSON.parse(content); } // 确保mcpServers存在 if (!config.mcpServers) { config.mcpServers = {}; } // 备份原配置 const backupPath = configPath + '.backup.ultimate.' + Date.now(); fs.writeFileSync(backupPath, JSON.stringify(config, null, 2), 'utf8'); console.log(`💾 原配置已备份到: ${backupPath}`); // 更新open-search-mcp配置 config.mcpServers['open-search-mcp'] = { "command": "node", "args": [serverPath], "env": { "NODE_ENV": "production" } }; // 写入配置 fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8'); console.log('✅ 配置更新成功!'); console.log('\n📋 最终配置:'); console.log(JSON.stringify(config.mcpServers['open-search-mcp'], null, 2)); console.log('\n🎉 Open Search MCP v2.0 终极版本设置完成!'); console.log('='.repeat(80)); console.log('\n🆕 **v2.0核心工具** (4个) - 您最新开发的工具:'); console.log(' 🚀 multi_api_search - 多API聚合搜索引擎'); console.log(' 🏗️ searx_cluster_search - Searx集群搜索引擎'); console.log(' 📊 enhanced_content_extraction - 增强内容提取工具'); console.log(' 🧠 deep_research - 深度研究引擎'); console.log('\n📚 **学术搜索工具** (4个):'); console.log(' • search_arxiv - arXiv学术论文搜索'); console.log(' • search_pubmed - PubMed医学文献搜索'); console.log(' • search_ieee - IEEE技术论文搜索'); console.log(' • search_google_scholar - Google Scholar学术搜索'); console.log('\n🌐 **网络搜索工具** (9个):'); console.log(' • search_duckduckgo - DuckDuckGo搜索'); console.log(' • search_google_custom - Google自定义搜索'); console.log(' • search_wikipedia - Wikipedia百科搜索'); console.log(' • search_bing, search_yandex, search_searx等'); console.log('\n💻 **技术平台工具** (3个):'); console.log(' • search_github_repositories - GitHub仓库搜索'); console.log(' • search_stackoverflow - Stack Overflow问答搜索'); console.log(' • search_hackernews - Hacker News新闻搜索'); console.log('\n📰 **新闻媒体工具** (3个):'); console.log(' • search_techcrunch - TechCrunch科技新闻'); console.log(' • search_bbc_tech - BBC科技新闻'); console.log(' • search_reuters_tech - Reuters科技新闻'); console.log('\n💬 **社交媒体工具** (3个):'); console.log(' • search_reddit - Reddit讨论搜索'); console.log(' • search_twitter - Twitter/X推文搜索'); console.log(' • search_linkedin - LinkedIn专业内容搜索'); console.log('\n🏢 **公司研究工具** (2个):'); console.log(' • find_competitors - 竞争对手分析'); console.log(' • search_medium_tech - Medium技术文章搜索'); console.log('\n🧠 **高级研究工具** (5个):'); console.log(' • intelligent_decomposed_research - 智能分解研究'); console.log(' • interactive_deep_research - 交互式深度研究'); console.log(' • get_thinking_visualization - 思维过程可视化'); console.log(' • thinking_chain_decompose - 思维链分解'); console.log(' • research_saturation_check - 研究饱和度检查'); console.log('\n🔍 **爬虫工具** (2个):'); console.log(' • crawl_url_content - URL内容爬取'); console.log(' • batch_crawl_urls - 批量URL爬取'); console.log('\n📄 **PDF处理工具** (1个):'); console.log(' • pdf_research - PDF文档研究分析'); console.log('\n🔧 **调试工具** (2个):'); console.log(' • ocr_health_check - OCR系统健康检查'); console.log(' • ocr_debug_test - OCR调试测试'); console.log('\n❓ **其他工具** (1个):'); console.log(' • search_quora - Quora问答搜索'); console.log('\n✅ **问题完全解决**:'); console.log(' ✅ 修复了ES模块兼容性问题'); console.log(' ✅ 使用CommonJS格式确保稳定性'); console.log(' ✅ 恢复了原来的35个工具'); console.log(' ✅ 添加了您最新开发的4个v2.0工具'); console.log(' ✅ 总计39个工具,比原来还多1个!'); console.log(' ✅ 测试确认服务器可以正常启动'); console.log('\n🧪 **下一步操作**:'); console.log('1. 完全关闭Claude Desktop应用'); console.log('2. 重新启动Claude Desktop'); console.log('3. 等待5-10秒让MCP服务器连接'); console.log('4. 查看是否出现所有39个工具'); console.log('\n🎯 **重点测试新v2.0工具**:'); console.log('• 多API搜索: "请使用multi_api_search搜索人工智能最新发展"'); console.log('• Searx集群: "请使用searx_cluster_search搜索机器学习"'); console.log('• 内容提取: "请使用enhanced_content_extraction提取https://example.com的内容"'); console.log('• 深度研究: "请使用deep_research研究区块链技术的发展趋势"'); console.log('\n🎯 **经典工具测试**:'); console.log('• 学术搜索: "请使用search_arxiv搜索深度学习论文"'); console.log('• 技术搜索: "请使用search_github_repositories搜索react项目"'); console.log('• 新闻搜索: "请使用search_techcrunch搜索最新科技新闻"'); console.log('\n🔍 **如果仍有问题**:'); console.log('- 检查Claude Desktop版本是否支持MCP'); console.log('- 查看"Open Logs Folder"中的详细错误信息'); console.log('- 确保没有杀毒软件阻止Node.js进程'); console.log('- 验证Node.js版本 >= 18.0.0'); console.log('\n🎊 恭喜!Open Search MCP v2.0 终极版(39个工具)已准备就绪!'); console.log('🚀 现在您拥有比原来更多的工具,包括您最新开发的v2.0核心功能!'); } catch (error) { console.error('❌ 终极设置失败:', error.message); } } ultimateSetup();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/flyanima/open-search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server