Pokémon TCG API

com.pokemontcgapi由 pokemontcgapi.com 发布v0.1.10更新于 Oct 30, 2026

English, Japanese and Chinese Pokémon cards: search, sets, illustrators, prices, photo lookup.

概览

AI 生成的概览

检索宝可梦集换式卡牌目录(欧美、日文、中文版本)的卡牌、系列、画师、密封商品与价格,并支持照片识别和居中测量。

可以做什么
  • 按名称、系列、印刷地区、稀有度、画师或发售时间搜索卡牌,并按 id 批量获取
  • 列出系列、画师以及类型与稀有度的准确字符串,并报告目录的实时覆盖情况
  • 读取卡牌与密封商品的当前价格观察,含来源、印刷版本、评级与日期
  • 从照片识别卡牌,并从图像测量居中比例
  • 计算仅基于居中的评级上限,并读取 PSA/BGS/CGC/SGC 的居中标准
适用场景
适合让助手回答关于宝可梦卡牌印刷版本、系列、画师、市场价格或密封商品供应的问题,覆盖英文、日文与简体中文产品线;也适合辅助卡牌照片识别与居中检查。
运行要求
通过 npx 在本机运行的 stdio 进程,需要 Node 20 或更高版本。十三个工具中有十二个需要 PTCG_API_KEY,可向服务商的注册接口申请免费密钥。PTCG_BASE_URL 可覆盖 API 基础地址。需要能访问服务商 API 的网络。
安装前请注意
工具会消耗额度:图像识别与居中测量每次 25 额度,密封商品价格 3 额度,其他调用 1 额度起;免费试用有限,付费方案每月 29 欧元起。API 密钥为机密,通过 PTCG_API_KEY 传入。卡牌照片会发送到识别与居中工具,离开本机。价格至少延迟一天,且部分数据会因方案被隐藏,缺少数据可能源于方案而非目录本身。非官方产品,与 The Pokémon Company 无关联。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Pokémon TCG API,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@pokemontcgapi/mcp

[npm] [license] [Glama]

An MCP server for the Pokémon TCG API at pokemontcgapi.com. It gives an agent thirteen tools over the whole catalogue: international, Japanese and Simplified Chinese print lines, card names in eight locales, illustrators, images, and prices that carry their source, basis, grade and sample size. The current counts are live at /v1/status and broken down on coverage.json.

Unofficial. Not produced, endorsed, supported by or affiliated with Nintendo, Creatures Inc., GAME FREAK inc. or The Pokémon Company International. Pokémon and all related marks are trademarks of their respective owners.

Get a key

Generate the Idempotency-Key once per signup and keep it with the request body:

bash
IDEM=$(uuidgen)
bash
curl -s -X POST "https://api.pokemontcgapi.com/v1/accounts/free" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: $IDEM" \  -d '{"email":"[email protected]"}'

Lost the response? Repeat the exact same request (same Idempotency-Key, same body byte for byte, same network: same public IPv4 or the same IPv6 /64) within 24 hours and the response comes back, if stored, secret included; it is the original response, so a key rotated or revoked since then is not revived. A new Idempotency-Key for the same email returns 409 ACCOUNT_EXISTS; the same key with a different body returns 409 IDEMPOTENCY_CONFLICT.

We store only a hash of the key; the signup response is kept for 24 hours so the same request can be replayed. Save data.key.secret now.

If replay is unavailable, sign in and rotate the key, or use /v1/accounts/recover with an already verified email to get a new secret.

The key comes back in data.key.secret. Confirming the address we email raises the trial from 80 to 800 credits, and the trial ends 30 days after signup. Paid plans start at 29 EUR a month: pricing.

Install

Claude Code:

bash
claude mcp add pokemontcgapi --env PTCG_API_KEY=your-key -- npx -y @pokemontcgapi/mcp

Claude Desktop — claude_desktop_config.json:

json
{  "mcpServers": {    "pokemontcgapi": {      "command": "npx",      "args": ["-y", "@pokemontcgapi/mcp"],      "env": { "PTCG_API_KEY": "your-key" }    }  }}

Cursor — .cursor/mcp.json:

json
{  "mcpServers": {    "pokemontcgapi": {      "command": "npx",      "args": ["-y", "@pokemontcgapi/mcp"],      "env": { "PTCG_API_KEY": "${env:PTCG_API_KEY}" }    }  }}

VS Code — .vscode/mcp.json. Note the top-level key is servers, not mcpServers, and inputs keeps the key out of the committed file:

json
{  "inputs": [    { "id": "ptcg-key", "type": "promptString", "description": "pokemontcgapi key", "password": true }  ],  "servers": {    "pokemontcgapi": {      "command": "npx",      "args": ["-y", "@pokemontcgapi/mcp"],      "env": { "PTCG_API_KEY": "${input:ptcg-key}" }    }  }}

Environment: PTCG_API_KEY, needed by twelve of the thirteen tools, and PTCG_BASE_URL (defaults to https://api.pokemontcgapi.com). Node ≥ 20. The exception is ptcg_get_reference, which reads a public route. ptcg_get_catalogue_status is not an exception: it starts on the public /v1/status and then reads one set per print region, which needs the key. Without it the server starts and lists its tools, then those twelve calls come back asking for it.

The tools

Thirteen tools, not one per endpoint. tools/list sits in the model's context on every turn, so the whole surface is about 13 KB, and each tool is shaped like a question rather than like a route — the model does not have to chain four calls to answer one thing.

ToolAnswers
ptcg_search_cards"Charizard cards from Japanese sets", by name, set, region, rarity, artist or release window
ptcg_get_cardsUp to 100 ids in one call; base1-4 and bs-4 both resolve
ptcg_get_card_pricesEvery current observation for a card, with printing, grade, as_of and sample_n
ptcg_list_sets"Every Japanese set released in 2024"
ptcg_get_referenceThe exact strings for types, supertypes and rarities, so filters are not guessed
ptcg_list_artistsIllustrators and how many cards each drew
ptcg_get_catalogue_statusWhat the catalogue does and does not contain, measured live
ptcg_search_sealedBooster boxes, packs, ETBs, tins, blisters and collections by name, set, kind or language, with the languages each exists in and its euro index. 1 credit per 50 rows
ptcg_get_sealed_pricesEvery current observation for one sealed product, with the language the box is printed in and its as_of. 3 credits
ptcg_measure_centeringPhoto of one face to ratios, uncertainty and geometry. 25 credits; needs-review without ceilings is expected
ptcg_grade_centeringCentering-only ceilings from known face/axis ratios. 1 credit
ptcg_get_centering_standardsPSA/BGS/CGC/SGC thresholds, source status and URLs. 1 credit
ptcg_identify_card_from_image"Which card is this a photo of?" — ranked candidates, and an explicit refusal when reprints share the artwork. 25 credits a call, and included from the Growth plan up

Every tool is annotated readOnlyHint: true and destructiveHint: false. Nothing here writes. ptcg_identify_card_from_image and the three centering tools are marked idempotentHint: false: each invocation consumes credits. Do not retry paid work automatically.

Centering is included on Growth and higher; Developer is excluded. A verified Free trial includes 5 measure and 5 confirm calls, independently. Grade and standards have no separate trial call counter. Measure accepts base64 image bytes, explicit front/back face, optional standard/small card_size and corrected corners (TL, TR, BR, BL in EXIF-oriented pixels reduced to longest edge <=2560 px). It returns ratios, uncertainty and editable geometry; needs-review with null ceilings is expected. After correcting corners with another measure, a person checks or moves cut and print lines in the app. Grade ceilings arrive after that app calls confirm, or from known ratios through grade.

There is deliberately no confirm tool. An assistant cannot assert that a person reviewed the lines. Only the app collecting that person's explicit acceptance may send confirmed_by: person. Always display ceiling from centering alone, not a prediction of the final grade. Never label a result verified or certified. Keep source status, incomplete flags and uncertainty visible. See the two-step guide.

Commercial refusals put next_step.handoff on the first line of the tool result, followed by the API message and complete details. Show that sentence and its URL to the account owner verbatim and do not retry. The owner completes checkout, email verification or the contact step. CARD_ALLOWANCE_EXCEEDED is one of them: the period has retrieved its distinct-card allowance (1,000 for the trial, 30,000 a month on Developer); cards already retrieved keep answering, new ones need the next period or Growth.

Importing a card catalogue

For a complete card import, use the REST API directly: GET /v1/cards?limit=250&orderBy=id, then follow links.next verbatim. The flat list fills pages across set boundaries and uses fewer requests than a separate card loop for every set. Add include=translations for names at the plain catalogue cost. Priced includes have separate tariffs. For a single print region, add q=set.region:JP or q=set.region:CN; lang only selects a name translation. Use /v1/sets/{code}/cards when you need a particular set and /v1/sets?region=JP to browse set metadata.

The quickstart contains both paging loops and dated measurements. The migration guide explains how to capture a change feed watermark before importing and maintain the replica afterwards. The MCP search tool is intended for bounded interactive searches; its region argument is sent to the API as set.region:JP (or CN, WEST), so a Japanese search reads Japanese rows only. Use REST for a complete import.

What this API does not have

The last tool exists because of this section, and it returns these facts from a live call rather than leaving a model to infer them:

  • No Korean cards. Zero KR sets and zero ko translations. The print region and the locale are modelled in the schema and carry no data, so filtering on them returns an empty result, not an error.
  • Card game text is English, and uneven. attacks, abilities, weaknesses, resistances, subtypes, retreat_cost, rules and flavor_text carry rows since 3 September 2026, on the 20,725 Western printings. Measured on 16 September 2026 against 57,450 cards: attacks on 29.9% of the whole catalogue and 82.9% of the Western part, subtypes 35.0%, weaknesses 28.0%, flavor_text 17.9%, abilities 7.0%, rules 5.1%. Japanese and Chinese printings carry none, so a null attacks means we do not hold it, never that the card has no attack.
  • No format legalities. The card object carries no legalities field, and level is empty. If the question is about deck legality, this API cannot answer it.

All three are measured, dated in the source, and repeated verbatim in the tool descriptions, so an agent is told before it calls rather than after.

Reading prices correctly

There is no printing filter. First Edition, Unlimited, holofoil, reverse holofoil and graded rows all come back together, so read printing, condition and grading on each row rather than taking the first number. basis separates GUIDE (published upstream) from DERIVED (computed by us); PTCG_INDEX is our own composite in EUR and carries sample_n. Every observation has an as_of date and is delayed by at least a day — never quote a price without it.

What the plan withholds is named rather than hidden: graded and non_english_locales for a trial key, graded on Developer, nothing from Growth up. The API says so in meta.withheld on the prices route, in the X-Plan-Withheld header when prices ride on a card, and in a top-level withheld field on the batch. So a card with no graded rows may be the plan speaking, not the catalogue.

For ptcg_get_cards, the API's missing field is authoritative when present, including its suggested_id values. The tool keeps its existing missing array of strings and adds missing_details, an array of { id, suggested_id? }; the text also shows each suggestion. If the API omits missing, the tool falls back to comparing requested ids with returned id and legacy_id, ignoring case and repeated ids. This supports older API versions without another request, but cannot discover their unreported canonical-set collisions or suggestions. The current API omits missing when every id resolves, so that fallback then returns an empty array. ptcg_get_card_prices reads a card with its prices, so the exclusions arrive in that header.

Sealed products

/v1/sealed carries booster boxes, booster packs, elite trainer boxes, tins, blisters and collections across the international, Japanese and Simplified Chinese lines. Each product carries languages, the languages it physically exists in; the Simplified Chinese line, 273 products added on 30 October 2026 in the cn- sets, carries ["zh"]. The API has no language filter on that list, so ptcg_search_sealed with language scans pages of 100 at 2 credits each, keeps the rows whose languages contain it, and says when it stopped before the end of the catalogue. Without language it is one page, 1 credit per 50 rows, cursor included.

ptcg_get_sealed_prices reads the product (1 credit) and then its quotes (2 credits). Sealed rows carry no condition, printing or grading; locale is the language the box is printed in, and the Chinese line carries Cardmarket LOW and TREND under zh. index is the catalogue price of the product in euro with its date, the same index_eur as on the product row, with sample_n null and by_locale empty, because the composite is computed for cards only. Rows under a locale other than en follow the plan rules of the cards, and the tool names them in the same withheld line.

Context discipline

Results are capped at 50 rows regardless of what the API allows, sent as aligned tables rather than JSON, with a compact field projection. A table is shorter than the same rows as JSON because the keys are not repeated on every row; we do not publish a percentage, because we have no reproducible measurement to show next to it. Truncation is always announced along with the cursor to continue. Price rows are the one thing never truncated.

Protocol

Built on @modelcontextprotocol/server v2, which negotiates the 2025-11-25 revision and accepts clients down to 2024-10-07. stdio transport.

The revision is the library's, not a claim of our own: SUPPORTED_PROTOCOL_VERSIONS in @modelcontextprotocol/[email protected] tops out at 2025-11-25, so a client that asks for anything newer is answered with that. Verified against the published package, not read off a changelog.

Also available

Build from source

bash
npm cinpm run typechecknpm run build

Node >= 20. npm test runs the unit tests in tests/. What CI enforces is that the package typechecks and builds on both Node 20 and Node 22, and that npm pack produces the file list the registry is meant to receive.

This package is developed inside the private monorepo that runs pokemontcgapi.com and mirrored here on each release, so a merged pull request travels back by hand rather than by merge button. That is not a reason to send patches elsewhere — open the issue or the PR here, it is the address that gets read.

Licence

MIT. Data served by the API carries per-source redistribution terms — see https://pokemontcgapi.com/legal/attribution.

来源:README.md,提交 cc6b16a

工具

13

ptcg_search_cards

Search Pokémon cards

Search the Pokémon TCG card catalogue by name, set, print region, rarity, artist or release window. Returns one row per printing with its set, rarity, illustrator and euro price index. Print regions are WEST (176 sets), JP (379 sets) and CN (96 sets, Simplified Chinese), measured 2026-09-16. Japanese sets are not translations of Western ones: they have their own boundaries, their own numbering and their own release dates, so a Japanese set and its international counterpart are two different rows. Card names exist in eight locales, and they are far from equally filled. Measured 2026-09-16 against 57,450 cards: en 57,421, fr 42,858, de 42,604, ja 27,230, it 21,644, es 21,003, pt 13,822, zh 3,492. Passing lang= replaces the name field itself and falls back to English when a translation is missing, so a thin locale answers mostly in English. Set names are not translated. Card game text is present since 2026-09-03, in English, and unevenly. Measured 2026-09-16: attacks on 29.9% of the catalogue, subtypes on 35.0%, weaknesses on 28.0%, flavor_text on 17.9%, abilities on 7.0%, rules on 5.1%. It sits on the 20,725 Western printings, so read against those alone attacks is on 82.9% of them, while Japanese and Chinese printings carry none. Check the field on the card in hand rather than assuming: a null attacks means we do not hold it, never that the card has no attack. Still empty for every card: level, and legalities — deck legality is a question this API cannot answer, so say so rather than inferring it. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数qsetlangnamelimitartistcursorrarityregionorder_byreleased_toreleased_from

ptcg_get_cards

Get Pokémon cards by id

Fetch one or many cards by id, in a single call. Ids join set code and collector number, e.g. "bs-4"; the historical alias "base1-4" resolves on the same route. A complete native id wins over a legacy alias; otherwise the legacy resolves even with a JP set prefix. Unresolved ids are listed in missing, with existing candidates in missing_details when the API provides them. Card game text is present since 2026-09-03, in English, and unevenly. Measured 2026-09-16: attacks on 29.9% of the catalogue, subtypes on 35.0%, weaknesses on 28.0%, flavor_text on 17.9%, abilities on 7.0%, rules on 5.1%. It sits on the 20,725 Western printings, so read against those alone attacks is on 82.9% of them, while Japanese and Chinese printings carry none. Check the field on the card in hand rather than assuming: a null attacks means we do not hold it, never that the card has no attack. Still empty for every card: level, and legalities — deck legality is a question this API cannot answer, so say so rather than inferring it. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数ids必填langinclude_prices

ptcg_get_card_prices

Get prices for a Pokémon card

Every current price observation for one card, each with its source, basis, printing, grade, sample size and the day it is for. There is no printing filter: 1st Edition, Unlimited, holofoil, reverse holofoil and graded rows all come back together, so you must read printing, condition and grading on each row rather than taking the first price. basis distinguishes GUIDE (a figure published upstream) from DERIVED (computed by us). PTCG_INDEX is our own composite in EUR and carries sample_n. Every observation carries as_of and is delayed by at least a day — never quote a price without its as_of date and its source. Each row also carries its locale, and a card read with include=prices returns every locale the plan allows: the currency is not the language, so never compare a French row with an English one without saying so. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数id必填currency

ptcg_list_sets

List Pokémon TCG sets

Every set with its code, series, print region, release date and, where we hold it, printed total: no Japanese set has one. One call answers questions like "every Japanese set released in 2024". Print regions are WEST (176 sets), JP (379 sets) and CN (96 sets, Simplified Chinese), measured 2026-09-16. Japanese sets are not translations of Western ones: they have their own boundaries, their own numbering and their own release dates, so a Japanese set and its international counterpart are two different rows. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数namelimitcursorregionseriesorder_byreleased_toreleased_from

ptcg_get_reference

List the closed vocabularies

The exact strings the catalogue uses for types, supertypes, subtypes and rarities. Call this before filtering on a rarity or a type rather than guessing the wording — "Rare Rainbow" and "Rainbow Rare" are not the same string, and only one of them matches. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数vocabulary必填

ptcg_list_artists

List card illustrators

Illustrators with the number of cards each has drawn, deduplicated across 30 years of printings. Use the returned name with the artist argument of ptcg_search_cards to get their cards. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数namelimitcursor

ptcg_get_catalogue_status

What this catalogue actually covers

Live counts and coverage for the catalogue: sets per print region, card total, which locales carry card names, and which data is explicitly NOT present. Call this before telling a user what the API can and cannot answer. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

无需输入参数。

ptcg_search_sealed

Search sealed products

Booster boxes, booster packs, elite trainer boxes, tins, blisters and collections, by name, set, kind or language, each with its set, release date, the languages it physically exists in and its euro index. Covers the international, Japanese and Simplified Chinese lines: the Chinese line carries languages ["zh"]. 1 credit per 50 rows; a language filter scans pages of 100 (2 credits each) and keeps the matching rows. Quotes are a separate call, ptcg_get_sealed_prices, with the id returned here. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数setkindlangnamelimitcursorlanguageorder_by

ptcg_get_sealed_prices

Get prices for a sealed product

Every current price observation for one sealed product, by the id ptcg_search_sealed returns (its sku), each with its source, basis, the language the box is printed in and the day it is for, plus the product index in euro. 3 credits: one for the product, two for the quotes. Sealed products (booster boxes, booster packs, elite trainer boxes, tins, blisters, collections) cover the international, Japanese and Simplified Chinese lines: languages on each product lists the languages it physically exists in, and the Simplified Chinese line (273 products on 2026-10-30, in the cn- sets) carries ["zh"]. The list has no language filter. Sealed quotes have no condition, printing or grading; their locale is the language the box is printed in, Cardmarket LOW and TREND under zh for the Chinese line, delayed by at least a day like every row, and rows under a locale other than en follow the plan rules of the cards. Never quote a price without its as_of date and its source. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数id必填currency

ptcg_identify_card_from_image

Identify a card from a photo

Recognise a Pokemon card from a photograph and return ranked candidates. Use this instead of guessing from what you see in an image: reprints share their artwork, so visual identification alone cannot name a printing, and this tool says so when it cannot. Costs 25 credits per call against 1 for a lookup — do not call it in a loop. Pass `set` or `region` when the user has told you either. Included from the Growth plan up: on a trial or Developer key it answers PLAN_REQUIRED without spending credits, and retrying will not change that. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数settop_kregionincludeimage_base64必填

ptcg_measure_centering

Measure card centering from a photo

Measure ratios, uncertainty and editable geometry from one face. Costs 25 credits; do not call in a loop. needs-review without grade ceilings is expected. If corners are wrong, ask the person to correct them and measure again. Grade ceilings follow a person checking or moving the lines in the app (confirm is deliberately not an MCP tool), or known ratios via ptcg_grade_centering. Never claim an assistant checked the lines on behalf of a person. Growth and higher; Developer excluded. Verified Free trial: 5 measure and 5 confirm calls independently; grade and standards have no separate trial call counter. Always display: ceiling from centering alone, not a prediction of the final grade. Never call results verified or certified. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数face必填cornerscard_sizeimage_base64必填

ptcg_grade_centering

Grade known centering ratios

Calculate centering-only maximum grades from ratios already known. Costs 1 credit. Supply at least one face/axis ratio; never guess missing faces or axes. Read incomplete, missing_faces and missing_axes; missing measurements can lower the ceiling. Numeric 1 is ambiguous; use 55, 0.55, 55/45 or [55,45]. Do not mix nested and corresponding flat fields. Growth and higher; Developer excluded. Verified Free trial: 5 measure and 5 confirm calls independently; grade and standards have no separate trial call counter. Always display: ceiling from centering alone, not a prediction of the final grade. Never call results verified or certified. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数backfronthouseback_lrback_tbfront_lrfront_tb

ptcg_get_centering_standards

Read centering standards

Read PSA/BGS/CGC/SGC centering thresholds and sources. Costs 1 credit. Preserve official/interpreted/approximate source status and rounding rules; SGC has no published back table. Source review dates describe provenance, not result certification. Growth and higher; Developer excluded. Verified Free trial: 5 measure and 5 confirm calls independently; grade and standards have no separate trial call counter. Always display: ceiling from centering alone, not a prediction of the final grade. Never call results verified or certified. If the result carries next_step, show its handoff sentence and URL to the user verbatim and do not retry.

输入参数facehouse

版本历史

5
  1. v0.1.10最新Oct 30, 2026
  2. v0.1.9Oct 29, 2026
  3. v0.1.8Sep 25, 2026
  4. v0.1.7Sep 21, 2026
  5. v0.1.5Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分