用途
SPARKIT MCP 是一个 MCP(Model Context Protocol)服务器,用于在 Claude Desktop、Cursor、Claude Code 或其他兼容 MCP 的客户端中调用 SPARKIT 科研智能体。用户通过 LLM 提交科学问题,SPARKIT 会检索文献、阅读相关论文,并返回带引用的 Markdown 报告。
主要能力
该服务器暴露两个工具:
- research:提交一个科学问题。SPARKIT 搜索文献、阅读相关论文,并返回带引用的 Markdown 报告。该工具会阻塞直到任务完成(默认 4 分钟),并以内联方式返回完整报告。
- get_job_status:按 id 获取先前提交的任务。适用于 research 在任务完成前返回,或需要重新查看过往报告的情况。
安装
提供预发布安装方式,可直接从 GitHub 安装:uv tool install "git+https://github.com/SPARKIT-science/sparkit-mcp.git",直到首个 PyPI 版本发布。安装后会提供 sparkit-mcp 控制台脚本。
使用方式
- 在 https://app.sparkit.science/signup 注册(Try-it 版本 5 次查询收费 10 美元;订阅起价每月 50 美元)。
- 访问 https://app.sparkit.science/keys 创建密钥。
- 复制密钥,密钥仅显示一次。
- 配置 MCP 客户端。
配置 Claude Desktop
编辑 claude_desktop_config.json: macOS 路径:~/Library/Application Support/Claude/claude_desktop_config.json Windows 路径:%APPDATA%\Claude\claude_desktop_config.json 重启 Claude Desktop。聊天输入框旁边的工具图标中应出现 sparkit。 如果 sparkit-mcp 不在 Claude Desktop 的 PATH 中(uv tool 常见情况),使用绝对路径;可通过 which sparkit-mcp(在 uv tool install 后)查找路径。
配置 Cursor
编辑 ~/.cursor/mcp.json(或项目中的 .cursor/mcp.json): 重新加载 Cursor(Cmd+Shift+P → "Reload Window")。
调用示例
配置完成后,向 LLM 提问: Use SPARKIT to look up the most recent literature on the role of WRNIP1 as a synthetic-lethal target in cancer. LLM 将调用 research。预计等待 60-180 秒,然后返回带内联引用和编号来源列表的 Markdown 报告。
工具参数
- research(question, response_format?, include_citations?, max_wait_seconds?) 返回 Markdown。超时则返回包含 job_id 的状态行,以便 LLM 之后调用 get_job_status。
- get_job_status(job_id) 如果任务已完成,返回带引用的 Markdown 报告;如果仍在运行,返回状态行;否则返回错误信息。
适用场景
适用于需要在对话式 AI 客户端中快速获取文献综述、研究进展或特定科学问题答案的研究人员、学生或开发者。
限制与故障排查
- 认证失败:SPARKIT_API_KEY 未设置或无效。检查 claude_desktop_config.json 是否有拼写错误,编辑后重启 Claude Desktop。
- 配额耗尽:月度查询次数或 Try-it 额度用完。访问 https://app.sparkit.science/billing。
- 工具未出现在 Claude Desktop:检查日志。 macOS:~/Library/Logs/Claude/mcp-server-sparkit.log Windows:%LOCALAPPDATA%\Claude\Logs\mcp-server-sparkit.log 最常见问题是 command: sparkit-mcp 不在 PATH 中;请替换为 which sparkit-mcp 得到的绝对路径。
- 任务超时:max_wait_seconds 上限为 540 秒(9 分钟)。对于非常深入的问题,建议提交后轮询 get_job_status,而非内联等待。SPARKIT 也会自动取消超过其内部限制的任务。