UA

ups-api/ups-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

31 stars 12 forks 质量 68 趋势 11MIT

用于UPS API的MCP服务器

概览

一台用于UPS运输和物流能力的模型上下文协议(MCP)服务器。该服务器使AI系统能够无缝集成UPS API工具。 用户可以与MCP服务器集成,使AI代理能够代表他们进行事件跟踪,包括跟踪货物状态、最新过境界面以及预计送达日期和时间。代理将通过用户在UPS开发者门户创建应用后提供的OAuth客户端凭证进行认证。 - 获取客户端ID和客户端密钥:在UPS开发者门户创建应用程序以获取你的OAuth凭证——客户端ID和客户端密钥。(https://developer.ups.com/get-started?loc=en_US) - Python 3.12及以上版本 - 安装uv(Python软件包) - - UPS客户端ID - - UPS客户端秘密 - - 是指向测试(CIE)还是生产(接受的值:测试,生产) :你的API凭证很敏感。不要提交给版本控制。

概述(AI 翻译)

一台用于UPS运输和物流能力的模型上下文协议(MCP)服务器。该服务器使AI系统能够无缝集成UPS API工具。

用户可以与MCP服务器集成,使AI代理能够代表他们进行事件跟踪,包括跟踪货物状态、最新过境界面以及预计送达日期和时间。代理将通过用户在UPS开发者门户创建应用后提供的OAuth客户端凭证进行认证。

用途

先决条件

  • 获取客户端ID和客户端秘密:在UPS开发者门户创建应用程序以获取你的OAuth凭证——客户ID和客户端秘密。(https://developer.ups.com/get-started?loc=en_US)
  • Python 3.12 或更高版本
  • 安装 uv(Python 包)

环境变量

  • UPS客户ID
  • UPS客户秘密
  • 是指向测试(CIE)还是生产(接受值:测试,生产)

注意:您的API凭证很敏感。请勿提交给版本控制。我们建议使用GitHub Secrets、保险库或密码管理器安全管理秘密。

处决

你可以用 UVX 运行这个软件包:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

UPS MCP Server

A Model Context Protocol (MCP) server for UPS shipping and logistics capabilities. This server enables AI systems to seamlessly integrate with UPS API tools.

Users can integrate with the MCP server to allow AI agents to facilitate tracking events on their behalf, including tracking the status of a shipment, the latest transit screen, and expected delivery date and time. Agents will be authenticated using OAuth client credentials provided by the user after application creation on the UPS Developer Portal.

Usage

Prerequisites

  • Obtain a Client ID and Client Secret: Create an application on the UPS Developer Portal to obtain your OAuth credentials – Client ID and Client Secret. (https://developer.ups.com/get-started?loc=en_US)
  • Python 3.12 or higher
  • Install uv (Python Package)

Environment Variables

  • CLIENT_ID - UPS Client ID
  • CLIENT_SECRET - UPS Client Secret
  • ENVIRONMENT - Whether to point to Test (CIE) or Production (Accepted values: test, production)

Note: Your API credentials are sensitive. Do not commit them to version control. We recommend managing secrets securely using GitHub Secrets, a vault, or a password manager.

Execution

You can run the package using uvx:

uvx --from git+https://github.com/UPS-API/ups-mcp ups-mcp

To use an older version, you can specify the version number like so:

uvx --from git+https://github.com/UPS-API/[email protected] ups-mcp

Here are sample config files for popular integrations. Different MCP Clients may require modification.

Claude Desktop

{
  "mcpServers": {
    "ups-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/UPS-API/ups-mcp", "ups-mcp"],
      "env": {
        "CLIENT_ID": "**********",
        "CLIENT_SECRET": "**********",
        "ENVIRONMENT": "test"
      }
    }
  }
}

GitHub Copilot in VS Code

{
  "servers": {
    "ups-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/UPS-API/ups-mcp", "ups-mcp"],
      "env": {
        "CLIENT_ID": "**********",
        "CLIENT_SECRET": "**********",
        "ENVIRONMENT": "test"
      }
    }
  }
}

Available Tools

  • track_package: Track a package using the UPS Tracking API

    Args:

    • inquiryNumber (str): the unique package identifier. Each inquiry number must be between 7 and 34 characters in length. Required.
    • locale (str): Language and country code of the user, separated by an underscore. Default value is ‘en_US’. Not required.
    • returnSignature (bool): a boolean to indicate whether a signature is required, default is false. Not required.
    • returnMilestones (bool): a boolean to indicate whether detailed information on a package’s movements is required, default is false. Not required
在 GitHub 查看完整 README

安装

uvx --from git+https://github.com/UPS-API/ups-mcp ups-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "ups-mcp": { "type": "stdio", "command": "uvx", "args": ["--from", "git+https://github.com/UPS-API/ups-mcp", "ups-mcp"], "env": { "CLIENT_ID": "**********", "CLIENT_SECRET": "**********", "ENVIRONMENT": "test" } } } }