
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.
概览
让助手对接 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 的网络;多国账户需为每个国家使用单独的令牌。
安装
在 SourceWeft 中
- 打开 控制台中的 MyFatoorah MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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
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
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:
Restart Claude Desktop after saving the configuration.
Claude Code
Project-scoped configuration can use .mcp.json (keep it uncommitted if it contains a token):
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
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
- Read
myfatoorah://configurationand confirm test versus live. - If selecting a gateway, call
myfatoorah_get_payment_methodsand use itsApiName. - Confirm amount, currency, customer, notification method, and callback URL.
- Call
myfatoorah_create_paymentand give the customer itsPaymentURL. - After callback, call
myfatoorah_get_paymentwith the returned PaymentId. A redirect is not proof of payment; require invoice statusPAIDand transaction statusSUCCESS.
Refunds move money in live mode. Obtain explicit user approval for the exact PaymentId and amount before passing confirm: true.
Development
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-methodsPOST /v3/paymentsGET /v3/payments/{paymentId}GET /v3/invoices/{invoiceId}GET /v3/invoices/externalIdentifier/{externalIdentifier}POST /v3/refundsGET /v3/refunds/{refundId}
References:
License
MIT
来源:README.md,提交 2d8a767
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分