hertwill-mcp
Wraps the Hertwill dropshipping API to let AI agents discover products, evaluate margins, manage import lists, and sync to Shopify/WooCommerce via natural language.
README
@hertwill/mcp
A Model Context Protocol server that wraps the Hertwill dropshipping API — letting any MCP-capable AI agent discover products, evaluate margins, manage an import list, and trigger syncs to Shopify/WooCommerce through natural language.
npx @hertwill/mcp
Quick Start
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"hertwill": {
"command": "npx",
"args": ["@hertwill/mcp"],
"env": {
"HERTWILL_API_KEY": "your-api-key-here"
}
}
}
}
Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"hertwill": {
"command": "npx",
"args": ["@hertwill/mcp"],
"env": {
"HERTWILL_API_KEY": "your-api-key-here"
}
}
}
}
VS Code + Copilot
Add to .vscode/mcp.json:
{
"servers": {
"hertwill": {
"type": "stdio",
"command": "npx",
"args": ["@hertwill/mcp"],
"env": {
"HERTWILL_API_KEY": "your-api-key-here"
}
}
}
}
Cline / Continue / Windsurf
Each follows the same pattern — add an MCP server entry pointing to npx @hertwill/mcp with the HERTWILL_API_KEY env var. Refer to your client's MCP configuration docs.
No API key? The server starts without one. All 6 discovery tools work immediately — you only need a key for import list and sync operations. Get one at hertwill.com.
What You Can Ask
Once connected, talk to your AI agent naturally:
- "Find me winning EU-shippable kitchen gadgets under €25"
- "Evaluate product 4827 — is the margin viable for Facebook ads?"
- "Show me trending pet supplies with at least 60% margin potential"
- "Add products 1001, 1002, 1003 to my import list"
- "What's the health of my store connection?"
Tools (12)
Discovery (no API key required)
| Tool | Purpose |
|---|---|
search_products |
Hybrid keyword + semantic search with filters (category, brand, price, stock, EU shipping) |
list_products |
Browse and filter catalog without a search query |
get_product |
Full product detail — variants, shipping regions, descriptions |
evaluate_product |
Factual viability scorecard: margin inputs, shipping, stock, variant spread |
calculate_margin |
Pure-math break-even and margin calculator (no network call) |
check_health |
Server version, API reachability, rate limit bucket state |
Import & Sync (API key required)
| Tool | Purpose |
|---|---|
check_auth |
Validate API key format and authentication status |
list_import_list |
View products in your import list |
add_to_import_list |
Add products by ID to your import list |
remove_from_import_list |
Remove a product from your import list |
get_sync_jobs |
Check Shopify/WooCommerce sync job status |
sync_products |
Trigger a product sync to your connected store |
Prompts (8)
Pre-built workflows the agent can invoke as structured starting points:
| Prompt | Purpose |
|---|---|
hw-winner-scan |
Search, evaluate, and calculate margin in one flow |
hw-niche-research |
Deep-dive a niche with category + brand analysis |
hw-eu-winners |
Find EU-shippable winners with margin analysis |
hw-seasonal-picks |
Discover products for a specific season |
hw-competitor-match |
Find Hertwill alternatives to a competitor product |
hw-margin-check |
Single-product margin deep dive |
hw-import-batch |
Bulk import with mandatory user confirmation |
hw-store-health |
Full store diagnostic: auth, API, import list, sync jobs |
Resources (5)
Static and dynamic context the agent can read:
| Resource | URI |
|---|---|
| Categories taxonomy | hertwill://taxonomy/categories |
| Brands taxonomy | hertwill://taxonomy/brands |
| Product JSON Schema | hertwill://schemas/product |
| Rate limits guide | hertwill://docs/rate-limits |
| EU shipping guide | hertwill://docs/eu-shipping |
Configuration
| Environment Variable | Required | Default | Description |
|---|---|---|---|
HERTWILL_API_KEY |
No | — | Hertwill API key (hw_live_...). Enables import list and sync tools. |
HERTWILL_MCP_LOG_LEVEL |
No | info |
Log level: fatal, error, warn, info, debug, trace |
HERTWILL_MCP_TELEMETRY |
No | false |
Set to true to enable opt-in telemetry (no PII collected) |
Troubleshooting
"Parse error" or garbled output from the MCP client
Cause: Something is writing to stdout besides JSON-RPC frames. Common culprits: an npm lifecycle script printing a banner, or a stray console.log in a dependency.
Fix: Ensure you're using npx @hertwill/mcp directly (not wrapping it in a shell script that echoes). Logs go to stderr, never stdout.
"Unauthorized" or "Invalid API key format"
Cause: The HERTWILL_API_KEY env var is missing, empty, or doesn't match the hw_live_... / hw_test_... format.
Fix: Check the key is set in your MCP client config (not your shell profile — MCP servers don't inherit your shell environment). Get a key at hertwill.com.
"Rate limit exceeded. Retry after Xs."
Cause: You've hit the Hertwill API rate limit (60 req/min public, 300 req/min authenticated).
Fix: The server handles backoff automatically. Wait for the indicated retry period. If you're hitting limits frequently, batch your requests — use hw-import-batch instead of individual add_to_import_list calls.
Development
# Install dependencies
pnpm install
# Run in development
pnpm tsx src/index.ts
# Run tests (436 tests)
pnpm test
# Build
pnpm build
# Full validation (build + lint + security gates + tests)
pnpm validate
Security Gates
The validate script includes four security gates that run in CI:
- check:key-reads —
process.env.HERTWILL_API_KEYaccessed only insrc/config.ts - check:key-leakage — no full-length API key values in the source tree
- check:boundaries — import boundary enforcement between layers
- audit —
pnpm audit --audit-level=highpasses with zero high-severity CVEs
Tech Stack
- Runtime: Node.js >= 20.11, ESM-only
- MCP SDK:
@modelcontextprotocol/sdk^1.29 - Validation: Zod v4
- HTTP: Native
fetch+openapi-fetch(typed, 6 KB) - Rate limiting: Bottleneck (60/min public, 300/min authenticated)
- Retry: p-retry with exponential backoff + jitter
- Logging: Pino to stderr (stdout reserved for JSON-RPC)
- Build: tsup (ESM bundle with shebang)
- Testing: Vitest + MSW + in-process MCP client
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。