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 分