/mastercard-developers:mastercard-best-practicesfrom mastercard-developers
Integration guidance for Mastercard APIs. Covers resolving a service's ID from its name, confirming auth type, routing to authentication guides, finding request/response schemas, sandbox vs production URLs, and interpreting error responses. Use when building, debugging, or reviewing code that calls a Mastercard API.
Ships in mastercard-developers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Mastercard Developers MCP server (@mastercard/developers-mcp, hosted at https://developer.mcp.mastercard.com) is authoritative for which services exist, what an endpoint accepts, and what the integration guides say. Call it rather than answering from memory.
get-documentation also returns the service's api_specification(s) paths, which supply the required argument for both operation tools.
If the MCP server is unavailable, the same facts are public: the service index, the authentication guides, and each service's https://developer.mastercard.com/{serviceId}/documentation/llms-full.txt, which carries auth_type in its frontmatter. These are a fallback, not a substitute.
Service names as marketed differ from the serviceId used to address them. The index maps one to the other and carries the auth type.
get-services-list. Its response contains Products and Services; only Services carry a serviceId, which is what every other tool takes.https://developer.mastercard.com/llms.txt.Both give the same entry per service:
### <Service Name>
serviceId: <service-id>
authType: <auth type>
sourceUrl: https://developer.mastercard.com/<service-id>/documentation/index.md
If more than one service matches the name, list the candidates and ask which one including the description of the service. "The Locations API" matches three distinct services: locations (ATM Locations), locations-intelligence (Locations) and locations-merchants (Location Services).
Never construct a serviceId from the service name. Slugs add suffixes, drop vendor prefixes, abbreviate, differ by singular against plural, or use a different word altogether.
If the service is not in the index, stop and ask. It may be retired, renamed, or not a Mastercard Developers service.
The index is enough to determine the auth type. Do not fetch the service's llms-full.txt to confirm it.
Retrieve the index in full and search the raw text. Do not read it with a tool that summarises. The file is large enough that a summarising fetch returns a plausible service that is not in the file, with the wrong authType, and reports no error. Any method that returns the bytes will do. Ask the developer for the serviceId only once every route has failed.
Mastercard does not use one auth scheme. Confirm the service's authType, then read the guide for that scheme.
Never infer the auth type from the service name, and never default to OAuth1.0a. Services in the same family can carry different auth types, and a service's auth type can change between releases.
authType | Read the guide with | Fallback URL |
|---|---|---|
OAuth1.0a | get-oauth10a-integration-guide | https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis/index.md |
OAuth2, or OAuth1.0a and OAuth2 (FAPI 2.0) | get-oauth20-integration-guide. Where both are listed, ask which the project is provisioned for. | https://developer.mastercard.com/platform/documentation/authentication/using-oauth-2-to-access-mastercard-apis/index.md |
Anything starting OpenBanking | get-openfinance-integration-guide | The service's own documentation for the token exchange |
MTLS | No tool. The URL is the only route. | https://developer.mastercard.com/platform/documentation/authentication/using-mtls-to-access-mastercard-apis/index.md |
Match the value loosely: authType appears in more than one form, including OpenBanking with a trailing parenthetical.
Pass the programming language you are writing. Both guide tools take it and return language-specific package names and signer APIs. Each enumerates the languages it supports, with an explicit fallback value for anything outside that list.
Read the guide rather than recalling it. Package names, signer APIs, key handling and signing steps differ per language and change.
Asked to write code that calls a Mastercard API, work in this order. Each step supplies an input the next one needs.
get-services-list → serviceId and authType. Ask the developer if more than one service matches.get-documentation(serviceId) → the page list and the api_specification(s) paths. Both operation tools take an apiSpecificationPath, not a serviceId, and this is the only source of it. Never assemble that path by hand. If more than one path is returned, list them and ask which one applies. Many services publish several, split by capability, version or region. Some publish more than twenty, where the regional variants differ from one another only by a uk or eu marker in the filename.get-api-operation-list(apiSpecificationPath) → methods, paths, operation IDs and summaries. Skip only if the developer named the exact operation.get-api-operation-details(apiSpecificationPath, method, path) → parameters, request body and response schemas. Call it before writing a request body. Never invent a field name, and never assume one endpoint's shape from another's.get-documentation-page. If it carries no base URL, read the servers block of the API specification from step 2. The request URL is that base plus the operation path. Hosts vary, e.g. ATM Locations is https://sandbox.api.mastercard.com/locations/atms, Identity Insights for Transactions is https://sandbox.idv.mastercard.com/identity.Any auth type:
https://sandbox.api.mastercard.com or https://api.mastercard.com, but not all do. Never assemble a base URL from the host alone, and never point sandbox credentials at production.OAuth 1.0a only. None of this applies to MTLS or OpenBanking, which do not sign requests:
data=body_string, not json=payload, when you signed the string.Read the ReasonCode in the response body before acting on the status alone. One status can carry more than one meaning.
| Response | Applies to | What it means |
|---|---|---|
401 with an auth reason code | Any | The credential was rejected. Work through the checklist for your auth type below. |
401 DECLINED "Unauthorized - Access Not Granted" | Any | The credential is valid. The project is not entitled to that endpoint. Request access rather than changing the auth code. |
403 AUTHENTICATION_FAILED | OAuth 1.0a | Signature verification failed, commonly a consumer key that does not match the keystore. |
400 INVALID_AUTH_HEADER | OAuth 1.0a | Malformed or missing Authorization header. An auth failure, not request validation. |
422 INVALID_CLIENT_CERT | mTLS | The client certificate was missing or rejected. |
400 or 500 from a named backend service | Any | Authentication succeeded. The request cleared the gateway and failed downstream. Read Source: anything other than Gateway means the credential was accepted. Common causes are an ICA not provisioned for the product, or an encryption key not registered for the project (DECRYPT_PRIVATE_KEY_NOT_FOUND, REQUEST_DECRYPT_FAILED). Provisioning is requested separately. |
An entitlement gap and a credential error can arrive on the same status, so check the ReasonCode before changing code that was previously working.
A 400 from Source: Gateway that is not INVALID_AUTH_HEADER is request validation. Re-read the operation's schema with get-api-operation-details rather than changing the signing code.
In order:
The client certificate is presented on the TLS connection, so a missing or rejected certificate can be refused during the handshake and surface as a connection or SSL error rather than a response. When there is no status to read, confirm the certificate and key are being loaded and presented on the connection before looking anywhere else.
The token exchange and the request that follows are authenticated separately. A successful token response does not mean the request that follows was accepted. Check the status of each.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mastercard/developers-agent-toolkit --plugin mastercard-developersOther plugins' skills for the same job