🔍 通过简单的MCP接口,使AI助手能够搜索并访问Google Scholar论文。
Google Scholar MCP Server通过模型上下文协议(MCP)在AI助手与Google Scholar之间提供了一个桥梁。它允许AI模型以编程方式搜索学术论文并访问其内容。
要通过Smithery自动安装Google Scholar Server for Claude Desktop:
npx -y @smithery/cli@latest install @JackKuo666/google-scholar-mcp-server --client claude --config "{}"
在设置 → Cursor 设置 → MCP → 添加新服务器中粘贴以下内容:
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 "{}"
克隆仓库:
git clone https://github.com/JackKuo666/google-scholar-MCP-Server.git
cd google-scholar-MCP-Server
安装所需依赖项:
pip install -r requirements.txt
对于开发:
# 克隆并设置开发环境
git clone https://github.com/JackKuo666/Google-Scholar-MCP-Server.git
cd Google-Scholar-MCP-Server
# 创建并激活虚拟环境
python -m venv venv
source venv/bin/activate # 在Windows上使用 `venv\Scripts\activate`
# 安装依赖项
pip install -r requirements.txt
启动MCP服务器:
python google_scholar_server.py
一旦服务器运行,您可以在您的AI助手或应用程序中使用提供的MCP工具。这里有一些如何使用这些工具的例子:
result = await mcp.use_tool("search_google_scholar_key_words", {
"query": "人工智能伦理",
"num_results": 5
})
print(result)
result = await mcp.use_tool("search_google_scholar_advanced", {
"query": "机器学习",
"author": "Hinton",
"year_range": [2020, 2023],
"num_results": 3
})
print(result)
result = await mcp.use_tool("get_author_info", {
"author_name": "Geoffrey Hinton"
})
print(result)
这些示例展示了如何使用Google Scholar MCP Server提供的三个主要工具。根据您的具体需求调整参数。
将此配置添加到您的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": []
}
}
}
Google Scholar MCP Server提供了以下工具:
使用关键词在Google Scholar上搜索文章。
参数:
query (str): 搜索查询字符串num_results (int, 可选): 返回的结果数量(默认值:5)返回值: 包含文章信息的字典列表
在Google Scholar上执行高级搜索。
参数:
query (str): 通用搜索查询author (str, 可选): 作者姓名year_range (tuple, 可选): 包含(start_year, end_year)的元组num_results (int, 可选): 返回的结果数量(默认值:5)返回值: 包含文章信息的字典列表
从Google Scholar获取作者的详细信息。
参数:
author_name (str): 要搜索的作者姓名返回值: 包含作者信息的字典
google_scholar_server.py: 主要的MCP服务器实现,使用FastMCPgoogle_scholar_web_search.py: 包含用于搜索Google Scholar的网络抓取逻辑您可以使用以下命令安装所需的依赖项:
pip install -r requirements.txt
欢迎贡献!请随时提交Pull Request。
本项目采用MIT许可证。
此工具仅用于研究目的。请遵守Google Scholar的服务条款,并负责任地使用此工具。