这是一个实验性的模型上下文协议(MCP)服务器实现,它允许AI助手从澳大利亚主要超市——科尔斯(Coles)和伍尔沃斯(Woolworths)搜索产品信息。该服务器通过MCP协议提供产品搜索功能,方便AI助手获取产品价格和详细信息。
git clone https://github.com/hung-ngm/coles-woolworths-mcp-server.git
cd coles-woolies-mcp
uv 包管理器uv 是一个快速的Python包安装程序和解析器。安装方法如下:
curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
uv 安装依赖项:# 安装依赖项
uv pip install fastmcp requests python-dotenv
服务器使用以下环境变量:
COLES_API_KEY:访问科尔斯API的API密钥(科尔斯产品搜索必需)你可以在项目目录的 .env 文件中设置这些变量。
要直接使用 uv 运行科尔斯和伍尔沃斯MCP服务器,请执行以下命令:
uv run main.py
默认情况下,服务器使用标准输入输出传输进行MCP客户端集成。
要在Claude桌面版中使用科尔斯和伍尔沃斯MCP服务器,请按以下步骤操作:
claude_desktop_config.json)mcpServers 部分添加以下配置:{
"mcpServers": {
"coles-woolies-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"--with",
"requests",
"--with",
"python-dotenv",
"fastmcp",
"run",
"/full/path/to/coles-woolies-mcp/main.py"
]
}
}
}
将 /full/path/to/coles-woolies-mcp/main.py 替换为你的 main.py 文件的绝对路径。
3. 重启Claude桌面版使更改生效
要与Cursor IDE集成,请按以下步骤操作:
mcpServers 部分添加以下内容:{
"mcpServers": {
"coles-woolies-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"--with",
"requests",
"--with",
"python-dotenv",
"fastmcp",
"run",
"/full/path/to/coles-woolies-mcp/main.py"
]
}
}
}
科尔斯和伍尔沃斯MCP服务器提供以下工具:
get_coles_products:在科尔斯超市搜索产品,可选择特定店铺get_woolworths_products:在伍尔沃斯超市搜索产品你可以在Claude中这样使用这些工具:
能否查询一下吉百利巧克力在科尔斯和伍尔沃斯的价格?
Claude随后会使用相应的工具搜索产品并返回结果。
https://github.com/user-attachments/assets/0af3b07a-578a-4112-acfe-e7a7eee31161