novapay-mcp

novapay-mcp

MCP server for NovaPay that enables AI agents to create payment links, poll payment status, manage session lifecycle, and generate merchant keys.

Category
访问服务器

README

NovaPay MCP Server

CI npm install size license

MCP stdio server for NovaPay on top of the official novapay SDK. Connect it to any MCP-compatible agent (Claude Desktop, Claude Code, custom agents) — and the agent can create payment links, poll payment status, drive the session lifecycle and generate merchant keys.

📖 Документація українською

Contents · Requirements · Setup · Onboarding from scratch · Tools · Development · License

Requirements

  • Node.js 20.3+

Setup

Add to your MCP client config:

{
  "mcpServers": {
    "novapay": {
      "command": "npx",
      "args": ["-y", "novapay-mcp"],
      "env": {
        "MERCHANT_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\nMIIEvQ...\n-----END PRIVATE KEY-----",
        "MERCHANT_ID": "<your merchant id>",
        "NOVAPAY_ENVIRONMENT": "stage"
      }
    }
  }
}

The PEM can be pasted either with \n escapes (as in the example) or as a multi-line value — the server understands both.

Environment variables

Variable Required Description
MERCHANT_PRIVATE_KEY yes Merchant's private RSA key (PEM). Signs every request to NovaPay
MERCHANT_ID yes Merchant identifier in NovaPay
NOVAPAY_ENVIRONMENT yes stage — NovaPay test environment (api-qecom.novapay.ua), prod — production (api-ecom.novapay.ua)
NOVAPAY_PUBLIC_KEY no NovaPay public key (PEM). Unused in stdio mode — the server does not receive postbacks

The server starts without configuration too: generate_keys stays available, and the payment tools return an error listing the missing variables.

Onboarding from scratch

No keys yet? Generate them straight from the agent:

  1. Connect the server without env (or with a partial env) and ask the agent to call generate_keys.
  2. Register the public key from the response with NovaPay (Acquiring3 admin panel or via support).
  3. Paste the contents of the private key file (the path is in the response, the file lives in ~/.novapay/ with 0600 permissions) into MERCHANT_PRIVATE_KEY, add MERCHANT_ID and NOVAPAY_ENVIRONMENT.
  4. Restart the MCP server — the payment tools go live.

The private key is never returned in a tool response — only the file path, so the key never lands in the agent's context or logs.

Tools

Onboarding

  • generate_keys — generate a 2048-bit RSA pair for the merchant. Works without configuration.

Creating payments (a session can hold several payments)

  • create_acquiring_session — create an Internet Acquiring session → session id.
  • add_acquiring_payment — add a payment to the session → payment URL for the customer.
  • create_checkout_session — create a Checkout session (payment + Nova Poshta delivery) → session id.
  • add_checkout_payment — add a payment to a checkout session → payment URL.

Both add_*_payment require an explicit use_hold: true — hold the funds for a later capture via complete_hold, false — charge immediately. If the user did not say which, the agent should ask.

Session lifecycle (shared by acquiring and checkout)

  • get_session_status — session status, amounts, list of operations. The only way to see the result of the operations below.
  • complete_hold — capture the held funds (possibly partially).
  • void_session — cancel a paid/held session. On a paid session this refunds real money.
  • expire_session — invalidate an unpaid session (cancel the payment link).
create_*_session ──▶ add_*_payment ──▶ url
                          │
                    customer pays
                          ├─ use_hold: true ──▶ holded ──complete_hold──▶ paid
                          └─ use_hold: false ──────────────────────────▶ paid
                                                                          │
       unpaid ──expire_session──▶ expired             void_session ◀──────┘
                                                          ▼
                                                        voided

Development

npm install
npm test        # tsc --noEmit + node:test
npm run build   # tsc → dist/

A smoke test against the NovaPay stage environment is possible with the published QE keys (merchant 2) from the Authentication page.

CI runs the same checks on Node 20, 22 and 24 for every push and pull request; pushing a v* tag publishes the package to npm.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选