royalmail-mcp
royalmail-mcp
通过任何兼容 MCP 的 AI(如 Claude、Cursor 或 Windsurf)预订、标记、追踪和取消皇家邮政 (Royal Mail) 和 Parcelforce 货件。
已针对实时 Click & Drop API(2026 年 4 月)进行验证。预订、追踪和取消功能已通过端到端测试。标签获取功能已根据 OBA 账户规范进行验证。
功能介绍
为任何支持 MCP 的 AI 提供六个工具:
工具 | 功能 |
| 在 Click & Drop 中创建订单。返回一个 |
| 一次性预订多个订单,并获取所有标签合并后的 PDF,可直接打印。 |
| 将邮寄标签保存为 PDF 到磁盘。需要 OBA 账户(见下文)。 |
| 获取当前状态、追踪号码和发货日期。 |
| 在订单清单生成前取消订单。不收取任何费用。 |
| 此 MCP 支持的所有皇家邮政和 Parcelforce 服务及其代码。 |
底层通过您的 Click & Drop API 密钥与 https://api.parcel.royalmail.com/api/v1 进行通信。
Related MCP server: UK Property Intelligence
提示词示例
一旦在您的 AI 客户端中安装了 MCP,您可以这样说:
“预订一份寄往 Alex Taylor 的一等信件,地址是 45 High Street, Manchester M1 1AA,重量 80 克。参考编号为 ORDER-1842。”
“通过 Tracked 48 发送这三个订单,并给我订单标识符。”(粘贴地址列表)
“预订一份下午 1 点前送达的 Special Delivery,保价 1000 英镑,寄往此地址,然后获取标签。”
“取消订单 1004。客户填错了邮编。”
“500 克包裹最便宜的签收服务是什么?”(AI 调用
list_services并进行推理)
“追踪订单 1002、1003 和 1004,并总结每个订单的状态。”
“这里有十个订单——全部通过 Royal Mail Tracked 24 预订,并给我一个可以打印的 PDF。”(AI 调用
book_batch_and_label并返回合并后的 PDF 路径。)
AI 负责处理地址解析、服务选择和错误恢复。您负责业务决策。
企业工作流建议
接入任何 AI 代理后,此 MCP 可以自动化实际的货运操作:
日常订单履行。 每天早上,您的 AI 从 Shopify、WooCommerce 或电子表格中读取新订单,通过皇家邮政以正确的服务级别预订每个订单,并将追踪号码回传给客户。
客户服务分流。 当客户询问“我的包裹在哪里?”时,您的 AI 调用
track_order,用通俗易懂的语言总结最新状态,并起草回复。退货处理。 客户申请退货。您的 AI 读取请求,预订正确的退货服务,并直接通过电子邮件发送可打印的标签,无需人工干预。
多承运商拣选。 与 apc-mcp 一起安装,您的 AI 可以在预订时比较皇家邮政和 APC,并为每个目的地选择最便宜或最快的选项。
批量履行日。 对于促销活动或订阅盒发货,给您的 AI 提供一个包含数百个订单的 CSV 文件。它可以在一次运行中以正确的服务和保价等级预订所有订单,然后为您提供摘要。
结账报价。 当客户在结账时询问运费时,您的 AI 会根据重量和邮编选择正确的服务,计算价格,并在几秒钟内响应。
兼容性
适用于任何支持 stdio 传输的 MCP 客户端:
Claude Desktop
Cursor
Windsurf
Claude Code
Zed
ChatGPT、Smithery 和其他仅限远程的 MCP 客户端需要 HTTP 传输,目前尚未包含。如果这对您很重要,请提交 issue 以便我优先处理。
安装
npm install -g royalmail-mcp或者在不安装的情况下运行:
npx royalmail-mcp配置
从 Click & Drop → Settings → API credentials 获取您的 API 密钥,然后设置:
RM_API_KEY=your-royal-mail-api-key
RM_BASE_URL=https://api.parcel.royalmail.com/api/v1可以在服务器旁边的 .env 文件中设置,也可以通过您的 MCP 客户端配置(见下文)设置。
Claude Desktop
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"royalmail": {
"command": "npx",
"args": ["-y", "royalmail-mcp"],
"env": {
"RM_API_KEY": "your-royal-mail-api-key"
}
}
}
}Cursor
添加到 ~/.cursor/mcp.json:
{
"mcpServers": {
"royalmail": {
"command": "npx",
"args": ["-y", "royalmail-mcp"],
"env": {
"RM_API_KEY": "your-royal-mail-api-key"
}
}
}
}支持的服务
键值 | 皇家邮政服务 | 代码 |
| 1st Class |
|
| Signed For 1st Class |
|
| 2nd Class |
|
| Tracked 24 |
|
| Tracked 48 |
|
| Special Delivery by 1pm (£750) |
|
| Special Delivery by 1pm (£1,000) |
|
| Special Delivery by 1pm (£2,500) |
|
| Parcelforce express24 |
|
| Parcelforce express48 |
|
| International Tracked |
|
另有 22 种服务,包括签收变体、年龄验证服务和 Parcelforce 国际服务。运行 list_services 获取完整列表。
您可以传递友好键值(如 first-class)或原始服务注册代码(如 OLP1)。两者均可使用。您的账户可以使用哪些服务取决于 Click & Drop → Settings → Shipping services 中启用的内容。
限制
标签需要 OBA 账户
get_label 仅适用于拥有皇家邮政 在线商业账户 (OBA)(即开票商业账户)的客户。标准即付即用 (Pay-as-you-go) 的 Click & Drop 账户在调用 get_label 时会收到 403 Forbidden (Feature not available) 错误。
预订、追踪和取消功能适用于所有账户类型。如果您没有 OBA,仍然可以通过此 MCP 自动化订单创建,然后手动在 Click & Drop UI 中打印标签。
在 auth.parcel.royalmail.com/register/oba 注册 OBA。
OBA 用户:启用自动应用邮资
如果您使用 OBA,请同时在 Click & Drop → Settings 中勾选 “Apply postage automatically on orders imported via API”。否则,订单将保持草稿状态,且 get_label 会返回 “Label generation only available for orders with postage applied status”。
安全性
您的 API 密钥拥有对 Click & Drop 账户的完全访问权限。请像对待密码一样对待它。
切勿将
.env提交到 git。本仓库的.gitignore已经排除了它。不要将密钥粘贴到聊天消息或共享文档中。
如果密钥泄露,请在 Click & Drop → Settings → API credentials 中进行轮换。
隐私与数据处理
此 MCP 完全在您的机器上运行。没有任何客户数据、凭据或 API 流量流经作者拥有或运营的任何服务器。
数据路径如下:
您提供给 AI 助手的货运详情会发送给您的 AI 提供商(例如,如果您使用 Claude,则发送给 Anthropic),并受您的账户管理。
预订请求使用您的 API 密钥发送给皇家邮政 Click & Drop。
标签保存到您的本地磁盘
~/Downloads/parcel-toolkit/(可通过PARCEL_TOOLKIT_LABELS_DIR环境变量覆盖)。
如果您在英国企业中使用此工具,您是英国 GDPR 下的数据控制者。实用建议:
使用 Claude Team、Claude Enterprise 或直接使用 Claude API(而非消费者版 Claude.ai),以确保与 Anthropic 签署了数据处理协议 (DPA)。在消费者版本中,请至少在隐私设置中关闭“帮助改进 Claude”。
在您的隐私政策中将 Anthropic 和皇家邮政列为子处理者,就像您列出支付提供商或电子邮件服务一样。
除非经过额外的法律审查,否则请避免将此工具用于特殊类别数据(健康、生物识别、儿童数据)。
本软件按“原样”提供,受 MIT 许可协议约束。作者不是数据处理者,不对您的合规义务承担任何责任——这些义务由您作为数据控制者承担。
贡献
欢迎在 github.com/catrinmdonnelly/royalmail-mcp 提交 issue 和 pull request。如果皇家邮政更改了其 API,或者您的账户类型遇到了边缘情况,请提交包含您发送的请求体和收到的响应的 issue(请先清除您的 API 密钥)。
配套 MCP
对于 APC Overnight,请参阅 apc-mcp。
免责声明
本项目不隶属于皇家邮政集团有限公司,也不受其认可或赞助。“Royal Mail”、“Parcelforce”和“Click & Drop”是其各自所有者的商标。使用风险自负。
许可
MIT。请参阅 LICENSE。
Available Tools
5 toolsbook_orderA
Book a Royal Mail shipment via Click & Drop. Returns an orderIdentifier used to retrieve the label.
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | Royal Mail / Parcelforce service. Defaults to first-class (OLP1) if omitted. Raw Service Register codes (e.g. OLP1, TOLP24, PFE48) are also accepted. | |
| packageFormat | No | Package format. Determines which services are available and pricing | small-parcel |
| weightGrams | Yes | Total weight in grams (e.g. 500 for 500g) | |
| recipient | Yes | Recipient / delivery address | |
| sender | No | Sender address. Omit to use the address saved in your Click & Drop account | |
| reference | No | Your internal order or job reference | |
| subtotal | No | Order subtotal in GBP (used for customs/insurance) | |
| shippingCost | No | Shipping cost charged to recipient in GBP | |
| total | No | Order total in GBP | |
| despatchDate | No | Planned despatch date YYYY-MM-DD. Omit if your account does not allow future-dated orders | |
| requireSignature | No | Request signature on delivery | |
| safePlace | No | Safe place instructions e.g. "leave in porch" | |
| notifyEmail | No | Email address for delivery notifications | |
| notifyPhone | No | Mobile number for SMS delivery notifications | |
| dimensions | No | Package dimensions in mm (optional) | |
| goodsDescription | No | Brief description of contents | |
| specialInstructions | No | Special handling instructions |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description indicates the tool returns an orderIdentifier, which is useful. However, since no annotations are provided, the description carries full burden for behavioral disclosure. It does not mention mutability, side effects, prerequisites (e.g., account setup), or error conditions. It is adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with 15 words, front-loading the key action and outcome. Every word serves a purpose. No filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (17 parameters, nested objects, no output schema), the description is concise but omits details like what happens on failure, pricing implications, or whether label retrieval is synchronous. However, the schema is well-documented, and the return value is stated. The description is nearly complete for the tool's core function.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, meaning all parameters include descriptions. The tool description itself does not repeat parameter details, but the schema already provides sufficient meaning. However, the description highlights the return value (orderIdentifier), which adds context beyond the schema. Given high schema coverage, baseline is 3, but the explicit mention of the return value and the tool's core action adds value, justifying a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to book a Royal Mail shipment via Click & Drop. It specifies the action (book), resource (shipment), and the system (Click & Drop), and mentions the return value (orderIdentifier). This distinguishes it from siblings like cancel_order, get_label, etc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use this tool versus alternatives like cancel_order or list_services. It implies usage for booking shipments, but no exclusions or alternatives are mentioned. The context of sibling tools is present, but the description lacks explicit usage instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
cancel_orderA
Cancel a Royal Mail Click & Drop order. Must be done before the order is manifested/despatched.
| Name | Required | Description | Default |
|---|---|---|---|
| orderIdentifier | Yes | The orderIdentifier to cancel |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full behavioral disclosure. It indicates a destructive action ('Cancel') but does not clarify if the cancellation is reversible, what happens to associated labels, or whether special permissions are needed. The description adds minimal behavioral context beyond the name.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with zero waste. The first sentence states the core action, and the second provides a critical constraint. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (single param, no output schema, no annotations), the description is mostly adequate but lacks any mention of return values, error conditions, or side effects. It does not specify what happens on success or failure, which would help the agent handle responses.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single required parameter 'orderIdentifier', and the schema description is self-explanatory ('The orderIdentifier to cancel'). The description adds no additional parameter meaning, so a baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Cancel', the resource 'Royal Mail Click & Drop order', and the critical precondition 'Must be done before the order is manifested/despatched', making the purpose unambiguous and distinct from siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states a timing constraint ('before order is manifested/despatched') and implies this tool is for cancellation only. However, it does not mention what to do if the order is already manifested or suggest alternative tools like track_order for status checking.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_labelA
Get the shipping label for a Royal Mail Click & Drop order. Returns base64-encoded PDF label.
| Name | Required | Description | Default |
|---|---|---|---|
| orderIdentifier | Yes | The orderIdentifier returned when booking the order |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. It reveals that the output is base64-encoded PDF, which is helpful. However, it does not mention any side effects, authentication needs, or whether it is a read-only operation (likely read-only but not explicit).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loads the core purpose, and includes a key detail about the return format. No extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple retrieval tool with one parameter and no output schema, the description covers the essential purpose and output format. It could mention that the label is for printing or include a link to orderIdentifier documentation, but overall it is complete enough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes the single parameter with high coverage (100%), and the description mentions it ('orderIdentifier returned when booking the order'). This adds context by linking the parameter to a previous step, which is useful but not transformative given schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get'), the resource ('shipping label'), and the context ('Royal Mail Click & Drop order'). It also specifies the return format ('base64-encoded PDF label'), which adds precision. This distinguishes it from siblings like book_order or cancel_order.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieving a label after booking, but does not explicitly state when to use it versus alternatives. It mentions the input parameter ('orderIdentifier') but does not provide guidance on prerequisites or conditions for use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_servicesA
List supported Royal Mail and Parcelforce services with their Service Register codes. Availability depends on your Click & Drop account.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Discloses that the list may vary by account, which is a key behavioral trait (dynamic response based on account), and implies a read-only operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first states purpose and output, second adds important caveat. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero parameters and no output schema, the description is sufficient to understand what the tool does and its constraints. Could optionally mention return format (e.g., list of objects) but not essential.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has no parameters (0 params) and schema description coverage is 100%, so no additional param info needed. Description adds value by stating the output will include Service Register codes and account dependency.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it lists supported Royal Mail and Parcelforce services with Service Register codes, differentiating it from sibling tools like book_order or cancel_order by focusing on service listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Mentions availability depends on Click & Drop account, implying account setup prerequisite, but no explicit when-to-use or comparison with siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
track_orderA
Get the current status and tracking details for a Royal Mail Click & Drop order.
| Name | Required | Description | Default |
|---|---|---|---|
| orderIdentifier | Yes | The orderIdentifier returned when booking the order |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states the tool is read-only (Get) and focuses on status/tracking, which is appropriate. However, it does not disclose any behavioral traits like data freshness, rate limits, or potential errors. With no annotations, a 3 is reasonable but could be improved.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no waste. It front-loads the purpose and is appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one required parameter and no output schema, the description is largely complete. It explains the tool's purpose and expected input. Minor gap: it could mention that the output contains tracking details, but this is implied.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a single parameter 'orderIdentifier' already described in schema. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Get'), clearly identifies the resource ('current status and tracking details'), and specifies the domain ('Royal Mail Click & Drop order'). It distinguishes the tool from siblings like book_order or cancel_order.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool (after booking an order, to check status/tracking), but does not explicitly state when not to use it or mention alternatives. Since there is no sibling with similar purpose, no explicit exclusion is needed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
book_order - First observed
cancel_order - First observed
get_label - First observed
list_services - First observed
track_order
TDQS
Scored across 5 tools
Each tool targets a distinct operation (booking, canceling, label retrieval, service listing, tracking) with no overlapping purposes. The descriptions clearly differentiate their roles.
Tools follow a consistent verb_noun pattern (book_order, cancel_order, get_label, list_services, track_order). 'get_label' uses 'get' while others use verbs like 'book' and 'cancel', but the pattern is clear and predictable.
With 5 tools covering the essential operations for Royal Mail shipments (create, cancel, label, tracking, service discovery), the count is well-scoped and appropriate for the server's purpose.
The set covers the core lifecycle of an order (create, cancel, label retrieval, tracking). Missing features like updating an order or manifesting are minor gaps that can be worked around, as most workflows are supported.
Maintenance
Related MCP Connectors
Furgonetka MCP Server is an extension for LLMs (such as Claude) that integrates AI assistants with Poland's most popular courier brokerage platform. The server enables models to interact directly with services from various couriers (including InPost, DPD, DHL, UPS, and Poczta Polska) through a single, unified interface. With this integration, your AI stops just "writing about logistics" and starts actually managing it.
MCP server for EasyPost — rate shipments, buy & refund labels, track packages, verify addresses.
Multi-carrier shipping for AI agents: compare rates, buy labels, track packages, validate addresses
Physical mail API for AI agents. Send letters, certified mail. Sandbox + live keys via MCP.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for APC Overnight. Book, label, track and cancel UK parcel shipments from any MCP-compatible AI.610 npm2MIT
- AlicenseNot gradedqualityCmaintenanceUK property data MCP server for AI hosts (Claude, ChatGPT). Wraps Land Registry, Rightmove, EPC, rental yields, stamp duty, and Companies House into 13 tools.2MIT
- AlicenseBqualityDmaintenanceAn MCP server that wraps the ShipSaving logistics REST API, enabling AI assistants like Claude to perform shipping operations through natural language.3034 npmMIT
- AlicenseAqualityDmaintenanceMCP server for tracking Japanese logistics carriers (Yamato, Sagawa, Japan Post) via mock or AfterShip adapter. Enables AI agents to query shipment status and history in natural language.3MIT