本项目实现了一个用于与Semantic Scholar API交互的模型上下文协议(MCP)服务器。它提供了搜索论文、获取论文和作者详细信息以及抓取引用和参考文献的工具。
semanticscholar Python 包mcp Python 包(模型上下文协议)要通过Smithery自动安装Claude Desktop的semanticscholar服务器:
npx -y @smithery/cli@latest install @JackKuo666/semanticscholar-mcp-server --client claude --config "{}"
在设置 → Cursor 设置 → MCP → 添加新服务器中粘贴以下内容:
npx -y @smithery/cli@latest run @JackKuo666/semanticscholar-m
npx -y @smithery/cli@latest install @JackKuo666/semanticscholar-mcp-server --client windsurf --config "{}"
npx -y @smithery/cli@latest install @JackKuo666/semanticscholar-mcp-server --client cline --config "{}"
克隆此仓库:
git clone https://github.com/JackKuo666/semanticscholar-MCP-Server.git
cd semanticscholar-mcp-server
安装所需的包:
pip install semanticscholar mcp
启动Semantic Scholar MCP服务器:
python semantic_scholar_server.py
服务器启动并监听MCP请求。
使用MCP客户端与服务器交互,并访问以下工具:
search_semantic_scholar: 使用查询字符串搜索论文get_semantic_scholar_paper_details: 获取特定论文的详细信息get_semantic_scholar_author_details: 获取特定作者的详细信息get_semantic_scholar_citations_and_references: 获取论文的引用和参考文献将以下配置添加到您的claude_desktop_config.json中:
(Mac OS)
{
"mcpServers": {
"semanticscholar": {
"command": "python",
"args": ["-m", "semanticscholar_mcp_server"]
}
}
}
(Windows版本):
{
"mcpServers": {
"semanticscholar": {
"command": "C:\\Users\\YOUR\\PATH\\miniconda3\\envs\\mcp_server\\python.exe",
"args": [
"D:\\code\\YOUR\\PATH\\semanticscholar-MCP-Server\\semanticscholar_server.py"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
使用Cline
{
"mcpServers": {
"semanticscholar": {
"command": "bash",
"args": [
"-c",
"source /home/YOUR/PATH/.venv/bin/activate && python /home/YOUR/PATH/semanticscholar_mcp_server.py"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
semantic_scholar_search.py: 包含与Semantic Scholar API交互的函数semantic_scholar_server.py: 实现MCP服务器并定义可用工具欢迎贡献!请随时提交Pull Request。
本项目采用MIT许可证 - 详情见LICENSE文件。