FindMine购物造型师
一个模型上下文协议(MCP)服务器,将FindMine强大的产品造型和装备建议与Claude和其他MCP兼容的应用程序集成在一起。
概述
此MCP服务器连接到FindMine的样式API,并通过模型上下文协议向大型语言模型公开其功能。它允许用户:
- 浏览产品和服装信息
- 获取特定产品的服装建议
- 查找视觉上相似的产品
- 获取风格指导和时尚建议
特性
资源
- 产品:详细的产品信息
product:///URI方案 - 看:完整的着装建议,包括
look:///URI方案
工具
- get_style_guide:获取详细的时尚建议和造型指南
- get_complete_the_look:获取产品的着装建议
- get_visually \_类似:查找视觉上相似的产品
提示
- 舾装_完工:获取整套服装的造型建议
- 样式指南:获取全面的时尚造型指南
- 查找帮助:了解如何使用FindMine的工具和资源
安装
选项1:从npm安装
# Install and run directly (recommended)
npx findmine-mcp
# Or install globally
npm install -g findmine-mcp
findmine-mcp选项2:使用Docker运行
docker run -e FINDMINE_APP_ID=your_app_id findmine/mcp-server:latest选项3:从源代码克隆和构建
# Clone the repository
git clone https://github.com/findmine/findmine-mcp.git
cd findmine-mcp
# Install dependencies
npm install
# Build the server
npm run build
# For development with auto-rebuild
npm run watch配置
环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
FINDMINE_API_URL | FindMine API基础URL | https://api.findmine.com |
FINDMINE_APP_ID | 您的FindMine应用程序ID | DEMO_APP_ID |
FINDMINE_API_VERSION | 要使用的API版本 | v3 |
FINDMINE_DEFAULT_REGION | 默认地区代码 | us |
FINDMINE_DEFAULT_LANGUAGE | 默认语言代码 | en |
FINDMINE_CACHE_ENABLED | 启用响应缓存 | true |
FINDMINE_CACHE_TTL_MS | 缓存生存时间(毫秒) | 3600000(1小时) |
NODE_ENV | 样本数据设置为“开发” | - |
使用Claude Desktop
服务器在安装过程中会自动配置Claude Desktop。验证:
macOS:
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json窗户:
type %APPDATA%\Claude\claude_desktop_config.json发展
可用脚本
# Build and watch
npm run build # Build the project
npm run watch # Watch for changes and rebuild
npm run typecheck # Run TypeScript type checking
# Testing
npm test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:coverage # Run tests with coverage report
# Code quality
npm run lint # Run ESLint
npm run lint:fix # Run ESLint with auto-fix
npm run format # Format code with Prettier
npm run format:check # Check code formatting
# Development tools
npm run inspector # Run MCP inspector (http://localhost:5173)测试
该项目使用Vitest进行测试。测试位于 __tests__/ 源文件旁边的目录。
# Run tests in watch mode
npm test
# Run tests once (useful for CI)
npm run test:run
# Generate coverage report
npm run test:coverage代码质量
在提交代码之前:
# Run all checks
npm run typecheck && npm run lint && npm run format:check && npm run test:run该项目使用:
- 埃斯林特 用于支持TypeScript的linting
- 更漂亮 用于代码格式化
- 维测试 用于测试
- GitHub操作 用于CI/CD
发展模式
使用示例数据运行服务器:
NODE_ENV=development npm run build && node build/index.js自定义样式指南
风格指南可以定制,以匹配您品牌的特定造型理念和时尚指南。要自定义样式指南,请执行以下操作:
- 在中查找样式指南
src/content/style-guides.ts - 修改每个类别的内容(
general,color_theory,body_types等等) - 通过扩展来添加新类别
styleGuides对象 - 定制针对特定场合和季节的建议
添加自定义样式指南类别的示例:
// In src/content/style-guides.ts
export const styleGuides: Record = {
// Existing categories...
// Add your custom category
your_brand_style: `# Your Brand Style Guide
## Brand Aesthetic
- Key elements of your brand's visual identity
- Core style principles
- Signature looks and combinations
## Your Brand's Styling Do's
- Brand-specific styling recommendations
- Preferred color combinations
- Signature styling techniques
## Your Brand's Styling Don'ts
- Combinations to avoid
- Styling approaches that don't align with brand identity
- Common styling mistakes to avoid
`
};对于完全自定义,您可以修改整个 get_style_guide 处理程序在 src/handlers/tools.ts.
项目结构
src/
├── index.ts # MCP server bootstrap and initialization
├── config.ts # Environment configuration
├── api/ # FindMine API client
│ └── findmine-client.ts
├── handlers/ # MCP protocol handlers
│ ├── tools.ts # Tool execution handlers
│ ├── resources.ts # Resource handlers
│ └── prompts.ts # Prompt handlers
├── tools/ # Tool definitions with MCP annotations
│ └── index.ts
├── schemas/ # Zod validation schemas
│ ├── tool-inputs.ts # Input validation for all tools
│ └── index.ts
├── content/ # Static content
│ └── style-guides.ts # Style guide content
├── prompts/ # Prompt definitions
│ ├── findmine-help.ts
│ ├── outfit-completion.ts
│ ├── styling-guide.ts
│ └── index.ts
├── services/ # Business logic layer
│ └── findmine-service.ts
├── types/ # TypeScript type definitions
│ ├── findmine-api.ts
│ └── mcp.ts
└── utils/ # Utility functions and helpers
├── cache.ts
├── formatters.ts
├── logger.ts
├── mock-data.ts
└── resource-mapper.ts技术细节
此服务器由以下组件构建:
- MCP SDK 1.24.2 完全符合规范(2025-11-25)
- 工具注释 用于只读、破坏性和开放世界提示
- Zod验证 适用于所有工具输入
- 模块化架构 关注点分散
- 100%测试覆盖率 论效用函数
API示例
获取风格指南
{
"name": "get_style_guide",
"arguments": {
"category": "color_theory",
"occasion": "wedding"
}
}完成外观
{
"name": "get_complete_the_look",
"arguments": {
"product_id": "P12345",
"product_color_id": "C789"
}
}获得视觉上相似的产品
{
"name": "get_visually_similar",
"arguments": {
"product_id": "P12345",
"product_color_id": "C789",
"limit": 5
}
}出版
发布到npm
# Login to npm
npm login
# Publish the package
npm publish
# Update the version for future releases
npm version patch发布到Docker Hub
# Build the Docker image
docker build -t findmine/mcp-server:latest .
# Login to Docker Hub
docker login
# Push the image
docker push findmine/mcp-server:latest许可证
该项目根据MIT许可证获得许可。
