接口说明

通过 MCP API 你可以查询归类实例、税号编码、统一搜索结果和编码详情。下方提供快速开始与接口级说明。

标准 MCP 端点(推荐)

  • 端点地址:POST https://www.hsciq.com/mcp/rpc,遵循标准 Model Context Protocol(Streamable HTTP,Stateless,JSON-RPC 2.0)。
  • 鉴权方式与 REST 端点相同:X-API-Key 请求头,或 Authorization: Bearer <key>
  • 提供与 REST 端点完全相同的 9 个工具(search_instance / search_code / search_unified / get_code_detail / create_guilei_form / get_guilei_form / list_my_guilei_forms / add_guilei_dialog_message / list_guilei_categories),参数与返回结构一致。
  • 错误语义差异:REST 端点超限/失败返回 HTTP 429/400;标准 MCP 端点按协议返回 HTTP 200,结果中 isError=true,错误文本以错误码开头(如 daily_quota_exceeded: 每日调用次数已达上限(150次))。
  • 下方 REST 端点继续可用;新接入建议使用标准 MCP 端点。
客户端配置示例(Claude Code / Cursor 等 mcp.json)
{
  "mcpServers": {
    "hsciq": {
      "type": "http",
      "url": "https://www.hsciq.com/mcp/rpc",
      "headers": { "X-API-Key": "your_api_key" }
    }
  }
}
curl 调用示例(Stateless 模式无需握手,逐条独立 POST)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}"
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"search_code\",\"arguments\":{\"keywords\":\"自行车\",\"country\":\"CN\"}}}"

接入说明

  • 本站提供两种接入方式:标准 MCP 端点 POST /mcp/rpc(推荐),以及旧版 REST 端点(已废弃,仅兼容存量调用,见页面底部)。
  • 基础地址按站点域名拼接,所有请求使用 HTTPS。
  • 地址完整性示例:https://www.hsciq.com/mcp/rpc(正确),不要写成 https://www.hsciq.com/MCP/mcp/rpc
  • 两种方式提供的 9 个工具完全相同,工具参数与返回结构一致(见下方"工具说明")。
  • 分页类工具统一返回 pageIndex/pageSize/totalPageCount/totalItemCount/isPreviousPage/isNextPage/items

鉴权方式

X-API-Key: your_api_key

ClawHub 技能安装

  • 技能页面:https://clawhub.ai/toucao/skills/hsciq-mcp
方式 1:命令行安装
openclaw skills install @toucao/hsciq-mcp
方式 2:网页安装
访问技能页点击 Install。

本地 CLI(stdio)安装

  • 适用场景:AI 客户端仅支持 stdio 本地进程接入时,使用本 CLI 作为本地桥接(内部仍走上方 /mcp/rpc 端点,认证与配额完全一致)。客户端支持 HTTP 直连时建议直接使用标准端点。
  • 下载地址、配置示例与安装说明已迁移至独立页面:CLI 下载

search_instance 参数与返回值说明

keywords 为商品名称关键词,如"自行车"、"塑料软管"、"手机壳"等具体商品名,不要使用描述性长句或短语。items 类型:MCPInstanceItem[](轻量模型,检索分词与排序打分等内部字段不下发)
字段类型说明
pageIndexint当前页
pageSizeint每页条数
totalPageCountint总页数
totalItemCountint总条数
isPreviousPagebool是否有上一页
isNextPagebool是否有下一页
items[].instanceNamestring实例名(纯文本)
items[].instanceEnNamestring?实例英文名
items[].countint关联编码数
items[].codesarray关联 HS 编码列表(原类目树扁平化去重,最多 10 个)
items[].codes[].codestringHS 编码
items[].codes[].namestring编码名称

search_code 返回参数字段说明

items 类型:MCPCodeSearchItem[](轻量模型,CN/JP/US 三国统一;完整税率表与协定税率请用 get_code_detail 获取)
分页外层字段
字段类型说明
pageIndexint当前页
pageSizeint每页条数
totalPageCountint总页数
totalItemCountint总条数
isPreviousPagebool是否有上一页
isNextPagebool是否有下一页
itemsarray结果列表,具体项类型取决于 country
items 字段(CN/JP/US 通用)
字段类型说明
codestring海关编码
namestring商品名称
unit1string?法定第一计量单位
unit2string?法定第二计量单位
categoryNamestring?部类名称
twoCodestring?章(2位编码)
twoCodeNamestring?章名称
fourCodestring?品目(4位编码)
fourCodeNamestring?品目名称
sixCodestring?子目(6位编码)
sixCodeNamestring?子目名称
taxesobject?关键税率字典(键按国别,见下表;无税率的键不出现)
statusint状态:1=有效 2=删除 3=停用
createTimedatetime编码创建时间
updateTimedatetime编码更新时间
taxes 键说明(按 country)
country说明
CNpreferentialImport最惠国税率
vat增值税率
exportTaxRebates出口退税税率
consumption消费税率
USgeneralRateOfDuty一般税率
specialRateOfDuty特别税率
column2RateOfDuty第二栏税率
JPgeneral基本税率
temporary暂定税率
wtoWTO 协定税率
gsp特惠税率

search_unified 返回参数字段说明

items 类型:MCPCiqItem[] / MCPHazardousItem[] / MCPPortItem[](轻量模型,检索分词等内部字段不下发)
分页外层字段
字段类型说明
pageIndexint当前页
pageSizeint每页条数
totalPageCountint总页数
totalItemCountint总条数
isPreviousPagebool是否有上一页
isNextPagebool是否有下一页
itemsarray结果列表,具体项类型取决于 unifiedType
当 unifiedType=ciq(MCPCiqItem)
字段类型说明
codestringCIQ 代码
namestringCIQ 名称
numberstring?监管条件编号
当 unifiedType=hazardous(MCPHazardousItem)
字段类型说明
namestring危化品名称
aliasstring?别名
casstring?CAS 号
hsCodestring?对应 HS 编码
remarksstring?备注
当 unifiedType=port(MCPPortItem)
字段类型说明
codestring港口代码(纯文本)
cNamestring?港口中文名(纯文本)
eNamestring?港口英文名(纯文本)
countryNamestring?所属国家名
shippingLineNamestring?航线名

get_code_detail 参数与返回字段说明

请求参数
参数类型说明
codestring海关编码,需为完整申报编码(纯数字):CN 10 位、US 10 位 HTS、JP 9 位;可带点分隔符(如 8471.30.0000),服务端自动去除。位数不足或超长会返回错误并在错误消息中提示处理方式;不确定完整编码时请先用 search_code 按商品名称检索
countrystring国家代码:CN / US / JP(默认 CN)
返回对象类型:MCPCodeDetailResult(非分页)
顶层字段
字段类型说明
Countrystring国家:CN / JP / US
Codestring海关编码
Namestring编码名称
Statusint状态值
UpdateTimedatetime?更新时间
Unit1string?法定第一计量单位
Unit2string?法定第二计量单位
UnitOfMeasurestring?计量单位描述
Remarkstring?备注
TaxesDictionary<string,string>税率键值映射
Extensionsobject分国家扩展对象
Taxes 常见键
国家键名示例说明
CNmfnImportRategeneralImportRatevatRateexportTaxRebateRatespecialGoodsMark中国税率键
JPgeneraltemporarywtorcepChina日本税率键
USgeneralRateOfDutyspecialRateOfDutycolumn2RateOfDuty美国税率键
Extensions.Cn
字段类型说明
Reportingarray申报要素列表(MCPCodeItem)
RegulatoryDictionary<string,string>监管条件映射
InspectDictionary<string,string>检验检疫映射
RegulatoryCodesarray禁限管制识别码列表(MCPRegulatoryCodeItem)
CiqsarrayCIQ列表(MCPCodeItem)
HSMaparray税号注释映射(MCPCodeItem)
ExportRebateCodesarray出口退税码列表(MCPExportRebateCodeItem)
CtDictionary<string,string>协定税率映射
RcepDictionary<string,string>RCEP税率映射
Extensions.Jp
字段类型说明
AgreementRatesDictionary<string,string>日本协定税率映射
Extensions.Us
字段类型说明
QuotaQuantitystring?配额数量
AdditionalDutiesstring?附加税说明
明细对象
对象字段说明
MCPCodeItemKey键值(代码/序号)
MCPCodeItemValue显示文本
MCPCodeItemIsRequired是否必填
MCPRegulatoryCodeItemCode禁限管制识别码
MCPRegulatoryCodeItemName管制名称
MCPRegulatoryCodeItemMofcomcode商务部代码
MCPRegulatoryCodeItemIemark进出口标记
MCPRegulatoryCodeItemReportingcategorycode申报类别代码
MCPRegulatoryCodeItemReportingElements申报要素列表(MCPReportingElementItem)
MCPReportingElementItemElementname要素名称
MCPReportingElementItemElementorder排序
MCPExportRebateCodeItemId退税扩展码
MCPExportRebateCodeItemName退税名称
MCPExportRebateCodeItemRate退税率

create_guilei_form 参数与返回值说明

创建 HS 归类咨询单,AI 可直接提交产品信息和图片(base64 编码)。每人每天有独立配额限制。
请求示例(标准 MCP 端点)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{
    ""jsonrpc"": ""2.0"",
    ""id"": 1,
    ""method"": ""tools/call"",
    ""params"": {
      ""name"": ""create_guilei_form"",
      ""arguments"": {
        ""productNameCn"": ""智能手机壳"",
        ""productNameEn"": ""Smartphone Case"",
        ""uses"": ""手机保护套"",
        ""ingredients"": ""硅胶"",
        ""brand"": ""某品牌"",
        ""model"": ""X1"",
        ""images"": [
          {
            ""fileName"": ""front.jpg"",
            ""data"": ""base64编码的图片数据""
          }
        ]
      }
    }
  }"
输入参数
字段类型必填说明
productNameCnstring产品中文名称
productNameEnstring?产品英文名称
categoryIdint?行业分类 ID,通过 list_guilei_categories 获取可用列表
usesstring?产品用途
ingredientsstring?产品成分/材质
casstring?CAS 号
brandstring?品牌
modelstring?型号
otherProductInfostring?其他产品信息
qqstring?QQ 联系方式
weixinstring?微信联系方式
processingMethodstring?加工方法
dimensionsstring?尺寸
applicableGenderstring?适用性别
workingPrinciplestring?工作原理
functionstring?功能
weavingProcessstring?织造工艺
materialstring?材质
gramWeightstring?克重
widthstring?宽度
endTimestring?截止时间(ISO 8601 格式)
isPaidbool?是否付费咨询
imagesarray?图片列表(至少1张),每项含 fileName(文件名)和 data(base64 数据)
图片限制:至少 1 张,最多 3 张,每张 ≤ 1MB,支持 JPG / PNG / GIF / WebP 格式(通过文件头魔数校验,不依赖扩展名)。
成功返回示例
以下为工具返回的数据部分:标准 MCP 端点位于 result.structuredContent,旧版 REST 端点位于 data
{
  "formId": "a1b2c3d4-...",
  "url": "https://www.hsciq.com/GuiLei/a1b2c3d4-...",
  "status": "已创建",
  "imageCount": 1,
  "imageUrls": [ "https://www.hsciq.com/uploads/guilei/..." ]
}
返回字段说明
字段类型说明
formIdstring创建的归类咨询单 GUID
urlstring咨询单的完整访问链接
statusstring创建状态:已创建
imageCountint成功上传的图片数量
imageUrlsstring[]图片的公开访问 URL 列表

get_guilei_form 参数与返回值说明

获取归类咨询单详情,包含所有字段的讨论对话、归类结论等信息。AI 可借此获知专家在哪个字段上提出了问题。
请求示例(标准 MCP 端点)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{
    ""jsonrpc"": ""2.0"",
    ""id"": 1,
    ""method"": ""tools/call"",
    ""params"": {
      ""name"": ""get_guilei_form"",
      ""arguments"": {
        ""formId"": ""a1b2c3d4-...""
      }
    }
  }"
输入参数
字段类型必填说明
formIdstring归类咨询单 GUID
返回值说明
返回 GuiLeiFormDetail 对象,包含以下顶层字段:
字段类型说明
formobject归类单基本信息,核心字段见下表
aclarray访问控制列表
dialogsarray字段讨论对话列表,每项含 fieldKey(字段名)、messages(消息列表)
sharesarray分享链接列表
finalizationobject?归类结论(含 confirmedCodeclassificationReason
finalizationHistoryarray归类结论修改历史
Dialogs 消息结构
字段类型说明
idstring对话 ID
fieldKeystring关联的字段名(如 ProductNameCn、Ingredients)
messages[].senderIdstring消息发送者 ID
messages[].contentstring消息内容
messages[].createTimedatetime消息时间
messages[].messageTypeint?消息类型
form 核心字段
字段类型说明
idstring表单 GUID
statusint状态:0=已关闭,1=进行中
productNameCnstring?产品中文名称
productNameEnstring?产品英文名称
categoryIdint?行业分类 ID
categoryNamestring?行业分类名称
usesstring?用途
ingredientsstring?成分/材质
casstring?CAS 号
brandstring?品牌
modelstring?型号
isPaidbool是否付费咨询
isFinalizedbool是否已出归类结论
confirmedCodestring?最终确认的 HS 编码
isUnclassifiablebool是否无法归类
sourcestring?来源(mcp 表示通过 API 创建)
createTimedatetime创建时间
updateTimedatetime更新时间

list_my_guilei_forms 参数与返回值说明

分页列出当前 API Key 所属用户的所有归类咨询单。
请求示例(标准 MCP 端点)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{
    ""jsonrpc"": ""2.0"",
    ""id"": 1,
    ""method"": ""tools/call"",
    ""params"": {
      ""name"": ""list_my_guilei_forms"",
      ""arguments"": {
        ""pageIndex"": 1,
        ""pageSize"": 10
      }
    }
  }"
输入参数
字段类型必填默认说明
pageIndexint?1页码
pageSizeint?10每页条数,最大 100
成功返回示例
以下为工具返回的数据部分:标准 MCP 端点位于 result.structuredContent,旧版 REST 端点位于 data
{
  "items": [
    {
      "id": "a1b2c3d4-...",
      "productNameCn": "智能手机壳",
      "status": 1,
      "isFinalized": false,
      "createTime": "2026-05-08T10:30:00"
    }
  ],
  "pageIndex": 1,
  "pageSize": 10,
  "totalItemCount": 3,
  "totalPageCount": 1
}
返回字段说明
字段类型说明
itemsarray表单列表,每项为 GuiLeiForm 对象
pageIndexint当前页码
pageSizeint每页条数
totalItemCountint总条数
totalPageCountint总页数
items 中每个对象的字段参见上方 get_guilei_form 的「form 核心字段」表。

add_guilei_dialog_message 参数与返回值说明

在归类咨询单的某个字段上创建新对话,或回复已有的对话。AI 可用此工具代表用户回复专家的提问。
请求示例(创建新对话,标准 MCP 端点)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{
    ""jsonrpc"": ""2.0"",
    ""id"": 1,
    ""method"": ""tools/call"",
    ""params"": {
      ""name"": ""add_guilei_dialog_message"",
      ""arguments"": {
        ""formId"": ""a1b2c3d4-..."",
        ""fieldKey"": ""Ingredients"",
        ""content"": ""主要成分是聚乙烯,不含阻燃剂""
      }
    }
  }"
请求示例(回复已有对话,仅示 arguments 部分)
"arguments": {
  "formId": "a1b2c3d4-...",
  "fieldKey": "Ingredients",
  "content": "已确认,确实不含阻燃剂",
  "dialogId": "d5e6f7a8-..."
}
输入参数
字段类型必填说明
formIdstring归类咨询单 GUID
fieldKeystring字段名(如 ProductNameCn、Uses、Ingredients、Cas、Brand、Model、OtherProductInfo 等)
contentstring消息内容
dialogIdstring?如提供则回复已有对话;否则创建新对话
messageTypeint?消息类型,透传至后台
成功返回示例
以下为工具返回的数据部分:标准 MCP 端点位于 result.structuredContent,旧版 REST 端点位于 data
{
  "dialogId": "d5e6f7a8-...",
  "messageId": "b9c0d1e2-...",
  "action": "reply"
}
返回字段说明
字段类型说明
dialogIdstring对话 ID
messageIdstring消息 ID
actionstring操作类型:created(新建对话)或 reply(回复已有对话)

list_guilei_categories 参数与返回值说明

获取可用的行业分类列表,用于创建归类咨询单时选择 categoryId
请求示例(标准 MCP 端点)
curl -X POST "https://www.hsciq.com/mcp/rpc" ^
  -H "Content-Type: application/json" ^
  -H "Accept: application/json, text/event-stream" ^
  -H "X-API-Key: your_api_key" ^
  -d "{
    ""jsonrpc"": ""2.0"",
    ""id"": 1,
    ""method"": ""tools/call"",
    ""params"": {
      ""name"": ""list_guilei_categories"",
      ""arguments"": {}
    }
  }"
无需输入参数。
成功返回示例
以下为工具返回的数据部分:标准 MCP 端点位于 result.structuredContent,旧版 REST 端点位于 data
[
  { "id": 1, "name": "活动物;动物产品" },
  { "id": 2, "name": "植物产品" },
  { "id": 3, "name": "动、植物油脂" }
]
返回字段说明
字段类型说明
idint行业分类 ID,用于 create_guilei_formcategoryId 参数
namestring行业分类名称

错误码说明

401 类错误两个端点相同(HTTP 401)。400/429/500 类在旧版 REST 端点按下表 HTTP 状态码返回;在标准 MCP 端点按协议返回 HTTP 200,结果中 isError=true,错误文本以错误码开头(如 daily_quota_exceeded: 每日调用次数已达上限(150次))。
HTTP error 含义
401missing_api_key未提供 API key
401invalid_api_keyAPI key 无效
401api_key_expiredAPI key 已过期
401api_key_revokedAPI key 已撤销
400invalid_params参数不合法(如 productNameCn 为空、图片格式不支持等)
400forbidden_keyword关键词触发拦截
400unknown_tool工具名称不支持
429daily_quota_exceeded每日总调用次数已达上限
429daily_guilei_quota_exceeded每日创建归类咨询次数已达上限(默认5次)
500internal_error服务器内部错误

GET /mcp 已废弃

返回服务元信息和工具入口地址。REST 接口统一返回 JSON,成功结构为 { "ok": true, "toolName": "...", "data": ... }
{
  "name": "HSCIQ2 MCP",
  "version": "1.0",
  "standardMCPEndpoint": "/mcp/rpc",
  "toolsEndpoint": "/mcp/tools/list",
  "callEndpoint": "/mcp/tools/call"
}

POST /mcp/tools/list 已废弃

返回可用工具与输入参数定义。
curl -X POST "https://www.hsciq.com/mcp/tools/list" ^
  -H "Content-Type: application/json" ^
  -H "X-API-Key: your_api_key"
{
  "version": "1.0",
  "tools": [
    { "name": "search_instance" },
    { "name": "search_code" },
    { "name": "search_unified" },
    { "name": "get_code_detail" },
    { "name": "create_guilei_form" },
    { "name": "get_guilei_form" },
    { "name": "list_my_guilei_forms" },
    { "name": "add_guilei_dialog_message" },
    { "name": "list_guilei_categories" }
  ]
}

POST /mcp/tools/call(get_code_detail) 已废弃

按国家+编码返回非分页详情对象。
{
  "toolName": "get_code_detail",
  "arguments": {
    "country": "CN",
    "code": "3926909090"
  }
}
详细返回字段见上方 get_code_detail 工具章节。