MyFatoorah MCP

io.github.kuwaitdevs由 GitHub 帳號 kuwaitdevs 發布v0.1.0更新於 Oct 24, 2026

Safely connect AI agents to MyFatoorah payments, invoices, payment methods, and refunds.

已驗證STDIO僅桌面金融商業與電商

概覽

AI 產生的概覽

讓助理串接 MyFatoorah 付款:查詢付款方式、建立付款連結、驗證付款、檢視發票並辦理退款。

可以做什麼
把 MyFatoorah 付款 API 包裝成多個專用工具:列出已啟用的付款方式、建立託管結帳或發票連結、依 PaymentId 取得付款詳情、依 InvoiceId 或外部識別碼讀取發票、建立全額或部分退款,以及查詢退款詳情。另有一個受限的通用請求工具,只允許相對 /v2/ 或 /v3/ 路徑,寫入操作需要確認。也提供設定資源與引導式付款連結提示。
適用情境
當助理需要在 Claude Desktop、Claude Code、VS Code 或 Cursor 等 MCP 主機中建立或驗證 MyFatoorah 付款、檢視發票或處理退款時使用。接上正式帳戶前請先在沙箱環境測試。
執行需求
以 npm 套件(myfatoorah-mcp)透過 stdio 在使用者本機執行,需要 Node.js 20 或更新版本。需要 MyFatoorah API 權杖,放在 MYFATOORAH_API_TOKEN;可選 MYFATOORAH_ENVIRONMENT(test、kuwait、uae、saudi_arabia、qatar、egypt,預設 test)與 MYFATOORAH_TIMEOUT_MS。需要連線至 MyFatoorah API 的網路;多國帳戶需為每個國家使用各自的權杖。
安裝前請注意
MYFATOORAH_API_TOKEN 是 bearer 憑證:應放在主機環境或密鑰管理服務中,不要寫進原始碼控管或模型提示,並使用最小權限的金鑰。在正式模式下退款會實際移動資金,傳入 confirm: true 前必須就確切的 PaymentId 與金額取得明確同意。建立付款會寫入資料。重新導向並不代表付款成功,應以發票狀態 PAID 與交易狀態 SUCCESS 為準。不要將此 stdio 程序暴露為未經驗證的網路服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MyFatoorah MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MyFatoorah MCP

An LLM-friendly Model Context Protocol server for the MyFatoorah API. It lets Claude, VS Code, Cursor, and other MCP hosts discover payment methods, create payment links, verify payments, inspect invoices, and manage refunds through focused tools.

This is an independent community project, not an official MyFatoorah product. Test in the sandbox before using a live account.

For step-by-step host setup, Inspector testing, agent prompts, payment verification, refunds, and troubleshooting, see the usage guide.

Requirements

  • Node.js 20 or newer
  • A MyFatoorah API token with only the permissions required by the tools you use

Setup

sh
npm installcp .env.example .envnpm run build

Set MYFATOORAH_API_TOKEN in the MCP host's environment. The server does not automatically load .env; the VS Code debug configuration does.

Environment variables

VariableRequiredDefaultDescription
MYFATOORAH_API_TOKENYes, when calling the API—Bearer token. Never expose it to an agent prompt.
MYFATOORAH_ENVIRONMENTNotesttest, kuwait, uae, saudi_arabia, qatar, or egypt
MYFATOORAH_BASE_URLNoEnvironment URLHTTPS override for a supported MyFatoorah deployment or test proxy
MYFATOORAH_TIMEOUT_MSNo30000Request timeout from 1 to 300000 ms

Kuwait also covers the shared Bahrain, Jordan, and Oman API origin. Multi-country accounts use a separate token for each country.

Connect an MCP host

Use an absolute path in host configurations. Replace /absolute/path/to/myfatoorah-mcp and the token placeholder locally.

Claude Desktop

Add this server to Claude Desktop's MCP configuration:

json
{  "mcpServers": {    "myfatoorah": {      "command": "node",      "args": ["/absolute/path/to/myfatoorah-mcp/dist/index.js"],      "env": {        "MYFATOORAH_API_TOKEN": "YOUR_TOKEN",        "MYFATOORAH_ENVIRONMENT": "test"      }    }  }}

Restart Claude Desktop after saving the configuration.

Claude Code

Project-scoped configuration can use .mcp.json (keep it uncommitted if it contains a token):

json
{  "mcpServers": {    "myfatoorah": {      "type": "stdio",      "command": "node",      "args": ["/absolute/path/to/myfatoorah-mcp/dist/index.js"],      "env": {        "MYFATOORAH_API_TOKEN": "YOUR_TOKEN",        "MYFATOORAH_ENVIRONMENT": "test"      }    }  }}

VS Code / GitHub Copilot

The included .vscode/mcp.json launches the built server and securely prompts for a token. Build once, open the MCP servers view, then start myfatoorah. The token is not stored in the repository.

Cursor and generic stdio hosts

Use the same command, args, and env values as the Claude Desktop example. MCP protocol messages use stdin/stdout; server diagnostics must use stderr.

After publishing to npm, hosts can instead launch it with npx -y myfatoorah-mcp.

Tools

ToolEffectPurpose
myfatoorah_get_payment_methodsRead-onlyLists enabled methods and their ApiName values
myfatoorah_create_paymentCreates dataCreates a hosted checkout or invoice link with POST /v3/payments
myfatoorah_get_paymentRead-onlyGets authoritative payment details by PaymentId
myfatoorah_get_invoiceRead-onlyGets an invoice by InvoiceId or external identifier
myfatoorah_create_refundDestructiveCreates a full or partial refund; requires confirm: true
myfatoorah_get_refundRead-onlyGets refund details by RefundId
myfatoorah_api_requestVariesRestricted escape hatch for relative /v2/ or /v3/ paths; mutations require confirmation

The server also exposes:

  • Resource myfatoorah://configuration: environment, base URL, timeout, and whether a token is configured—never the token itself.
  • Prompt create-payment-safely: a reusable guided payment-link workflow.

Successful tools return a concise text summary plus machine-readable structuredContent containing the MyFatoorah response.

Safe payment workflow

  1. Read myfatoorah://configuration and confirm test versus live.
  2. If selecting a gateway, call myfatoorah_get_payment_methods and use its ApiName.
  3. Confirm amount, currency, customer, notification method, and callback URL.
  4. Call myfatoorah_create_payment and give the customer its PaymentURL.
  5. After callback, call myfatoorah_get_payment with the returned PaymentId. A redirect is not proof of payment; require invoice status PAID and transaction status SUCCESS.

Refunds move money in live mode. Obtain explicit user approval for the exact PaymentId and amount before passing confirm: true.

Development

sh
npm run formatnpm run lintnpm run typechecknpm testnpm run buildnpm run inspect

npm run inspect starts the official MCP Inspector against the compiled stdio server. VS Code also includes build/test tasks and a debug configuration.

Tests mock every MyFatoorah request; they do not make network calls or require a token.

Security

  • Use a least-privilege MyFatoorah API key and rotate it regularly.
  • Put credentials in the host environment or a secret manager, never source control or model context.
  • The generic request tool rejects absolute URLs, protocol-relative URLs, traversal, and paths outside /v2/ and /v3/ to prevent credential exfiltration.
  • API errors and Bearer values are redacted before reaching the model.
  • Prefer idempotency keys for supported mutations and stable order identifiers.
  • Do not expose this stdio process as an unauthenticated network service.
  • Direct card handling is intentionally not modeled as a focused tool; it requires PCI compliance.

API scope and references

The focused tools use MyFatoorah's documented v3 routes as of August 2026:

  • GET /v3/payment-methods
  • POST /v3/payments
  • GET /v3/payments/{paymentId}
  • GET /v3/invoices/{invoiceId}
  • GET /v3/invoices/externalIdentifier/{externalIdentifier}
  • POST /v3/refunds
  • GET /v3/refunds/{refundId}

References:

License

MIT

來源:README.md,提交 2d8a767

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分