mcpField
🧠
🧠 Model Context Protocol (MCP) Guide for Refund Protect Integration

🧠 Model Context Protocol (MCP) Guide for Refund Protect Integration

本地服务
github.com/abelpenton金融数据078 周前更新

关于 🧠 Model Context Protocol (MCP) Guide for Refund Protect Integration

面向 Protect Group API 的 MCP 服务,可通过自然语言执行操作。它支持报价与交易管理、取消交易,以及生成 Refund Protect 集成代码。

主要功能

  1. 01获取并查询报价
  2. 02创建和查询交易
  3. 03按预订编号取消交易
  4. 04生成组件及 React 代码
  5. 05生成 C# 报价服务

适用场景

  1. 01为预订请求 Refund Protect 报价
  2. 02创建或取消交易
  3. 03生成嵌入 Refund Protect 组件的代码

MCP 相关

向 MCP 客户端提供 Refund Protect API 操作和集成代码生成工具。文档介绍了在 Claude 和 Cursor 等 Agent 中配置。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"refund-protect": {
"command": "npx",
"args": [
"-y",
"@abelpenton_dev/rp-mcp-server"
]
}
}
}
启动命令npx -y @abelpenton_dev/rp-mcp-server

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@abelpenton_dev/rp-mcp-server

工具

10

收录的工具列表 · 更新于 3 周前

参数类型必填说明
VendorCodestring是供应商代码(会员 ID)
Secretstring是供应商密钥
BookingReferencestring是预订参考编号
EventDatestring是活动日期,采用 ISO 格式(例如,2025-05-01T18:30:00Z)
LanguageCodestring是语言代码(例如,EN)
NumberOfTicketnumber是票数
TotalValuenumber是预订总价值
CurrencyCodestring是货币代码(例如,USD)

详细介绍

🧠 Refund Protect 集成的 Model Context Protocol(MCP)指南

1. MCP 概述

Model Context Protocol(MCP) 是一种协议,允许大模型 Agent(例如 ChatGPT 或 Claude)通过共享上下文与 API 和工具动态交互。MCP 弥合了自然语言界面与可编程系统之间的差距,使代码执行、API 调用和插件使用都能通过结构化提示词实现上下文感知。

官方文档

2. 官方 MCP 服务示例

2.1 以下官方参考服务演示了 MCP 核心功能和 SDK 用法:
  • Slack:频道管理和消息功能
  • Google Drive:Google Drive 的文件访问和搜索功能
  • GitHub:仓库管理、文件操作和 GitHub API 集成
更多示例

3. 在 Agent 中配置

3.1 什么是客户端 Agent?

客户端 Agent 是配置为使用 MCP 规范与外部工具或服务交互的 AI 模型或聊天机器人(ChatGPT、Claude、DeepSeek)。这些 Agent 可以解读提示词,并通过支持 MCP 的工具执行操作。

3.2 支持 MCP 集成的 Agent
  • Cursor
  • Claude(通过 Cursor)
  • Windsurf by Codeium
  • ChatGPT(即将推出)
3.3 ChatGPT 支持

ChatGPT 与 MCP 的集成即将推出。集成完成后,你将能够在 ChatGPT Pro 环境中使用相同的 MCP 命令,并享有持久的工具上下文和简化的 API 交互。


4. Refund Protect MCP 服务

Refund Protect MCP 服务是一个 AI 服务 Agent,可让你使用自然语言与 Protect Group API 交互。它支持创建报价、交易、取消以及官方 API 提供的许多其他功能。

使用提示词工程,你将能够以氛围编程的方式实现 Protect Group 集成,从在源代码中安装并渲染 Refund Protect 内容,到使用任何编程语言或框架创建可连接 Protect Group API 的服务。


5. MCP 服务设置

每个 AI Agent 配置 MCP 服务的方式各不相同,请使用以下 JSON 添加 Refund Protect 服务:

{
  "mcpServers": {
    "rp-mcp-server": {
      "command": "npx",
      "args": ["-y", "@abelpenton_dev/rp-mcp-server"]
    }
  }
}
5.1 在 Claude 中设置
  1. 下载 Claude Desktop。
  2. 在 Claude Desktop 中,点击 Settings。
  3. 前往 Developer Section。
  4. 点击 Edit Config。
  5. 将 RP 服务设置添加到 claude_desktop_config.json 文件中。
  6. 重启应用,然后开始使用自然语言向 Claude 输入提示词。
5.2 在 Cursor 中设置(面向开发者)
  1. 下载 Cursor IDE
  2. 打开 Cursor 并前往 MCP Setting 。
  3. 点击 Add new global MCP Server。
  4. 将 RP 服务设置添加到 mcp.json 文件中。
  5. 按 Ctrl + I 以 Agent 模式打开聊天。
  6. 在支持 MCP 的界面中输入提示词,开始与工具交互。

6. 使用 Refund Protect API 的交互式提示词

使用以下提示词,通过 MCP 工具与 Refund Protect API 交互:

示例提示词:

这是我的 Refund Protect API 凭据。 Vendor Code:vendorCode Secret:secret

为我 7 月 15 日的航班获取 Refund Protect 报价,费用为 540 EUR。

提供报价 quoteID 的详细信息。

使用生成的报价为 Refund Protect 创建一笔交易。

提供预订参考号为 bookingReference 的交易详细信息。

取消预订参考号为 bookingReference 的交易。


7. 以氛围编程方式构建 Refund Protect 集成

使用以下工具提示词自动生成可安装或可嵌入的代码:

示例提示词:

生成安装 Refund Protect JavaScript 小组件的代码,并生成渲染该小组件的代码

生成安装并渲染 Refund Protect React 组件的代码

使用 Dotnet 创建一个实现 Refund Protect 报价请求的服务


8. 聊天示例

以下是使用启用了 MCP 的提示词进行对话的实际示例:

User: I need a Refund Protect quote for my hotel booking on May 22. It cost 320 EUR.
Agent: Sure, fetching the quote for 320 EUR on May 22…
→ Executes refundProtectQuoteTool

User: Can you show me the details of that quote?
→ Executes refundProtectQuoteLookupTool

User: Book it using that quote.
→ Executes refundProtectSalesTool

User: Actually, cancel the booking. Use the reference code I gave earlier.
→ Executes refundProtectCancelTool

9. Refund Protect MCP 服务提供的工具

以下是 Refund Protect MCP 服务提供的工具:

refundProtectQuoteTool – 获取 Refund Protect 报价。

refundProtectQuoteLookupTool – 获取现有 Refund Protect 报价的详细信息。

refundProtectSalesTool – 使用 Refund Protect 报价创建交易。

refundProtectSalesLookupTool – 使用预订参考编号获取交易的详细信息。

refundProtectCancelTool – 使用预订参考编号取消交易。

rpWidgetInstallation – 生成用于安装 Refund Protect JavaScript 小组件的代码。

rpWidgetRender – 生成用于渲染 Refund Protect JavaScript 小组件的代码。

rpReactComponentInstallationTool – 生成用于安装 Refund Protect React 组件的代码。

rpReactComponentRenderTool – 生成用于渲染 Refund Protect React 组件的代码。

apiQuoteImplementation – 创建一个实现 Refund Protect 报价请求的 C# 服务。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。