photo-marketplace-listing-assistant
This MCP server analyzes product photos using AI to generate listing drafts, publishes to Mercari Shops via GraphQL API, and exports drafts for other marketplaces.
README
Photo Marketplace Listing Assistant
スマートフォンで商品写真を撮り、AIでタイトル・説明・状態・価格候補・確認事項を生成するWebアプリです。メルカリShopsは公式GraphQL APIで非公開/公開出品まで行えます。個人版メルカリとYahoo!オークションは、公式の一般向け出品APIが確認できない、または自動出品が制限されるため、確認用原稿とCSVを生成します。
AIは写真に写っていない型番、真贋、動作、傷を保証しません。出品者が必ず最終確認してください。
できること
- スマホのカメラ撮影、最大4枚の写真選択、ブラウザ内画像圧縮
- OpenAI Responses APIの画像入力とStructured Outputsによる日本語出品原稿
- メルカリShops公式APIの
createProduct、productCategories、states - Cloudflare R2へ画像保存し、公式APIが取得できるHTTPS URLを発行
- 個人版メルカリ/Yahoo!オークション向けコピー・CSV
- stdio MCPサーバー(写真解析、公式API出品、原稿整形)
- Cloudflare Pages、GitHub Actions、Codespaces/devcontainer
アーキテクチャと処理の流れ
flowchart LR
U[スマートフォンのカメラ] --> P[React / Vite Web UI]
P -->|data URL + 補足| A[Pages Function /api/analyze]
A --> O[OpenAI Responses API]
O --> A --> P
P -->|画像| I[Pages Function /api/images]
I --> R[(Cloudflare R2)]
R --> H[公開HTTPS画像URL]
P -->|確認済み商品データ| M[Pages Function /api/mercari/publish]
H --> M
M -->|Bearer + User-Agent| S[Mercari Shops GraphQL API]
P --> E[個人版向けコピー / CSV]
C[AIクライアント] --> X[stdio MCP Server]
X --> O
X --> S
G[GitHub Actions] --> T[Typecheck / Test / Build]
G --> D[dist artifact]
詳細設計は docs/architecture.md、初期設定は docs/setup.md を参照してください。
最短セットアップ
- Cloudflare PagesのSettings → Variables and Secretsへ
OPENAI_API_KEYをSecretとして登録。 - R2 bucketを作り、Pagesプロジェクトに
LISTING_IMAGESというbinding名で接続。 PUBLIC_BASE_URLにPages本番URLを登録。- メルカリShopsでAPI利用契約・Personal API Access Tokenを取得し、
MERCARI_SHOPS_TOKENとMERCARI_SHOPS_USER_AGENTをSecret登録。 - まずSandboxと
UNOPENED(非公開)でテスト。
メルカリShops APIはアクセストークンと正しいUser-Agentを要求します。また契約・環境によって日本国内の登録済み固定IPが必要です。Cloudflare Pagesの送信元を登録できない場合は固定IP relayを用意し、MERCARI_API_PROXY_URL に設定します。
MCP
npm install
OPENAI_API_KEY=... npm run mcp
MCPクライアント設定例:
{
"mcpServers": {
"photo-listing": {
"command": "npm",
"args": ["run", "mcp"],
"cwd": "/absolute/path/to/photo-marketplace-listing-assistant",
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}",
"MERCARI_SHOPS_TOKEN": "${MERCARI_SHOPS_TOKEN}",
"MERCARI_SHOPS_USER_AGENT": "${MERCARI_SHOPS_USER_AGENT}"
}
}
}
}
公開tools:
analyze_listing_photospublish_mercari_shopsexport_marketplace_draft
開発・検証
npm install
npm run dev
npm run typecheck
npm test
npm run build
公式資料と採用判断
- Mercari Shops GraphQL API:
https://api.mercari-shops.com/docs/index.html - Production:
https://api.mercari-shops.com/v1/graphql - Sandbox:
https://api.mercari-shops-sandbox.com/v1/graphql - Yahoo!オークション旧Web API終了案内:
https://developer.yahoo.co.jp/changelog/2020-01-24-auction.html
非公式スクレイピング、ログインCookie共有、CAPTCHA回避、個人アカウントへの無許可ブラウザ自動出品は採用していません。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.