Skip to main content
Glama
prime-agent-stripe-mcp

prime-agent-stripe-mcp

by gbrlpzz

prime-agent-stripe-mcp

Prime Agent 的官方 Stripe MCP 集成。

CI License: MIT Python

Prime Agent 通过 https://mcp.stripe.com 连接到 Stripe 的官方远程 MCP 服务器。然后,代理可以像其他 MCP 客户端一样,通过相同的 API 接口检查和操作 Stripe 资源。

[!NOTE] Stripe 的 MCP 服务器处于公开预览阶段。它同时提供读取和写入工具。开发时请保持连接处于测试模式。

┌─────────────────────────────────┐                      ┌─────────────────────────────────┐
│ │ from stripe import         │  │                      │ │ mcp.stripe.com              │ │
│ │   stripe                   │  │                      │ │ API · billing · reporting   │ │
│ │ await stripe.list_tools()  │──┼   OAuth 2.1 + PKCE   │ │ products · customers        │ │
│ │ await stripe.call_tool(    │  │                      │ │ subscriptions · events      │ │
│ auth.json: mcp:stripe           │                      │ │ documentation search        │ │
└─────────────────────────────────┘                      └─────────────────────────────────┘

为什么选择此集成

  • Stripe 托管的服务器 — 无需自托管代理,此仓库中也不包含 Stripe API 密钥。

  • Prime Agent 原生 — 该模块扩展了 McpIntegration,并从 Python 内核中暴露实时工具清单。

  • OAuth 2.1 与 PKCE — 浏览器授权仅存储在 Prime Agent 私有的 auth.json 中的 mcp:stripe 下。

  • 测试模式友好 — 授权 Liminal Stripe 账户,并在开发期间仅使用测试模式资源。

Related MCP server: Stripe MCP Server

安装

需要 Prime Agent 及其 Python 内核,以及 Python 3.10 或更高版本。

  1. 克隆仓库并将技能链接到位:

    git clone https://github.com/gbrlpzz/prime-agent-stripe-mcp.git ~/prime-agent-stripe-mcp
    rm -rf ~/.agents/skills/stripe
    ln -s ~/prime-agent-stripe-mcp ~/.agents/skills/stripe
  2. 将可编辑包安装到 Prime Agent 的内核环境中:

    uv pip install --python ~/.prime/agent/kernel-venv/bin/python -e ~/prime-agent-stripe-mcp
  3. 将远程服务器添加到 Prime Agent 的 MCP 设置中(仅需一次):

    {
      "mcpServers": {
        "stripe": {
          "type": "http",
          "url": "https://mcp.stripe.com",
          "oauth": true
        }
      }
    }
  4. 重新加载 Prime Agent 并授权 Stripe 账户:

    /reload
    /mcp login stripe

请批准 Liminal Stripe 账户,而不是个人或生产账户,这些账户应保持在此开发工作流之外。Prime Agent 将凭据存储为 mcp:stripe。它永远不会写入此仓库。

用法

from stripe import stripe, auth_status

print(auth_status())               # credential state, no token values
tools = await stripe.list_tools()  # live Stripe MCP inventory
# Inspect the live schema before calling a read or write tool.
result = await stripe.call_tool("<live-tool-name>", {"<live-argument>": "..."})

auth_status() 返回一个不含机密信息的小字典:

{"enabled": True, "expires_fresh": True, "type": "oauth"}

工具名称和参数属于 Stripe,在公开预览期间可能会发生变化。请先调用 list_tools(),或使用从实时清单中自动绑定的方法。

服务器包含用于 Stripe API 发现、API 读取和写入、账户信息、计费资源、文档和报告的工具。写入操作会更改 Stripe 数据。在创建、更新、取消、退款或删除任何内容之前,请请求人工确认。

令牌刷新回退

Prime Agent 会自动刷新存储的令牌。在无法自动刷新的主机上,请调用模块级回退:

from stripe import refresh

refresh()  # exchanges the stored refresh token; rewrites auth.json with mode 600

Liminal 开发工作流

  1. 将您的个人用户添加为 Liminal Stripe 账户的团队成员。

  2. 以该用户身份授权此集成。

  3. 确认 Stripe 仪表板处于 测试模式。

  4. 仅创建测试产品、价格、客户和订阅。

  5. 使用生成的测试 Webhook 签名密钥单独配置 Supabase stripe-webhook 函数。MCP 凭据不能替代服务器端的 STRIPE_SECRET_KEY 或 STRIPE_WEBHOOK_SECRET。

故障排除

症状

修复

auth_status() 报告没有凭据

再次运行 /mcp login stripe。

长时间暂停后调用失败

运行 refresh();如果返回 False,请重新登录。

工具名称未知

重新运行 await stripe.list_tools();清单在预览期间可能会发生变化。

开发

python3 tests/test_skill.py                             # standalone suite, no Prime Agent needed
~/.prime/agent/kernel-venv/bin/python -m pytest tests/  # inside Prime Agent's kernel

CI 在每次推送到 main 时运行独立测试套件。

安全

  • 此仓库或其 Git 历史中不包含任何凭据。

  • OAuth 令牌仅存储在 Prime Agent 私有的 auth.json 中。

  • 该模块仅与 https://mcp.stripe.com 和 Stripe 的 OAuth 授权服务器通信。

  • 将所有开发变更保持在 Stripe 测试模式中。

  • 切勿将 Stripe 机密值或私钥材料放入源代码、测试、文档或 Git 历史中。

许可证

MIT — 请参阅 LICENSE。Stripe 是 Stripe, Inc. 的商标;这是对 Stripe 官方 MCP 服务器的独立客户端集成(请参阅 NOTICE)。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language interaction with Stripe accounts to query customers, revenue, invoices, subscriptions, disputes, and issue refunds.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables integration with Stripe APIs through function calling, supporting operations on customers, products, invoices, subscriptions, and more.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to query Stripe operations such as customers, recent charges, duplicate charges, and revenue summaries through read-only MCP tools.
      4
      MIT