首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
agent-toolkit2025-05-269分享
github
该服务器支持通过函数调用的方式与 Stripe API 进行集成。此协议支持多种工具,可与不同的 Stripe 服务进行交互。
By stripe
2025-05-269
github
详情内容

Stripe 模型上下文协议

Stripe 的模型上下文协议服务器允许你通过函数调用的方式与 Stripe API 进行集成。该协议支持多种工具来与不同的 Stripe 服务进行交互。

安装配置

使用 npx 运行 Stripe MCP 服务器的命令如下:

# 设置所有可用工具
npx -y @stripe/mcp --tools=all --api-key=你的STRIPE密钥

# 设置特定工具
npx -y @stripe/mcp --tools=customers.create,customers.read,products.create --api-key=你的STRIPE密钥

# 配置 Stripe 关联账户
npx -y @stripe/mcp --tools=all --api-key=你的STRIPE密钥 --stripe-account=关联账户ID

请确保将 你的STRIPE密钥 替换为你实际的 Stripe 密钥。或者,你也可以在环境变量中设置 STRIPE_SECRET_KEY

与 Claude Desktop 配合使用

将以下内容添加到你的 claude_desktop_config.json 中。更多详情请参见这里

{
  "mcpServers": {
    "stripe": {
      "command": "npx",
      "args": [
          "-y",
          "@stripe/mcp",
          "--tools=all",
          "--api-key=STRIPE_SECRET_KEY"
      ]
    }
  }
}

如果你使用 Docker:

{
    “mcpServers”: {
        “stripe”: {
            “command”: “docker",
            “args”: [
                “run”,
                "--rm",
                "-i",
                “mcp/stripe”,
                “--tools=all”,
                “--api-key=STRIPE_SECRET_KEY”
            ]
        }
    }
}

可用工具

工具 描述
customers.create 创建新客户
customers.read 读取客户信息
products.create 创建新产品
products.read 读取产品信息
prices.create 创建新价格
prices.read 读取价格信息
paymentLinks.create 创建新的支付链接
invoices.create 创建新发票
invoices.update 更新现有发票
invoiceItems.create 创建新的发票项目
balance.read 获取余额信息
refunds.create 创建新退款
paymentIntents.read 读取支付意图信息
subscriptions.read 读取订阅信息
subscriptions.update 更新订阅信息
coupons.create 创建新优惠券
coupons.read 读取优惠券信息
disputes.update 更新现有争议
disputes.read 读取争议信息
documentation.read 搜索 Stripe 文档

服务器调试

要调试你的服务器,可以使用 MCP Inspector

首先构建服务器:

npm run build

然后在终端运行以下命令:

# 启动 MCP Inspector 和带有所有工具的服务器
npx @modelcontextprotocol/inspector node dist/index.js --tools=all --api-key=你的STRIPE密钥

使用 Docker 构建

首先构建服务器:

docker build -t mcp/stripe .

然后在终端运行以下命令:

docker run -p 3000:3000 -p 5173:5173 -v /var/run/docker.sock:/var/run/docker.sock mcp/inspector docker run --rm -i mcp/stripe --tools=all --api-key=你的STRIPE密钥

操作说明

  1. 你的STRIPE密钥 替换为你实际的 Stripe API 密钥。
  2. 运行命令启动 MCP Inspector。
  3. 在浏览器中打开 MCP Inspector UI 并点击 Connect 开始 MCP 服务器。
  4. 你可以看到你选择的工具列表,并可以单独测试每个工具。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档