AI agents can now submit, query and cancel a Malaysia e-invoice through LHDN MyInvois (e-Invois). This remote MCP server forwards your already-signed UBL 2.1 document to the government MyInvois gateway — submit_invoice to lodge it, query_submission to poll validation, cancel_invoice within the 72-hour window, and build_invoice_draft to compute SST totals locally. It only wraps the submission calls: XAdES signing stays merchant-side.
{
"mcpServers": {
"malaysia-invoice": {
"type": "http",
"url": "https://inv-my.wishpool.app/mcp",
"headers": {
"x-myinvois-client-id": "your-erp-client-id",
"x-myinvois-client-secret": "your-erp-client-secret",
"x-myinvois-mode": "prod"
}
}
}
}
Get your ERP OAuth2 client_id + client_secret by self-registering your ERP in the MyTax portal (Register ERP) at mytax.hasil.gov.my (preprod: preprod-mytax.hasil.gov.my). Omit x-myinvois-mode to stay in the sandbox preprod environment (no fiscal effect); prod = production. Your certificate and private key never leave your side — this server never sees them.
documentHash (SHA-256); you pass { format, document(base64), documentHash, codeNumber }. This server mints an OAuth2 access_token per request (client_credentials, scope InvoicingAPI), relays it to MyInvois, and translates the response — it never signs and never stores anything.submit_invoice returns a submissionUid (HTTP 202, queued) with accepted/rejected lists; query_submission then reports overall_status = in progress / valid / partially valid / invalid.cancel_invoice (PUT documents/state/{uuid}/state, status=cancelled) is allowed only within 72 hours of a document becoming valid — after that, issue a credit/debit note.build_invoice_draft computes Malaysian SST totals (excl-tax, tax, incl-tax, payable) and emits an unsigned UBL skeleton — no network, no credentials, no fiscal effect.client_id/client_secret travel per-request in headers and are never stored; the access_token is minted fresh per call and never cached.x-agentpay-max-amount, x-agentpay-approval-above, x-agentpay-allowed-tools — set by the human owner in client config; the agent cannot relax them. The cap applies to the invoice grand total (TaxInclusiveAmount, MYR) when it can be read from the signed document.Credentials taken from headers (never in the body); status enums (in progress / valid / partially valid / invalid) spelled out in every tool description; MyInvois responses passed through with numbered next_steps; every error teaches the fix (both credential headers, base64 not raw XML/JSON, submissionUid vs uuid, 72h cancel window, mode).
Invoices: Saudi ZATCA inv-sa · Poland KSeF inv-pl · Mexico CFDI 4.0 inv-mx · Chile DTE inv-cl · Brazil NF-e inv-br · Peru CPE inv-pe · India GST inv-in. Local payments in 81 countries, one family, same stateless pattern: mcp.wishpool.app (Taiwan e-invoice 電子發票 included).