Robokassa Mcp

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

Comprehensive MCP server for the Robokassa payment gateway (18 tools, full API coverage).

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

概覽

AI 產生的概覽

針對 Robokassa 支付閘道的 MCP 伺服器,讓助理產生簽章付款連結、查詢付款狀態、發起退款並處理財政收據。

可以做什麼
  • 產生帶簽章的付款連結,可附 54-ФЗ 財政收據,並建立多收款方分帳連結
  • 依發票號查詢付款狀態、列出可用付款方式、計算商家實收金額
  • 建立並輪詢退款進度,另提供合作夥伴退款路徑
  • 執行兩步驟信用卡預授權(凍結、確認、取消)與訂閱自動扣款
  • 驗證 ResultURL 與 SuccessURL 回呼簽章,建立或查詢第二張財政收據
  • 發送付費簡訊通知
適用情境
適合經營 Robokassa 商店、希望借助助理處理付款事務的情境:產生付款連結、查詢付款狀態、發起或追蹤退款、處理預授權與訂閱扣款,或在串接時驗證回呼簽章。
執行需求
以 Python 套件在本機執行(uvx robokassa-mcp),預設為 stdio,也可透過傳輸參數改用 HTTP。需要 Robokassa 商家帳號,並設定環境變數 ROBOKASSA_LOGIN、ROBOKASSA_PASSWORD1、ROBOKASSA_PASSWORD2、ROBOKASSA_PASSWORD3。退款 API 須在商家後台開通。需要連線至 Robokassa 介面的網路。
安裝前請注意
需要在環境中提供商店的三個簽章密碼(ROBOKASSA_PASSWORD1、ROBOKASSA_PASSWORD2、ROBOKASSA_PASSWORD3),可用於付款簽章、狀態查詢與退款。相關工具會動用真實資金:退款、訂閱扣款、預授權凍結與付費簡訊。建立退款須在後台開通退款 API。付款與退款資料會傳送至 Robokassa 伺服器。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

[robokassa-mcp — Robokassa payment gateway exposed to AI agents through MCP]

robokassa-mcp

[CI] [PyPI] [Python] [License] [Docs]

📚 Documentation  ·  PyPI  ·  Docker  ·  MCP Registry


Comprehensive Python client and Model Context Protocol server for Robokassa — the Russian payment gateway.

Covers the full API surface: checkout, XML status interfaces, refunds, holding (pre-auth), recurring subscriptions, 54-ФЗ fiscal receipts, Partner API, and auxiliary endpoints.

Install (once published)

bash
# As an MCP server for Claude Desktop / Claude Code / Cursor / Windsurfuvx robokassa-mcp
# As a Python librarypip install robokassa-mcp

Use as a Python library

python
import asynciofrom decimal import Decimalfrom robokassa import create_invoice, RobokassaClient
# Build a signed checkout URL (no HTTP — just URL construction).invoice = create_invoice(    merchant_login="my-shop",    out_sum=Decimal("599.00"),    inv_id=12345,    password1="...",    description="Premium subscription",    email="[email protected]",)print(invoice.url)  # https://auth.robokassa.ru/Merchant/Index.aspx?...
# Check the state of a payment (hits the OpStateExt XML endpoint).async def check() -> None:    async with RobokassaClient("my-shop", password2="...") as client:        state = await client.check_payment(inv_id=12345)        print(state.is_paid, state.info.op_key)
asyncio.run(check())

Full refund flow

python
from robokassa import RobokassaClient
async def refund_flow(inv_id: int) -> None:    async with RobokassaClient("my-shop", password2="p2", password3="p3") as client:        # 1. Fetch the payment state to get its OpKey.        state = await client.check_payment(inv_id)        assert state.info.op_key, "payment not complete yet"
        # 2. Initiate a refund.        created = await client.refund_create(state.info.op_key)        print("refund requestId:", created.request_id)
        # 3. Poll status until finished / canceled.        while True:            status = await client.refund_status(created.request_id)            if status.is_terminal:                print("final:", status.state)                break

Webhook signature verification (FastAPI example)

python
from fastapi import FastAPI, Request, HTTPException, PlainTextResponsefrom robokassa import verify_result_signature, build_ok_response
app = FastAPI()
@app.post("/robokassa/result")async def result_url(req: Request) -> PlainTextResponse:    form = dict(await req.form())    if not verify_result_signature(form, password2="..."):        raise HTTPException(status_code=403, detail="Bad signature")    # ... persist the notification, mark invoice paid ...    return PlainTextResponse(build_ok_response(form["InvId"]))

Use as an MCP server

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "robokassa": {      "command": "uvx",      "args": ["robokassa-mcp"],      "env": {        "ROBOKASSA_LOGIN": "your-shop-login",        "ROBOKASSA_PASSWORD1": "password1",        "ROBOKASSA_PASSWORD2": "password2",        "ROBOKASSA_PASSWORD3": "password3"      }    }  }}

Claude Code

bash
claude mcp add robokassa \  -e ROBOKASSA_LOGIN=my-shop \  -e ROBOKASSA_PASSWORD1=... \  -e ROBOKASSA_PASSWORD2=... \  -e ROBOKASSA_PASSWORD3=... \  -- uvx robokassa-mcp

Cursor

Edit ~/.cursor/mcp.json:

json
{  "mcpServers": {    "robokassa": {      "command": "uvx",      "args": ["robokassa-mcp"],      "env": {        "ROBOKASSA_LOGIN": "your-shop-login",        "ROBOKASSA_PASSWORD1": "password1",        "ROBOKASSA_PASSWORD2": "password2",        "ROBOKASSA_PASSWORD3": "password3"      }    }  }}

VS Code (GitHub Copilot)

In user or workspace settings.json:

json
{  "github.copilot.chat.mcp.servers": {    "robokassa": {      "command": "uvx",      "args": ["robokassa-mcp"],      "env": {        "ROBOKASSA_LOGIN": "your-shop-login",        "ROBOKASSA_PASSWORD1": "password1",        "ROBOKASSA_PASSWORD2": "password2",        "ROBOKASSA_PASSWORD3": "password3"      }    }  }}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "robokassa": {      "command": "uvx",      "args": ["robokassa-mcp"],      "env": {        "ROBOKASSA_LOGIN": "your-shop-login",        "ROBOKASSA_PASSWORD1": "password1",        "ROBOKASSA_PASSWORD2": "password2",        "ROBOKASSA_PASSWORD3": "password3"      }    }  }}

HTTP transport (MCP Inspector, remote clients)

bash
uvx robokassa-mcp --transport http --port 8000

Flags: --transport {stdio,http,streamable-http,sse}, --host, --port.

MCP tools exposed to agents

All 18 tools are wrapped as @mcp.tool() and available to any MCP-capable agent (Claude Desktop, Claude Code, Cursor, Windsurf, etc.).

ToolPurposeAuth
create_invoiceBuild a signed checkout URL (optional 54-ФЗ receipt).Password#1
check_paymentGet current state of a payment by InvId (via OpStateExt).Password#2
list_currenciesList payment methods available to the shop.—
calc_out_sumCompute amount credited to shop for a given payment.Password#1
refund_createInitiate a refund (requires Refund API access).Password#3 JWT
refund_statusPoll refund progress by requestId.—
verify_result_signatureValidate a ResultURL webhook.Password#2
verify_success_signatureValidate a SuccessURL redirect.Password#1
hold_init / hold_confirm / hold_cancelTwo-step card pre-authorization.Password#1
init_recurring_parent / recurring_chargeSubscription auto-charges.Password#1
build_split_invoiceMarketplace multi-recipient checkout.—
send_smsPaid SMS service.Password#1
second_receipt_create / second_receipt_status54-ФЗ final receipt after advance.Password#1
partner_refundAlternative refund path for partner integrators.Partner JWT

Low-level signature helpers are available from Python only: compute_signature, op_state_signature, build_checkout_signature, build_refund_jwt, build_sms_signature, compute_result_signature, compute_success_signature, encode_fiscal_body.

API coverage

Mapped against the 8 public Robokassa API groups:

GroupCoverageModule
Merchant Checkout✅ create_invoice (+ 54-ФЗ)robokassa.checkout
XML Interfaces✅ check_payment, list_currencies, calc_out_sumrobokassa.xml_interface
Refund API✅ refund_create, refund_statusrobokassa.refund
Holding / Pre-auth✅ init / confirm / cancelrobokassa.holding
Recurring✅ parent + childrobokassa.recurring
Fiscal 54-ФЗ✅ second receipt create / statusrobokassa.fiscal
Partner API🟡 partner_refund only — see coverage notesrobokassa.partner
Auxiliary✅ send_sms, webhook signatures, split paymentsrobokassa.sms, robokassa.webhooks, robokassa.split

Environment variables

Most high-level entry points fall back to these env vars when credentials aren't passed explicitly:

VariableRequired for
ROBOKASSA_LOGINAll operations
ROBOKASSA_PASSWORD1Checkout, webhook SuccessURL verification, CalcOutSumm, fiscal, SMS
ROBOKASSA_PASSWORD2check_payment (OpStateExt), webhook ResultURL verification
ROBOKASSA_PASSWORD3refund_create

Signature algorithms

All signature-producing helpers accept algorithm= with "md5" / "sha256" / "sha384" / "sha512" — match whatever is configured in your Robokassa cabinet.

Development

bash
git clone https://github.com/artgas1/robokassa-mcp.gitcd robokassa-mcpuv sync --all-extras --devuv run pytest            # 107+ unit testsuv run ruff check .uv run pyright

License

MIT — see LICENSE. Drop-and-forget maintenance; PRs welcome but not guaranteed to be reviewed promptly.

來源:README.md,提交 5f2ae1f

工具

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

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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