科技博物馆集团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。
对于MacOS:
brew install uv
对于Windows:
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操作。