### Install dependencies with uv Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Set up the Python environment and install required packages using uv. ```bash uv venv .venv uv pip install --python .venv/bin/python "mcp[cli]" pillow uvicorn starlette "x402[evm,httpx]==2.25.0" ``` -------------------------------- ### Run the server Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Start the server with required environment variables. Ensure WALLET_MCP_PUBLIC_HOST matches the hostname used to reach the server to avoid 421 errors from the MCP SDK's DNS-rebinding protection. ```bash PORT=8400 WALLET_MCP_PUBLIC_URL=https://your-domain/wallet-mcp \ WALLET_MCP_PUBLIC_HOST=your-domain \ .venv/bin/python server.py ``` -------------------------------- ### Add wallet-mcp to Codex Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Use the codex CLI to register the wallet-mcp server. ```sh codex mcp add walletmcppass --url https://walletmcppass.com/mcp ``` -------------------------------- ### create_wallet_pass Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Creates a new Apple Wallet pass file with specified style, fields, and customization options. Returns a download URL valid for one hour. ```APIDOC ## create_wallet_pass ### Description Creates a new Apple Wallet pass file with the specified style, fields, and customization options. The pass can be downloaded and added to Apple Wallet or Google Wallet. ### Parameters #### Required Parameters - **organization_name** (string) - Required - The name of the organization issuing the pass. - **description** (string) - Required - A description of the pass. #### Optional Parameters - **style** (string) - Optional - The pass style: "boardingPass", "eventTicket", "coupon", "generic", or "storeCard". - **logo_text** (string) - Optional - Text to display as the logo. - **transit_type** (string) - Optional - Transit type for boarding passes (default "Air"). - **barcode_message** (string) - Optional - Message encoded in the barcode. Omit for no barcode. - **barcode_format** (string or array) - Optional - Barcode format(s): "QR" (default), "PDF417", "Aztec", "Code128", or iOS 27+ formats like "Code39", "Codabar", "EAN13", "ITF". Can be an ordered list; the first supported format is used. - **barcode_alt_text** (string) - Optional - Human-readable text under the barcode. - **background_color** (string) - Optional - Hex or RGB color for the background, e.g. "#1a1a19" or "rgb(26, 26, 25)". - **foreground_color** (string) - Optional - Hex or RGB color for the foreground. - **label_color** (string) - Optional - Hex or RGB color for labels. - **relevant_date** (string) - Optional - ISO 8601 date when the pass becomes relevant. - **expiration_date** (string) - Optional - ISO 8601 date when the pass expires. - **locations** (array) - Optional - Up to 10 locations, each with latitude, longitude, optional altitude, and optional relevantText. Shows on lock screen when nearby. - **max_distance** (number) - Optional - Maximum distance in meters for location relevance; can only shrink the default radius. - **voided** (boolean) - Optional - If true, stamps the pass as VOID. - **primary_fields** (array) - Optional - List of primary fields, each with optional key, label, and value. - **secondary_fields** (array) - Optional - List of secondary fields. - **auxiliary_fields** (array) - Optional - List of auxiliary fields. - **header_fields** (array) - Optional - List of header fields. - **back_fields** (array) - Optional - List of back fields. - **serial_number** (string) - Optional - Serial number; auto-generated UUID if omitted. - **icon_color** (string) - Optional - Color for the auto-generated icon. - **icon_text** (string) - Optional - Text for the auto-generated icon. - **logo_color** (string) - Optional - Color for the auto-generated logo. - **icon_png_b64** (string) - Optional - Base64-encoded PNG for a custom icon. - **logo_png_b64** (string) - Optional - Base64-encoded PNG for a custom logo. - **generate_logo** (boolean) - Optional - If false, no logo image is generated (e.g., when logo_text alone is enough). - **poster** (boolean) - Optional - iOS 27+ Poster Generic layout; style must be generic, storeCard, or coupon. - **footer_fields** (array) - Optional - Up to 2 footer fields, poster only. - **background_png_b64** (string) - Optional - Poster background image (1035x1515 px); gradient auto-generated if omitted. - **featured_actions** (array) - Optional - Up to 2 featured actions, each with type and url, e.g. {"type": "membershipBenefits", "url": "https://..."}. - **semantics** (object) - Optional - Apple SemanticTags dict, emitted as given; unknown keys and bad types rejected. - **semantic_layout** (string) - Optional - Semantic layout: boardingPass (airline, iOS 26+) -> semanticBoardingPass; eventTicket -> posterEventTicket. Required tags are checked; classic style remains as fallback. - **info_links** (object) - Optional - Top-level event-guide / airline-page links: bagPolicyURL, changeSeatURL, etc. - **primary_logo_png_b64** (string) - Optional - Base64-encoded PNG for primary logo. - **secondary_logo_png_b64** (string) - Optional - Base64-encoded PNG for secondary logo. - **strip_png_b64** (string) - Optional - Base64-encoded PNG for strip image. - **thumbnail_png_b64** (string) - Optional - Base64-encoded PNG for thumbnail. - **artwork_png_b64** (string) - Optional - Base64-encoded PNG for artwork. ### Response #### Success Response - **download_url** (string) - URL to download the pass file. Valid for one hour. - **expires_in_seconds** (number) - Time in seconds until the download URL expires. - **serial_number** (string) - The serial number of the created pass. - **pass_type_identifier** (string) - The pass type identifier. #### Response Example { "download_url": "https://example.com/pass.pkpass", "expires_in_seconds": 3600, "serial_number": "uuid", "pass_type_identifier": "pass.com.example" } ``` -------------------------------- ### Create a pass with curl: POST /api/passes Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Use this curl command to create a new Apple Wallet pass. The JSON body must match the tool's parameters exactly; unknown keys are rejected. The response includes download_url, expires_in_seconds, serial_number, and pass_type_identifier. Status codes: 200 success, 400 invalid request, 402 payment required past free limit, 429 rate limit exceeded, 500 internal error. ```shell curl https://walletmcppass.com/api/passes \ -H 'Content-Type: application/json' \ -d '{"style": "generic", "organization_name": "Harbor Climbing Gym", "description": "Day pass", "primary_fields": [{"label": "Guest", "value": "Ada L."}], "barcode_message": "DAY-0042"}' ``` -------------------------------- ### Add wallet-mcp to Claude Code Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Use the claude CLI to add the wallet-mcp server using the HTTP transport. ```sh claude mcp add --transport http walletmcppass https://walletmcppass.com/mcp ``` -------------------------------- ### POST /api/passes Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Creates a new wallet pass. The request body must match the tool's parameters exactly, and unknown keys are rejected. ```APIDOC ## POST /api/passes ### Description Creates a new wallet pass. The request body must match the tool's parameters exactly, and unknown keys are rejected. ### Method POST ### Endpoint /api/passes ### Parameters #### Request Body - **style** (string) - Required - The pass style (e.g., "generic"). - **organization_name** (string) - Required - The organization name. - **description** (string) - Required - A description of the pass. - **primary_fields** (array) - Required - A list of primary fields, each with a label and value. - **barcode_message** (string) - Optional - The barcode message. ### Request Example ```sh curl https://walletmcppass.com/api/passes \ -H 'Content-Type: application/json' \ -d '{"style": "generic", "organization_name": "Harbor Climbing Gym", "description": "Day pass", "primary_fields": [{"label": "Guest", "value": "Ada L."}], "barcode_message": "DAY-0042"}' ``` ### Response #### Success Response (200) - **download_url** (string) - URL to download the pass. - **expires_in_seconds** (integer) - Expiration time in seconds. - **serial_number** (string) - The pass serial number. - **pass_type_identifier** (string) - The pass type identifier. #### Response Example ```json { "download_url": "...", "expires_in_seconds": 3600, "serial_number": "...", "pass_type_identifier": "..." } ``` #### Error Responses - **400** - `{"error": "invalid request", "details": [...]}` for malformed body or wrong types; `{"error": "..."}` when the pass itself is invalid. - **402** - Past a free limit (per-IP or global): an x402 `PaymentRequired` body (also base64'd in the `PAYMENT-REQUIRED` header). Retry with a payment. - **429** - `{"error": "rate limit exceeded: ..."}` or `"service is at its daily request limit ..."` — only when payments are off. - **500** - `{"error": "internal error building the pass"}`. ``` -------------------------------- ### Use wallet-mcp with OpenAI Responses API Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Configure the OpenAI client to use the wallet-mcp tool for generating passes. ```python from openai import OpenAI client = OpenAI() response = client.responses.create( model="gpt-6-astra", tools=[{ "type": "mcp", "server_label": "walletmcppass", "server_description": "Creates signed Apple Wallet passes.", "server_url": "https://walletmcppass.com/mcp", "require_approval": "never", }], input="Make an Apple Wallet coupon for 20% off at Harbor Café, valid until 31 December, with the QR code CAFE20.", ) print(response.output_text) ``` -------------------------------- ### Configure Nginx reverse proxy Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Required Nginx configuration for the Streamable HTTP transport. Buffering must be disabled to prevent SSE stream stalls. ```nginx proxy_http_version 1.1; proxy_set_header Connection ""; proxy_buffering off; proxy_read_timeout 3600s; ``` -------------------------------- ### Update a pass with curl: PATCH /api/passes/{serial} Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Use this curl command to update an existing updatable pass. Requires the serial number and an edit token (bearer token). The body can include any create parameters; given parameters replace stored ones whole, omitted ones are kept. The server re-signs the pass and sends an APNs push. Status codes: 200, 400, 401, 402, 404, 429. ```shell curl -X PATCH https://walletmcppass.com/api/passes/$SERIAL \ -H "Authorization: Bearer $EDIT_TOKEN" -H 'Content-Type: application/json' \ -d '{"primary_fields": [{"key": "points", "label": "Points", "value": "150", "changeMessage": "You now have %@ points"}]}' ``` -------------------------------- ### PATCH /api/passes/{serial} Source: https://github.com/arshwaraich/wallet-mcp/blob/master/README.md Updates an existing updatable pass. Requires the serial number and an edit token, and accepts any of the create parameters. The server re-signs the pass and sends an APNs push to registered devices. ```APIDOC ## PATCH /api/passes/{serial} ### Description Updates an existing updatable pass. Requires the serial number and an edit token, and accepts any of the create parameters. The server re-signs the pass and sends an APNs push to registered devices. ### Method PATCH ### Endpoint /api/passes/{serial} ### Parameters #### Path Parameters - **serial** (string) - Required - The serial number of the pass to update. #### Request Body - **serial_number** (string) - Required - The serial number of the pass. - **edit_token** (string) - Required - The edit token for the pass. - **primary_fields** (array) - Optional - A list of primary fields, each with a key, label, value, and optional changeMessage. - **voided** (boolean) - Optional - Set to true to cancel the pass. - Other create parameters may be included. ### Request Example ```sh curl -X PATCH https://walletmcppass.com/api/passes/$SERIAL \ -H "Authorization: Bearer $EDIT_TOKEN" -H 'Content-Type: application/json' \ -d '{"primary_fields": [{"key": "points", "label": "Points", "value": "150", "changeMessage": "You now have %@ points"}]}' ``` ### Response #### Success Response (200) - **download_url** (string) - URL to download the pass. - **expires_in_seconds** (integer) - Expiration time in seconds. - **serial_number** (string) - The pass serial number. - **pass_type_identifier** (string) - The pass type identifier. - **notified_devices** (integer) - Number of devices that accepted the APNs push. - **updatable_until** (string) - Timestamp until which the pass can be updated. #### Response Example ```json { "download_url": "...", "expires_in_seconds": 3600, "serial_number": "...", "pass_type_identifier": "...", "notified_devices": 1, "updatable_until": "..." } ``` #### Error Responses - **400** - Invalid request body. - **401** - No bearer token provided. - **402** - Payment required (past free limit). - **404** - Unknown serial, wrong token, or update window over (deliberately the same). - **429** - Rate limit exceeded. ```