README
🚀 科技博物馆集团API的模型上下文协议(MCP)服务器
本项目是一个基于Python的MCP(https://modelcontextprotocol.io/introduction)服务器,可让您的大型语言模型(LLM)从英国科技博物馆集团获取数据。相关信息请访问https://github.com/TheScienceMuseum/collectionsonline/wiki/Collections-Online-API#get-search。目前,该项目支持Claude Desktop在MacOS和Windows系统上使用。
🚀 快速开始
集成到Claude Desktop
您只需安装UV(一个用于管理Python包/项目的工具),然后更改Claude Desktop的设置以添加此MCP即可。
安装UV
- MacOS系统:
brew install uv
- Windows系统:
- 使用PowerShell安装:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- 或者使用winget安装:
winget install --id=astral-sh.uv -e
其他安装选项请访问https://docs.astral.sh/uv/getting-started/installation。
配置Claude Desktop
前往Claude Desktop的设置 -> 开发者,编辑配置文件。此操作将在以下位置创建配置文件:
- macOS系统:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows系统:
%APPDATA%\Claude\claude_desktop_config.json
打开该文件并将其内容更改为:
{
"mcpServers": {
"scienceMuseum": {
"command": "uvx",
"args": [
"science-museum-mcp"
]
}
}
}
打开Claude Desktop后,MCP服务器将启动,您就可以对Claude进行查询。例如:
Anthropic为此步骤提供的官方说明请访问:https://modelcontextprotocol.info/docs/quickstart/user/。
🛠️ 开发
本节适用于希望为代码库做出贡献的开发者。
设置和安装依赖项
- 克隆仓库。
- 该项目使用uv(安装链接:https://docs.astral.sh/uv/#installation)进行依赖管理和构建,使用npx(安装链接:https://www.npmjs.com/package/npx)来运行MCP检查器。
- 创建虚拟环境:
uv venv
- 安装依赖项:
uv pip install -r pyproject.toml
- 运行检查器:
./inspector.sh
检查器会输出localhost的URL,用于访问其UI。
运行单元测试
source .venv/bin/activate
pytest
发布
目前发布过程是手动完成的。若项目今后有开发活动,将更改为使用Github操作。
微信扫一扫