使用说明
语义学者MCP服务器
模型上下文协议(MCP)服务器,用于通过语义学者API搜索和分析学术论文。
免责声明: 该项目并未正式隶属于语义学者或艾伦人工智能研究所,也未得到其认可或赞助。
先决条件
- Python 3.13+
- 紫外线 包管理器
快速开始
克劳德代码
claude mcp add semantic-scholar -s user -- uvx --from git+https://github.com/akapet00/semantic-scholar-mcp semantic-scholar-mcp
克劳德桌面版
添加到配置文件(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上, %APPDATA%\Claude\claude_desktop_config.json 在Windows上):
{
"mcpServers": {
"semantic-scholar": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/akapet00/semantic-scholar-mcp",
"semantic-scholar-mcp"
]
}
}
}
光标
增添 ~/.cursor/mcp.json:
{
"mcpServers": {
"semantic-scholar": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/akapet00/semantic-scholar-mcp",
"semantic-scholar-mcp"
]
}
}
}
帆板运动
增添 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"semantic-scholar": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/akapet00/semantic-scholar-mcp",
"semantic-scholar-mcp"
]
}
}
}
OpenCode
增添 opencode.json:
{
"mcpServers": {
"semantic-scholar": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/akapet00/semantic-scholar-mcp",
"semantic-scholar-mcp"
]
}
}
}
其他客户
任何兼容MCP的客户端都可以通过stdio传输使用此服务器。使用以下命令运行服务器:
uvx --from git+https://github.com/akapet00/semantic-scholar-mcp semantic-scholar-mcp
API密钥(可选)
服务器在没有API密钥的情况下工作。对于更高的速率限制,请在以下位置获取密钥https://www.semanticscholar.org/product/api并将其作为环境变量传递。
| 访问级别 | 速率限制 |
|---|---|
| 无密钥 | 每5分钟5000个请求(共享池) |
| 每秒有 | 1个请求(专用) |
克劳德代码:
claude mcp add semantic-scholar -s user -e SEMANTIC_SCHOLAR_API_KEY=your_key -- uvx --from git+https://github.com/akapet00/semantic-scholar-mcp semantic-scholar-mcp
克劳德桌面/光标/Windsurf/OpenCode --添加一个 "env" 阻止配置:
"env": {
"SEMANTIC_SCHOLAR_API_KEY": "your_key"
}
SSL问题
如果你在公司代理或防火墙后面,并看到 CERTIFICATE_VERIFY_FAILED 错误,设置 DISABLE_SSL_VERIFY=true 作为环境变量(与上面的API密钥相同的方法)。仅在受信任的网络中使用此功能。
为什么选择MCP?
无论是否将此MCP服务器连接到Claude Code(Opus 4.6),都运行了相同的提示:
找到Ante Kapetanovic的第一篇期刊论文,并从该论文中提取所有参考文献。
| 无MCP | 有MCP | |
|---|---|---|
| 召回 | 85.3%(58/68参考文献) | 100%(68/68参考文献) |
| 工具调用 | 40(75%失败) | 14(43%失败) |
| 特工转身 | 30 | 10 |
| 副作用 | pip安装,临时文件 | 无 |
如果没有MCP,代理程序的大部分时间都在处理HTTP错误、解析原始HTML和安装包。通过MCP,作者和论文被分为两部分。对引用的发布者限制相同,但恢复速度更快,每个引用都是通过干净的回退检索的。
全面分析: 分析.md
工具
论文
| 工具 | 功能 | 示例 |
|---|---|---|
search_papers |
使用过滤器按关键字搜索论文 | "CRISPR gene editing, 2020-2024, 50+ citations" |
get_paper_details |
获取论文的完整元数据 | "DOI:10.18653/v1/N18-3011" |
get_paper_citations |
查找引用给定论文的论文 | "ARXIV:1706.03762, year 2020-2024" |
get_paper_references |
查找给定论文引用的论文 | "ARXIV:1706.03762" |
作者
| 工具 | 功能 | 示例 |
|---|---|---|
search_authors |
按姓名搜索研究人员 | "Geoffrey Hinton" |
get_author_details |
获取作者资料和出版物 | author ID "1741101" |
get_author_top_papers |
获取作者被引用次数最多的论文 | author ID "1741101", top 10 |
find_duplicate_authors |
检测重复的作者记录 | ["G. Hinton", "Geoffrey Hinton"] |
consolidate_authors |
预览/合并重复记录 | ["1741101", "1741102"] |
建议
| 工具 | 功能 | 示例 |
|---|---|---|
get_recommendations |
基于机器学习的相似论文发现 | "ARXIV:1706.03762" |
get_related_papers |
多文件建议 | positive: [paper1, paper2] |
会话和导出
| 工具 | 功能 | 示例 |
|---|---|---|
list_tracked_papers |
查看本次会话检索到的论文 | source_tool="search_papers" |
clear_tracked_papers |
重置会话跟踪 | -- |
export_bibtex |
将论文导出为BibTeX格式 | file_path="references.bib" |
更新
通过安装时 git+https://...,更新不会自动拉取。要获取最新版本:
# Refresh the cached package
uvx --refresh --from git+https://github.com/akapet00/semantic-scholar-mcp semantic-scholar-mcp
# Or re-add in Claude Code
claude mcp remove semantic-scholar -s user
claude mcp add semantic-scholar -s user -- uvx --from git+https://github.com/akapet00/semantic-scholar-mcp semantic-scholar-mcp
您还可以固定到特定的分支、标记或提交:
uvx --from git+https://github.com/akapet00/semantic-scholar-mcp@v0.1.0 semantic-scholar-mcp
发展
git clone https://github.com/akapet00/semantic-scholar-mcp.git
cd semantic-scholar-mcp
uv sync
# Run tests
uv run pytest
# Run integration tests (requires network access)
uv run pytest -m integration
# Lint and format
uv run ruff check src/ tests/
uv run ruff format src/ tests/
# Type checking
uv run ty check src/
# Dev mode with inspector
uv run fastmcp dev src/semantic_scholar_mcp/server.py
配置
看 配置.md 对于所有环境变量(缓存、重试、断路器、日志记录、默认限制)。
另见
- MCP与技能:零语境替代 --克劳德代码技能,以零基础上下文成本实现个人使用的可比结果
- 构建语义学者MCP --设计决策和实施演练
- MCP与香草剂 --推动该项目的比较分析
- 学者技能来源 --基于技能的轻量级个人工作流程替代方案