claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🧪mp-test-setup

プラグイン
mercadopago
ライセンス
Apache-2.0

説明

Mercado Pagoのテスト用ユーザーを作成し、そのユーザーに資金を追加します。 MCPの`create_test_user`および`add_money_test_user`をラップしています。 認証情報は`APP_USR-`形式(Orders API、Checkout Pro、Point、QR向け)と`TEST-`形式(Checkout API、Bricks、Payments API向け)の2種類で発行される点を明示しており、どちらも有効かつ現在も発行中です。

原文を表示

Create test users and add funds to them for Mercado Pago testing. Wraps create_test_user and add_money_test_user from the MCP. Clarifies that credentials come in APP_USR- (Orders API, Checkout Pro, Point, QR) and TEST- (Checkout API, Bricks, Payments API) formats — both are valid and actively issued.

ユースケース

  • テスト用ユーザーを作成する
  • テストユーザーに資金を追加する
  • 決済APIの動作検証

本文(日本語訳)

mp-test-setup

このskillはテストユーザーが作成される唯一の場所です。存在する理由は、テストモデルが頻繁に混乱の原因となるためです。異なるプリフィックスを持つ2つの異なるタイプのテスト認証情報があります。


Pre-check — テストユーザー作成前の準備確認

あなたは統合ジャーニーの**ステップ4(全7ステップ)**にいます: 1. アプリ作成 · 2. TEST認証情報取得 · 3. Scaffold · 4. テストユーザー作成 ← ここ · 5. E2E · 6. /mp-review · 7. 本番環境

テストユーザーを作成する前に、AskUserQuestionを使用して基本事項を確認してください(最大3つの質問 — .mp-integrate-progress.mdで既に確認されているものはスキップ):

  1. アカウント.mp-integrate-progress.mdで既に確認されている場合はスキップ。それ以外:「Mercado Pagoデベロッパーアカウントはお持ちですか?」 → Yes / No
  2. 認証情報 — 「APP_USR-アクセストークンはお持ちですか?」 → Yes / No
  3. 認証情報タイプ — 「{test_tab}のTEST認証情報を使用していますか?」 → Yes, test credentials / No, production credentials / I don't know
  • アカウントなし → 国別のダッシュボードを指示(チリ: https://www.mercadopago.cl/developers.comなし; その他 https://www.mercadopago.com.{cc}/developers)。

  • 認証情報なし → MCPが認証済み(Step 0 → State A)の場合:(1) application_listを呼び出す、(2) AskUserQuestionで「どのアプリを使用したいですか?」と質問し、各アプリを名前で一覧表示、(3) 選択したapplication_idmcp__plugin_mercadopago_mcp__get_credentialsを呼び出す、(4) 認証情報をインラインで表示。ファイルに書き込んだりcommitしないこと。 MCPが認証されていない場合、まずStep 0を完了してください。

  • 認証情報タイプ — 本番環境認証情報または不明 → 次のブロッキング警告を表示し、テストユーザーを作成しないでください:

    警告 — 本番環境認証情報が検出されました 本番環境に対してテストするとカード課金が発生する可能性があります。デベロッパーダッシュボードの**{test_tab}**タブに切り替えてください。 👉 https://{DOMAIN}/developers/panel/app → Credentials → {test_tab} tab

    開発者が「Yes, test credentials」と確認するまで質問3を再表示します。このゲートにはスキップオプションなし — それ以外の場合はStep 2(テストユーザー作成)に進まないでください。

mp-integrateとは異なり、このskillのMCPゲートはhardのままです:テストユーザーの作成には認証されたMCP呼び出しが必要なため、scaffold専用パスはありません。


現在のテストモデル — まず読んでください

  • 認証情報プリフィックス — 2つの異なるタイプ:
    • APP_USR-create_test_userからのテストユーザー認証情報、本番環境認証情報、Orders API、Checkout Pro、Point、QR
    • TEST- → {test_tab}タブからの静的テスト認証情報、Checkout API / Bricks / Payments API 両方とも有効です。get_credentialsは正しいフォーマットを自動的に返します。開発者にプリフィックスを変更するよう指示しないでください。
  • テストユーザー認証情報はAPP_USR-プリフィックスを使用し、本番環境APIに対して動作します。テストユーザーは独自の残高を持ち(このskillで読み込む)、実際のアカウントのように動作します。
  • テストユーザーを作成せずに静的テスト認証情報を使用する場合:デベロッパーダッシュボードでアプリに移動 → Credentials → **{test_tab}**タブをクリック。

Step 0 — MCPが実際に認証されているか確認

ListMcpResourcesToolはこのMCPに対して信頼性がありません(常に「No resources found」を返す)。bootstrapツールauthenticate / complete_authenticationは常に存在し、何も証明しません。

mcp__plugin_mercadopago_mcp__application_listが呼び出し可能かつ少なくとも1つのアプリケーションを返すかを確認。そうでない場合、直ちにmcp__plugin_mercadopago_mcp__authenticateを呼び出し、以下を表示:

テストユーザーを作成するにはMercado Pagoアカウントへのアクセスが必要です。このリンクを開いて接続してください:Connect Mercado Pago ブラウザに「Authentication Successful」が表示されたら、戻ってきて何でも言ってください。

ユーザーが戻ってきたら、application_listを直接呼び出してください — 先にcomplete_authenticationを呼び出さないでください。ユーザーにコールバックURLを貼り付けるよう求めないでください。


Step 1 — 質問の前にsite_idを解決

MCPは現在site_idを返していません(そのapplication_listAppID/AppName/AppDescriptionのみを返し、/users/meを呼び出すことを許可するOAuthアクセストークンはpluginクライアントに公開されていません)。以下の順序で解決:

  1. agentが既に渡した国をcountry=として使用 — agentが既に解決しています(永続化状態またはウィザード)。
  2. プロジェクトルートの.mp-integrate-progress.mdを読む — 前のrun で国が永続化されている場合、それを再利用。
  3. 最後の手段AskUserQuestionで質問(ピッカー、番号付きテキストブロックは使用しない)。答えを.mp-integrate-progress.mdに永続化。

リポジトリでcurrency_id/site_idリテラルまたはロケール文字列をgrepしないでください — クリーンなリポジトリでは信頼性がなく、トークンを浪費します。

Step 2 — テストユーザーを作成

以下のパラメータでmcp__plugin_mercadopago_mcp__create_test_userを呼び出し:

パラメータ 必須
site_id yes MLA(アルゼンチン)、MLB(ブラジル)、MLM(メキシコ)、MLC(チリ)、MCO(コロンビア)、MPE(ペルー)、MLU(ウルグアイ)
description yes ユーザーを識別するフリーテキスト(例:"buyer for checkout-pro tests"
profile yes sellerまたはbuyer — シミュレートする必要なロールを選択
amount optional 国の通貨での初期残高

ツールはユーザーid、メール、パスワード、APP_USR-認証情報を返します。

⚠️ 重要な区別 — 2つのタイプの認証情報:

  • テストユーザーメール+パスワード → テスト中にチェックアウトページでバイヤー/セラーとしてログインするために使用.envのためではありません。
  • テストユーザーAPP_USR-認証情報 → テストユーザー自身のAPI認証情報。そのテストユーザーとしてAPI呼び出しをする必要がある場合のみ使用(例:マーケットプレイスセラーOAuthフロー)。あなたのアプリのMP_ACCESS_TOKENではありません。
  • あなたのアプリのMP_ACCESS_TOKEN → DevPanel → あなたのアプリ → {test_tab}タブから入手。これが.envに入ります。mp-integrateで作成され、create_test_userでは作成されません。

開発者がトランザクションの両側が必要な場合(マーケットプレイス、サブスクリプション、P2Pの典型例)、1つのsellerと1つのbuyerを作成。


Step 3 — 資金をロード(必要な場合)

以下のパラメータでmcp__plugin_mercadopago_mcp__add_money_test_userを呼び出し:

パラメータ 必須
test_user_id yes — create_test_userで返されたid
amount yes — ユーザーの通貨での数値

国別の制限が適用されます。呼び出しが制限エラーで失敗した場合、より小さい金額を要求して1回再試行。


Step 4 — テストカード

カード テストの場合、カード番号を作成しないでください。

  1. まず~/.claude/plugins/cache/claude-plugins-official/mercadopago/{version}/skills/mp-integrate/references/products.mdを読んでください — AR、BR、MX、CO、CLのためのキュレーション済みのバージョンピン留されたテストカード(番号、CVV、有効期限、APRO/OTHE/FUND/…ステータスコードテーブル)があります。これら5つの国では、MCPの呼び出しは不要です。
  2. その国が記載されていない場合のみ(例:PE、UY)、MCP search_documentationにフォールバック:"test cards {country}"(例:"test cards peru")。

Step 5 — 認証情報を開発者に渡す

出力テンプレート:

## テストユーザーが作成されました

**国**: {country}
**プロフィール**: {seller | buyer}
**ユーザーid**: {id}
**初期残高**: {amount} {currency}

### 🔑 ログイン認証情報(チェックアウトでバイヤー/セラーをシミュレートするため)

テスト購入中にMercado Pagoチェックアウトページにログインする際に使用:

- **メール**: {email}
- **パスワード**: {password}

> これらはあなたのMP_ACCESS_TOKENではありません。これらを`.env`に入れないでください。

---

### 📋 あなたのアプリのテスト認証情報(`.env`用)

これらは**DevPanel → あなたのアプリ → {test_tab}タブ**から — テストユーザーからではありません。

MP_ACCESS_TOKEN=APP_USR-... ← あなたのアプリのテストアクセストークン(DevPanelから) MP_PUBLIC_KEY=APP_USR-... ← あなたのアプリのテスト公開鍵(DevPanelから)


> 両方のタイプの認証情報が`APP_USR-`プリフィックスを使用 — 重要なのはそれらが**どこから来るか**です:
> - `.env`: DevPanel → あなたのアプリ → {test_tab}タブから
> - チェックアウトログイン: 上記のテストユーザーのメール+パスワード

### 次のステップ
- テスト購入を行う際、チェックアウト時にテストユーザーの**メール+パスワード**を使用してログイン。
- バックエンドで注文/支払いを作成するために、あなたのアプリの**MP_ACCESS_TOKEN**(DevPanelから)を使用。
- カード支払いの場合、`references/products.md`のテストカードを使用。
- `mp-webhooks`でスモークテスト → 実際のテスト支払いをトリガーしてwebhookを発火。
- テスト支払いに成功した後、`mp-review`を実行。

落とし穴

  • テストユーザー認証情報は本番環境認証情報と同じに見えます。.envファイルが漏洩した場合、バイヤーとセラーの両方の残高が公開されます。
  • テストユーザーのメール/パスワードはmercadopago.com.{tld}での有効なログイン — 開発者はサインインして取引を検査できます。
  • テストユーザーはsite_idで指定された国に属します; アルゼンチンのテスト認証情報をブラジルサイトに対して使用しようとすると、not_found支払いで静かに失敗します。
  • 資金の追加は国別の日次制限があります。制限に達した場合、制限を引き上げるのではなく、新しいテストユーザーを作成してください。

このskillが行わないこと

  • 実際の本番環境認証情報を発行しません。それはデベロッ
原文(English)を表示

mp-test-setup

This skill is the only place test users get created. It exists because the testing model is a frequent source of confusion — there are two distinct types of test credentials with different prefixes.


Pre-check — confirm readiness before creating test users

You are at step 4 of 7 in the integration journey: 1. Create app · 2. Get TEST creds · 3. Scaffold · 4. Create test user ← here · 5. E2E · 6. /mp-review · 7. Prod

Before creating test users, confirm the basics via AskUserQuestion (up to 3 questions — skip any already in .mp-integrate-progress.md):

  1. Account — Skip if already confirmed in .mp-integrate-progress.md. Otherwise: "Do you have a Mercado Pago developer account?" → Yes / No
  2. Credentials — "Do you have your APP_USR- access token?" → Yes / No
  3. Credential type — "Are you using TEST credentials — from the {test_tab}?" → Yes, test credentials / No, production credentials / I don't know
  • No account → point to the dashboard for the country (Chile: https://www.mercadopago.cl/developers — no .com; others https://www.mercadopago.com.{cc}/developers).

  • No credentials → once the MCP is authenticated (Step 0 → State A): (1) call application_list, (2) ask via AskUserQuestion "Which app do you want to use?" listing each app by name, (3) call mcp__plugin_mercadopago_mcp__get_credentials with the chosen application_id, (4) display credentials inline. Never write to file or commit. If MCP is not authenticated, complete Step 0 first.

  • Credential type — No, production credentials OR I don't know → show this BLOCKING WARNING and do NOT create a test user:

    WARNING — Production credentials detected A real card charge may occur if you test against production. Switch to the {test_tab} tab in the Developer Dashboard first. 👉 https://{DOMAIN}/developers/panel/app → Credentials → {test_tab} tab

    Re-show question 3 until the developer confirms "Yes, test credentials". This gate has no Skip option — do not proceed to Step 2 (test user creation) otherwise.

Unlike mp-integrate, this skill's MCP gate stays hard: creating test users requires authenticated MCP calls, so there is no scaffold-only path here.


The current testing model — read first

  • Credential prefixes — two distinct types:
    • APP_USR- → test user credentials from create_test_user, production credentials, Orders API, Checkout Pro, Point, QR
    • TEST- → static test credentials from the {test_tab} tab, Checkout API / Bricks / Payments API Both are valid. get_credentials returns the correct format automatically. Never tell a developer to change their prefix.
  • Test user credentials use the APP_USR- prefix and run against the production API. A test user has its own balance (loaded via this skill) and behaves like a real account.
  • For static test credentials without creating a test user: in the Developer Dashboard, go to your app → Credentials → click the {test_tab} tab.

Step 0 — Verify MCP is actually authenticated

ListMcpResourcesTool is unreliable for this MCP (always returns "No resources found"). The bootstrap tools authenticate / complete_authentication are always present and prove nothing.

Check whether mcp__plugin_mercadopago_mcp__application_list is callable AND returns at least one application. If not, call mcp__plugin_mercadopago_mcp__authenticate immediately and show:

To create test users I need access to your Mercado Pago account. Open this link to connect: Connect Mercado Pago When you see "Authentication Successful" in the browser, come back and say anything.

When the user returns, call application_list directly — do NOT call complete_authentication first. Never ask the user to paste the callback URL.


Step 1 — Resolve site_id before asking

The MCP does not currently return a site_id (its application_list only returns AppID/AppName/AppDescription, and the OAuth access token that would let us call /users/me is not exposed to the plugin client). Resolve in this order:

  1. Use the country the agent already passed as country= — the agent already resolved it (persisted state or wizard).
  2. Read .mp-integrate-progress.md at the project root — if a previous run persisted a country, reuse it.
  3. Last resort: ask via AskUserQuestion (picker, never a numbered text block). Persist the answer to .mp-integrate-progress.md.

Do not grep the repo for currency_id/site_id literals or locale strings — they're unreliable on a clean repo and waste tokens.

Step 2 — Create a test user

Call mcp__plugin_mercadopago_mcp__create_test_user with:

Param Required Values
site_id yes MLA (Argentina), MLB (Brazil), MLM (Mexico), MLC (Chile), MCO (Colombia), MPE (Peru), MLU (Uruguay)
description yes Free text identifying the user (e.g., "buyer for checkout-pro tests")
profile yes seller or buyer — pick the role you need to simulate
amount optional Initial balance in the country's currency

The tool returns the user id, email, password, and APP_USR- credentials.

⚠️ Critical distinction — two types of credentials:

  • Test user email + password → use to log in at the checkout page as the buyer/seller during testing. NOT for your .env.
  • Test user APP_USR- credentials → the test user's own API credentials. Used only if you need to make API calls AS that test user (e.g., marketplace seller OAuth flows). NOT your app's MP_ACCESS_TOKEN.
  • Your app's MP_ACCESS_TOKEN → comes from DevPanel → your app → {test_tab} tab. This is what goes in your .env. Created by mp-integrate, NOT by create_test_user.

If the developer needs both sides of a transaction (typical for marketplace, subscriptions, P2P), create one seller and one buyer.


Step 3 — Load funds (when needed)

Call mcp__plugin_mercadopago_mcp__add_money_test_user with:

Param Required
test_user_id yes — the id returned by create_test_user
amount yes — number in the user's currency

Country-specific limits apply. If the call fails with a limit error, ask for a smaller amount and retry once.


Step 4 — Test cards

For card testing, do not invent card numbers.

  1. First, read ~/.claude/plugins/cache/claude-plugins-official/mercadopago/{version}/skills/mp-integrate/references/products.md — it has curated, version-pinned test cards for AR, BR, MX, CO, CL (numbers, CVV, expiry, and the APRO/OTHE/FUND/… status-code table). For these five countries, no MCP call is needed.
  2. Only if the country is not listed there (e.g. PE, UY), fall back to MCP search_documentation with "test cards {country}" (e.g., "test cards peru").

Step 5 — Hand the credentials to the developer

Output template:

## Test user created

**Country**: {country}
**Profile**: {seller | buyer}
**User id**: {id}
**Initial balance**: {amount} {currency}

### 🔑 Login credentials (to simulate the buyer/seller at checkout)

Use these to **log in at the Mercado Pago checkout page** during a test purchase:

- **Email**: {email}
- **Password**: {password}

> These are NOT your MP_ACCESS_TOKEN. Do NOT put these in your `.env`.

---

### 📋 Your app's test credentials (for your `.env`)

These come from **DevPanel → your app → {test_tab} tab** — NOT from the test user.

MP_ACCESS_TOKEN=APP_USR-... ← your app's test access token (from DevPanel) MP_PUBLIC_KEY=APP_USR-... ← your app's test public key (from DevPanel)


> Both types of credentials use the `APP_USR-` prefix — what matters is WHERE they come from:
> - Your `.env`: from DevPanel → your app → {test_tab} tab
> - Checkout login: the test user's email + password above

### Next steps
- Use the test user **email + password** to log in at the checkout when making a test purchase.
- Use your app's **MP_ACCESS_TOKEN** (from DevPanel) in your backend to create orders/payments.
- For card payments, use the test cards in `references/products.md`.
- Smoke test with `mp-webhooks` → trigger a real test payment to fire the webhook.
- Run `mp-review` after a successful test payment.

Gotchas

  • Test user credentials look identical to production credentials. If a .env file leaks, both buyer and seller balances are exposed.
  • The test user's email/password are valid logins on mercadopago.com.{tld} — the developer can sign in to inspect movements.
  • A test user belongs to the country specified by site_id; trying to use Argentine test credentials against the Brazilian site fails silently with a not_found payment.
  • Adding money has per-country daily limits. If you hit them, create a fresh test user instead of bumping limits.

What this skill does NOT do

  • It does not issue real production credentials. Those come from the Developer Dashboard.
  • It does not validate webhooks (use mp-webhooks) or scaffold integration code (use mp-integrate).

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。