学术论文搜索服务

Google Scholar MCP Server是一个通过模型上下文协议(MCP)连接AI助手和Google Scholar的桥梁,支持搜索学术论文、获取元数据和作者信息,为学术研究提供支持。

  • by JackKuo666
  • Python
  • 本地部署
  • 426 星标
  • 更新于
在 GitHub 查看 JackKuo666/Google-Scholar-MCP-Server

使用说明

谷歌学术MCP服务器

🔍 使人工智能助手能够通过简单的MCP界面搜索和访问谷歌学术论文。

Google Scholar MCP服务器通过模型上下文协议(MCP)在AI助手和Google Scholar之间提供桥梁。它允许人工智能模型以程序化的方式搜索学术论文并访问其内容。

✨ 核心功能

  • 🔎 论文搜索:使用自定义搜索字符串或高级搜索参数查询谷歌学术论文✅
  • 🚀 高效检索:快速访问纸质元数据✅
  • 👤 作者信息:检索作者的详细信息✅
  • 📊 研究支持:促进学术研究和分析✅

🚀 快速开始

手动安装

通过Smithery安装

通过以下方式自动安装克劳德桌面版谷歌学者服务器 史密瑟里:

克劳德

npx -y @smithery/cli@latest install @JackKuo666/google-scholar-mcp-server --client claude --config "{}"

光标

将以下内容粘贴到设置中→ 光标设置→ MCP → 添加新服务器:

  • Mac/Linux
npx -y @smithery/cli@latest run @JackKuo666/google-scholar-mcp-server --client cursor --config "{}" 

帆板运动

npx -y @smithery/cli@latest install @JackKuo666/google-scholar-mcp-server --client windsurf --config "{}"

渐变群

npx -y @smithery/cli@latest install @JackKuo666/google-scholar-mcp-server --client cline --config "{}"
  1. 克隆存储库:

    git clone https://github.com/JackKuo666/google-scholar-MCP-Server.git
    cd google-scholar-MCP-Server
    
  2. 安装所需的依赖项:

    pip install -r requirements.txt
    

发展:

# Clone and set up development environment
git clone https://github.com/JackKuo666/Google-Scholar-MCP-Server.git
cd Google-Scholar-MCP-Server

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

# Install dependencies
pip install -r requirements.txt

📊 用法

启动MCP服务器:

python google_scholar_server.py

服务器运行后,您可以在AI助手或应用程序中使用提供的MCP工具。以下是一些如何使用这些工具的示例:

示例1:使用关键字搜索论文

result = await mcp.use_tool("search_google_scholar_key_words", {
    "query": "artificial intelligence ethics",
    "num_results": 5
})
print(result)

示例2:执行高级搜索

result = await mcp.use_tool("search_google_scholar_advanced", {
    "query": "machine learning",
    "author": "Hinton",
    "year_range": [2020, 2023],
    "num_results": 3
})
print(result)

示例3:获取作者信息

result = await mcp.use_tool("get_author_info", {
    "author_name": "Geoffrey Hinton"
})
print(result)

这些示例演示了如何使用Google Scholar MCP Server提供的三个主要工具。根据具体用例的需要调整参数。

使用Claude Desktop

将此配置添加到您的 claude_desktop_config.json:

(Mac OS)

{
  "mcpServers": {
    "google-scholar": {
      "command": "python",
      "args": ["-m", "google_scholar_mcp_server"]
      }
  }
}

(Windows版本):

{
  "mcpServers": {
    "google-scholar": {
      "command": "C:\\Users\\YOUR\\PATH\\miniconda3\\envs\\mcp_server\\python.exe",
      "args": [
        "D:\\code\\YOUR\\PATH\\Google-Scholar-MCP-Server\\google_scholar_server.py"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

与Cline一起使用

{
  "mcpServers": {
    "google-scholar": {
      "command": "bash",
      "args": [
        "-c",
        "source /home/YOUR/PATH/.venv/bin/activate && python /home/YOUR/PATH/google_scholar_mcp_server.py"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

🛠 MCP工具

Google Scholar MCP服务器提供以下工具:

搜索_谷歌_学者_关键词

使用关键字搜索Google Scholar上的文章。

参数:

  • query (str):搜索查询字符串
  • num_results (int,可选):要返回的结果数(默认值:5)

退货: 包含文章信息的词典列表

搜索_谷歌_学者_高级

在Google Scholar上对文章进行高级搜索。

参数:

  • query (str):一般搜索查询
  • author (str,可选):作者姓名
  • year_range (tuple,可选):包含(start_year,end_year)的tuple
  • num_results (int,可选):要返回的结果数(默认值:5)

退货: 包含文章信息的词典列表

获取作者信息

从Google Scholar获取作者的详细信息。

参数:

  • author_name (str):要搜索的作者姓名

退货: 包含作者信息的词典

📁 项目结构

  • google_scholar_server.py:使用FastMCP的主MCP服务器实现
  • google_scholar_web_search.py:包含用于搜索Google Scholar的网络抓取逻辑

🔧 依赖项

  • Python 3.10+
  • mcp[cli]>=1.4.1
  • 学术性>=1.7.0
  • 异步>=3.4.3

您可以使用以下方式安装所需的依赖关系:

pip install -r requirements.txt

🤝 贡献

欢迎投稿!请随时提交拉取请求。

📄 许可证

该项目根据MIT许可证获得许可。

⚠️ 免责声明

此工具仅用于研究目的。请尊重Google Scholar的服务条款,并负责任地使用此工具。