# Malaysia Invoice MCP > A remote MCP server that lets any AI agent submit, query and cancel Malaysia e-invoices through LHDN MyInvois (Lembaga Hasil Dalam Negeri / IRBM), the national e-invoicing gateway. It wraps the submission calls only: XAdES signing of the UBL 2.1 document stays merchant-side. Stateless, bring-your-own ERP OAuth2 credentials, never stores anything. - MCP endpoint (Streamable HTTP): https://inv-my.wishpool.app/mcp - Credentials headers: x-myinvois-client-id + x-myinvois-client-secret (your ERP OAuth2 credentials from the MyTax "Register ERP" self-service at mytax.hasil.gov.my; preprod at preprod-mytax.hasil.gov.my). Used to mint an OAuth2 access_token (client_credentials, scope InvoicingAPI). Your certificate and private key never leave your side. - Mode header: x-myinvois-mode: prod submits to production (real fiscal effect); sandbox (default) = preprod environment (no fiscal effect). - Design: this server ONLY forwards MyInvois submit/query/cancel calls. You build + XAdES-sign the UBL 2.1 document, compute its SHA-256 documentHash, and pass { format, document(base64 signed), documentHash, codeNumber }. We never sign and never store anything — signing stays merchant-side. Stateless token strategy: a fresh access_token is minted per request (not cached), so each business call is 2 HTTP requests (token + endpoint). - Endpoints wrapped: {preprod-api|api}.myinvois.hasil.gov.my/connect/token (OAuth2), POST /api/v1.0/documentsubmissions (submit), GET /api/v1.0/documentsubmissions/{submissionUid} (query), PUT /api/v1.0/documents/state/{uuid}/state (cancel, 72h window). ## Tools - submit_invoice: Submit an already-signed UBL 2.1 e-invoice to MyInvois — { document(base64), documentHash(sha256 hex), codeNumber, format? (JSON default | XML) } in, submission_uid + accepted_documents (each with uuid) + rejected_documents out. Async: accepted only means queued for validation. Signing stays merchant-side. - query_submission: Poll a submission's validation status — { submissionUid } in, overall_status (in progress | valid | partially valid | invalid) + document_summary out. - cancel_invoice: Cancel a valid document within 72 hours — { uuid (from query_submission, NOT submissionUid), reason (max 300 chars) } in, status Cancelled out. - build_invoice_draft: Local helper (no network, no credentials): compute Malaysian SST totals from line items and emit an unsigned UBL 2.1 skeleton — { lines:[{description,quantity,unitPrice,taxRate?}], codeNumber, currency? (MYR), issueDate? } in, totals + ubl_json out. No fiscal effect; applies the taxRate you give (SST classification is your decision). - Owner policy guardrails: x-agentpay-max-amount (hard cap on invoice grand total in MYR, read from TaxInclusiveAmount when present), x-agentpay-approval-above (returns an unsigned draft for human review), x-agentpay-allowed-tools (tool allow-list) — set by the human owner in the MCP client config; the agent cannot relax them. ## Safety Stateless translation layer that forwards the MyInvois submission calls only. XAdES signing stays merchant-side; the client_id and client_secret travel per-request in headers (to mint a fresh access_token) and are never stored. This server never stores credentials, documents, or customer data. Privacy policy: https://inv-my.wishpool.app/privacy ## Sister servers Invoices: Saudi ZATCA https://inv-sa.wishpool.app/mcp, Poland KSeF https://inv-pl.wishpool.app/mcp, Mexico CFDI 4.0 https://inv-mx.wishpool.app/mcp, Chile DTE https://inv-cl.wishpool.app/mcp, Brazil NF-e https://inv-br.wishpool.app/mcp, Peru CPE https://inv-pe.wishpool.app/mcp, India GST e-invoicing https://inv-in.wishpool.app/mcp. Same stateless BYO pattern, local payments in 81 countries — full list: https://mcp.wishpool.app/llms.txt (Taiwan e-invoice 電子發票 lives in https://mcp.wishpool.app/mcp).