Pancake POS MCP
Pancake POS MCP
Pancake POS REST APIをラップしたModel Context Protocol (MCP) サーバー。ClaudeなどのAIアシスタントが、23の専用ツールと7つの参照リソースを使用してベトナムのEコマースPOS運用を管理できるようにします。
概要
Pancake POS MCPは、Pancake POS API (https://pos.pages.fm/api/v1) をModel Context Protocolツールとして公開し、Claudeやその他のAIアシスタントが以下のPOS管理を自動化できるようにします。
コアPOS: 注文、商品、顧客、在庫
サプライチェーン: 倉庫、サプライヤー、仕入れ、移動、棚卸し
販売: 返品、交換、コンボ、プロモーション、クーポン
CRM: 連絡先、案件、活動
マルチチャネル: Eコマース (Shopee/Lazada/TikTok)、ライブストリームコマース
運用: 従業員、Webhook、分析、店舗情報、住所検索
Related MCP server: mcp-server-woocommerce
前提条件
Bun (ランタイム) — https://bun.sh からインストール (
curl -fsSL https://bun.sh/install | bash)Pancake POS APIキー + 店舗ID — 以下のPancake POS認証情報の取得を参照してください。これはPancake POS (Eコマース/在庫) APIであり、Pancakeユーザー/ソーシャルインボックスAPIではありません。製品が異なり、キーも異なります。
Node.js 18+ (オプション、開発ツール用)
クイックスタート
約5分で動作するMCPサーバーを構築します:
# 1. Clone the repo
git clone https://github.com/nguyennguyenit/pancake-pos-mcp.git
cd pancake-pos-mcp
# 2. Install dependencies
bun install
# 3. Configure credentials
cp .env.example .env
# Open .env and fill in PANCAKE_POS_API_KEY + PANCAKE_POS_SHOP_ID
# (See "Getting Pancake POS credentials" section below)
# 4. Verify it runs
bun run src/index.ts
# Expected output:
# [pancake-pos-mcp] Server started on stdio transport
# Press Ctrl+C to stop.
# 5. Connect Claude Desktop — see "Stdio Transport" section belowステップ4でエラーが表示される場合は、.envの値を確認し、bun installを実行したか確認してください。一般的な問題はトラブルシューティングに記載されています。
Pancake POS認証情報の取得
⚠️ Pancake POS ≠ Pancake (ソーシャルインボックス)。このMCPは、https://pos.pages.fm にあるPancake POS製品(Eコマース/在庫/注文管理システム)でのみ動作します。
pages.fmのPancakeユーザー/インボックスAPIは別の製品であり、異なるAPIキーを使用するため、ここではサポートされていません。
Pancake POSアカウントから2つの値が必要です:
PANCAKE_POS_SHOP_ID— 店舗の数値IDhttps://pos.pages.fm にログインし、URLまたは店舗設定を確認して数値の店舗IDを見つけます
PANCAKE_POS_API_KEY— Pancake POS APIトークンPancake POSダッシュボード → Cài đặt (設定) → API → Generate API key
キーは一度しか表示されないため、すぐにコピーしてください
両方の値を秘密にしてください。gitにコミットしないでください。
.gitignoreはすでに.envと.dev.varsを除外しています。
設定
必須 (クイックスタートで設定):
変数 | 用途 |
| Pancake POS APIトークン |
| 数値の店舗ID |
オプション:
変数 | デフォルト | 用途 |
|
| APIエンドポイントのオーバーライド |
|
| HTTPトランスポートポート |
| (なし) | HTTP/Workers認証用のBearerトークン |
使用方法
Stdioトランスポート (Claude Desktop)
デフォルトモード。Claude Desktopの設定 claude_desktop_config.json に追加します:
{
"mcpServers": {
"pancake-pos": {
"command": "bun",
"args": ["run", "/path/to/pancake-pos-mcp/src/index.ts"]
}
}
}HTTPトランスポート (リモートアクセス)
ストリーミング可能なHTTPトランスポートを有効にします:
bun run src/index.ts --httpサーバーは http://localhost:3000/mcp で起動します。ヘルスチェック: http://localhost:3000/health
認証付き (本番環境で推奨):
# .env
PORT=3000
MCP_AUTH_TOKEN=your_secret_token
# Client usage
curl -H "Authorization: Bearer your_secret_token" http://localhost:3000/mcpCloudflare Workers (サーバーレスエッジ)
Cloudflare Workersにグローバルにデプロイし、どこからでも低遅延でアクセスできるようにします:
# Local development (uses .dev.vars for secrets)
cp .dev.vars.example .dev.vars
# Edit .dev.vars with your credentials
bun run dev:workers
# Runs at http://localhost:8787
# Deploy to Cloudflare
wrangler login
bun run deploy
# Set production secrets
wrangler secret put PANCAKE_POS_API_KEY
wrangler secret put PANCAKE_POS_SHOP_ID
wrangler secret put MCP_AUTH_TOKENWorkers URL: https://pancake-pos-mcp.<your-subdomain>.workers.dev/mcp
mcp-remote経由でClaude Desktopを接続:
{
"mcpServers": {
"pancake-pos": {
"command": "npx",
"args": [
"mcp-remote",
"https://pancake-pos-mcp.<your-subdomain>.workers.dev/mcp",
"--header", "Authorization: Bearer <your-token>"
]
}
}
}Workersの特性: アップストリーム呼び出しごとに8秒のタイムアウト、2回のリトライ、レート制限無効 (リクエストごとのステートレスモデル)。無料枠: 1日10万リクエスト。詳細はデプロイガイドを参照してください。
利用可能なツール
ツール | フェーズ | 説明 |
| 1 | 注文の作成、読み取り、更新、削除、印刷、出荷、ステータス管理 |
| 1 | バリエーションと価格を含む商品カタログの管理 |
| 1 | 顧客のCRUD、ポイント、取引履歴 |
| 1 | 倉庫、カテゴリ、サプライヤーでフィルタリングされた在庫レポート |
| 2 | 倉庫のCRUDと設定 |
| 2 | サプライヤーの連絡先とプロファイル管理 |
| 2 | 発注書と入荷在庫 |
| 2 | 倉庫間移動の管理 |
| 2 | 実地棚卸し記録 |
| 3 | 注文の返品と交換処理 |
| 3 | 商品バンドル販売と期間限定オファー |
| 3 | 割引キャンペーン (パーセント/金額ベース) |
| 3 | クーポンコードの生成と使用状況の追跡 |
| 4 | CRM連絡先のCRUDと関係管理 |
| 4 | 販売パイプラインの案件とステージ |
| 4 | 連絡先/案件に紐付く通話、会議、タスク、メモ |
| 4 | マルチチャネル同期 (Shopee, Lazada, TikTok) |
| 4 | ライブ販売セッションの管理とスケジュール |
| 5 | スタッフ管理と倉庫割り当て |
| 5 | イベントサブスクリプションとWebhook設定 |
| 5 | 在庫、販売、注文の分析 (グループ化可能) |
| 5 | 店舗プロファイル情報と設定 |
| 5 | ベトナムの住所階層 (省 → 郡 → 村) |
利用可能なリソース
静的参照リソース (認証不要):
リソース | 内容 |
| ベトナム語/英語名付きの16の注文ステータスコード |
| 販売チャネルコード (Facebook, Shopee, Lazadaなど) |
| 注文リスト用の22のソートオプション |
| Webhookイベントタイプ (order.created, order.updatedなど) |
| HTTPエラーコード参照 |
| APIレート制限 (1000/分, 10000/時間) |
| 配送パートナーのライブデータ (APIからキャッシュ) |
アーキテクチャ
APIクライアント: トークンバケットレート制限 (1000/分, 10000/時間)、指数バックオフリトライ (3回試行)
ツール: ビジネスドメインごとに整理された23のMCPツール
スキーマ検証: 厳密なランタイム検証のための判別共用体を持つZod
トランスポート: Stdio (デフォルト) + ストリーミング可能なHTTP + オプションのBearerトークン認証付きCloudflare Workers
エラー処理: コードとメッセージを含む構造化されたエラーレスポンス
開発
型チェック
bun run typecheckテストの実行
bun run test # vitest (includes Workers tests)プロジェクト構造
src/
├── api-client/ # HTTP layer with rate limiting
│ ├── pancake-http-client.ts
│ ├── request-builder.ts
│ └── response-parser.ts
├── tools/ # 23 MCP tools (23 files)
├── resources/ # MCP reference resources
├── shared/ # Schemas, errors, pagination
├── config.ts # Environment configuration
├── server.ts # MCP server factory
├── worker.ts # Cloudflare Workers entry point
└── index.ts # Entry point (stdio + HTTP)開発ガイドラインの詳細はdocs/code-standards.mdを参照してください。
ドキュメント
codebase-summary.md — アーキテクチャと実装の概要
system-architecture.md — 詳細なシステム設計とデータフロー
code-standards.md — TypeScriptとツールの実装基準
project-overview-pdr.md — プロジェクトの要件と機能
deployment-guide.md — セットアップとデプロイの手順
project-roadmap.md — 実装の進捗とマイルストーン
poscake-api-docs.md — Pancake POS API完全リファレンス
トラブルシューティング
いくつかの注意点:
429 Too Many Requests— Pancakeのレート制限 (1000/分, 10000/時間) に達しました。組み込みのトークンバケットが自動的にスロットリングします。呼び出し側の並列処理を減らしてください。テストが
Cannot find package 'cloudflare:test'で失敗する — ネイティブのbun testではなくbun run test(vitest) を使用してください。Workersのテストにはvitestプールワーカープラグインが必要です。Claude Desktopがツールを認識しない —
claude_desktop_config.jsonのcommand/argsパスは絶対パスである必要があります。設定を編集した後はClaude Desktopを再起動してください。
その他のエラーについては、エラーメッセージを確認し、.envの認証情報を検証してください。
ライセンス
MITライセンス — 全文はLICENSEファイルを参照してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server built with the mcp-framework for developing and managing custom tools. It provides a structured foundation for building and integrating modular components like data processors and API clients into Claude Desktop.11 npm-
- AlicenseBqualityCmaintenanceMCP server for managing WooCommerce stores through AI assistants like Claude. Provides 101 tools covering products, orders, customers, coupons, shipping, taxes, webhooks, settings, reports, and more.10098 npm2MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to manage Vietnamese e-commerce POS operations including orders, products, customers, inventory, supply chain, sales, CRM, and multi-channel integration via Pancake POS API.31MIT
- AlicenseAqualityBmaintenanceMCP server for the Shopline Open API. Exposes 140+ tools for querying and managing orders, products, customers, promotions, analytics, and store settings from your Shopline store via Claude.100MIT