Skip to main content
Glama
kuwaitdevs

MyFatoorah MCP

by kuwaitdevs

MyFatoorah MCP

一个对 LLM 友好的 Model Context Protocol 服务器,用于 MyFatoorah API。它让 Claude、VS Code、Cursor 以及其他 MCP 主机能够通过专用工具发现支付方式、创建支付链接、验证支付、查看发票以及管理退款。

这是一个独立的社区项目,不是 MyFatoorah 的官方产品。在使用正式账户之前,请先在沙盒环境中测试。

有关分步主机设置、Inspector 测试、智能体提示词、支付验证、退款和故障排查,请参阅使用指南

要求

  • Node.js 20 或更高版本

  • 一个 MyFatoorah API 令牌,仅需包含你所使用工具要求的权限

Related MCP server: AgentPay

设置

npm install
cp .env.example .env
npm run build

在 MCP 主机的环境中设置 MYFATOORAH_API_TOKEN。服务器不会自动加载 .env 文件;VS Code 的调试配置会加载。

环境变量

变量

必填

默认值

说明

MYFATOORAH_API_TOKEN

调用 API 时需要

Bearer 令牌。切勿将其暴露给智能体提示词。

MYFATOORAH_ENVIRONMENT

test

testkuwaituaesaudi_arabiaqataregypt

MYFATOORAH_BASE_URL

环境 URL

用于受支持的 MyFatoorah 部署或测试代理的 HTTPS 覆盖

MYFATOORAH_TIMEOUT_MS

30000

请求超时,范围为 1 到 300000 毫秒

科威特环境还覆盖巴林、约旦和阿曼共用的 API 源。多国家账户需要为每个国家使用单独的令牌。

连接 MCP 主机

在主机配置中使用绝对路径。请在本地替换 /absolute/path/to/myfatoorah-mcp 和令牌占位符。

Claude Desktop

将此服务器添加到 Claude Desktop 的 MCP 配置中:

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

保存配置后,重启 Claude Desktop。

Claude Code

项目级配置可以使用 .mcp.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

随附的 .vscode/mcp.json 会启动构建后的服务器,并安全地提示输入令牌。构建一次,打开 MCP 服务器视图,然后启动 myfatoorah。该令牌不会存储在仓库中。

Cursor 和通用 stdio 主机

使用与 Claude Desktop 示例相同的 commandargsenv 值。MCP 协议消息使用 stdin/stdout;服务器诊断信息必须使用 stderr。

发布到 npm 后,主机也可以改用 npx -y myfatoorah-mcp 启动它。

工具

工具

影响

用途

myfatoorah_get_payment_methods

只读

列出已启用的支付方式及其 ApiName

myfatoorah_create_payment

创建数据

使用 POST /v3/payments 创建托管结账或发票链接

myfatoorah_get_payment

只读

按 PaymentId 获取权威支付详情

myfatoorah_get_invoice

只读

按 InvoiceId 或外部标识符获取发票

myfatoorah_create_refund

破坏性

创建全额或部分退款;需要 confirm: true

myfatoorah_get_refund

只读

按 RefundId 获取退款详情

myfatoorah_api_request

视情况而定

针对相对 /v2//v3/ 路径的受限逃生通道;变更操作需要确认

该服务器还提供:

  • 资源 myfatoorah://configuration:环境、基础 URL、超时时间,以及是否已配置令牌——绝不包含令牌本身。

  • 提示 create-payment-safely:一个可复用的引导式支付链接工作流。

成功的工具会返回简洁的文本摘要,外加包含 MyFatoorah 响应的机器可读 structuredContent

安全支付工作流

  1. 读取 myfatoorah://configuration,确认是测试环境还是正式环境。

  2. 如需选择支付网关,请调用 myfatoorah_get_payment_methods 并使用其 ApiName

  3. 确认金额、货币、客户、通知方式以及回调 URL。

  4. 调用 myfatoorah_create_payment,将返回的 PaymentURL 提供给客户。

  5. 回调之后,使用返回的 PaymentId 调用 myfatoorah_get_payment。重定向并不代表支付完成;必须确认发票状态为 PAID 且交易状态为 SUCCESS

退款在正式模式下会真实转移资金。在传入 confirm: true 之前,必须就确切的 PaymentId 和金额获得用户的明确批准。

开发

npm run format
npm run lint
npm run typecheck
npm test
npm run build
npm run inspect

npm run inspect 会针对编译后的 stdio 服务器启动官方 MCP Inspector。VS Code 还包含构建/测试任务和调试配置。

测试会模拟所有 MyFatoorah 请求;它们不会发起网络调用,也不需要令牌。

安全

  • 使用最小权限的 MyFatoorah API 密钥,并定期轮换。

  • 将凭据放入主机环境或密钥管理器中,切勿放入源代码管理或模型上下文。

  • 通用请求工具会拒绝绝对 URL、协议相对 URL、路径穿越以及 /v2//v3/ 之外的路径,以防凭据外泄。

  • API 错误和 Bearer 值在到达模型之前会被脱敏。

  • 对于受支持的变更操作,请优先使用幂等键和稳定的订单标识符。

  • 请勿将此 stdio 进程作为未经身份验证的网络服务暴露。

  • 直接卡片处理被刻意未建模为专用工具;这需要符合 PCI 合规要求。

API 范围与参考

这些专用工具使用 MyFatoorah 文档中截至 2026 年 8 月的 v3 路由:

  • 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}

参考:

许可证

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI agents to interact with multiple payment providers (Stripe, Paystack) through a unified API. Supports payment initialization, verification, refunds, customer management, and invoicing without requiring knowledge of specific provider implementations.
    2
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for AgentPay — the payment gateway for autonomous AI agents. Fund a wallet once, give your agent the key, and it discovers, provisions, and pays for tool APIs on its own. One key, every tool.
    112
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides AI agents with 220+ tools for building websites, sending email, managing contacts, invoicing, databases, automation, and more through a single secure connection. Features hardware-bound authentication and works with Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients.

View all related MCP servers

Related MCP Connectors

  • Agent Commerce Protocol MCP — bridges Stripe ACP + Google AP2 + Coinbase x402 for agent payments

  • A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,

  • Agent Commerce MCP — agent-native A2A storefront. Discovery, Stripe checkout, affiliate program.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kuwaitdevs/myfatoorah-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server