christmas-mcp-image-describe
Version:
MCP server that analyzes images and provides structured metadata for website placement decisions using OpenAI GPT-4o Vision API
28 lines (21 loc) • 968 B
JavaScript
import { analyzeImage } from '../src/imageAnalyzer.js';
// Example usage of the analyzeImage function
async function example() {
const apiKey = 'your-openai-api-key-here';
const project = 'your-openai-project-id-here'; // optional
try {
// Example 1: Basic image analysis
const result1 = await analyzeImage('./images/hero.jpg', 'homepage hero', apiKey, project);
console.log('Hero Image Analysis:', result1);
// Example 2: Team photo for about section
const result2 = await analyzeImage('./images/team.jpg', 'about section', apiKey, project);
console.log('Team Image Analysis:', result2);
// Example 3: Product image
const result3 = await analyzeImage('./images/product.png', 'product showcase', apiKey, project);
console.log('Product Image Analysis:', result3);
} catch (error) {
console.error('Error:', error.message);
}
}
// Uncomment to run the example
// example();