此 MCP 服务器作为大型语言模型 (LLM) 应用与 Brandfetch API 间的桥梁,助力 AI 助手搜索品牌并获取全面品牌信息。它通过实现模型上下文协议,将 Brandfetch 的品牌数据功能无缝融入 LLM 驱动的应用中。
此 MCP 服务器充当大型语言模型 (LLM) 应用程序与 Brandfetch API 之间的桥梁,使 AI 助手能够搜索品牌并检索全面的品牌信息。通过实现模型上下文协议,此服务器将 Brandfetch 的品牌数据功能无缝集成到 LLM 驱动的应用程序中。
# 创建并导航到新项目目录
uv init brandfetch-mcp
cd brandfetch-mcp
# 克隆此仓库
git clone https://github.com/VincentSolconBraze/brandfetch-mcp.git .
# 添加依赖项
uv add "mcp[cli]" httpx python-dotenv
# 开发用途
uv add --dev pytest pytest-asyncio pytest-cov ruff pyright pre-commit
# 克隆此仓库
git clone https://github.com/VincentSolconBraze/brandfetch-mcp.git
cd brandfetch-mcp
# 安装依赖项
pip install "mcp[cli]" httpx python-dotenv
# 开发用途
pip install pytest pytest-asyncio pytest-cov ruff pyright pre-commit
.env 文件:cp .env.example .env
.env 文件中:BRANDFETCH_API_KEY=your_api_key
BRANDFETCH_CLIENT_ID=your_client_id
您可以在 Brandfetch 上创建账户并获取凭证。
# 搜索品牌
search_brands(query="apple", limit=5)
# 获取特定品牌信息
get_brand_info(brand_id="12345")
# 结合字段筛选
get_brand_info(brand_id="67890", fields=["name", "logo"])
# 在 Claude Desktop 中运行
claudius run
# 在 MCP Inspector 中运行
inspect
# 直接在终端中运行
python3 main.py
search_brands:按品牌名称搜索品牌并获取基本信息。
query:要搜索的品牌关键词。limit:返回的结果数量限制。get_brand_info:检索指定品牌的详细信息。
brand_id:品牌的唯一标识符。fields:需要检索的具体字段(可选)。# 运行所有测试
pytest tests/
# 生成覆盖率报告
coverage run -m pytest tests/ && coverage html
此项目由 MIT 许可证授权。
MIT 许可证内容