接口说明
通过 MCP API 你可以查询归类实例、税号编码、统一搜索结果和编码详情。下方提供快速开始与接口级说明。
接入说明
- 基础地址按站点域名拼接,所有请求使用 HTTPS。
- 地址完整性示例:
https://www.hsciq.com/mcp/tools/list(正确),不要写成https://www.hsciq.com/MCP/mcp/tools/list。 - 接口统一返回 JSON,成功结构为
{ "ok": true, "toolName": "...", "data": ... }。 - 分页类工具统一返回
pageIndex/pageSize/totalPageCount/totalItemCount/isPreviousPage/isNextPage/items。
鉴权方式
X-API-Key: your_api_key
ClawHub 技能安装
- 技能页面:
https://clawhub.com/skills/hsciq-mcp
方式 1:命令行安装
clawhub install hsciq-mcp
方式 2:网页安装
访问技能页点击 Install。
GET /mcp
返回服务元信息和工具入口地址。
{
"name": "HSCIQ2 MCP",
"version": "1.0",
"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" }
]
}
POST /mcp/tools/call(search_instance / search_code / search_unified)
前三个工具都通过该入口调用,返回统一分页结构。
curl -X POST "https://www.hsciq.com/mcp/tools/call" ^
-H "Content-Type: application/json" ^
-H "X-API-Key: your_api_key" ^
-d "{
""toolName"": ""search_code"",
""arguments"": {
""keywords"": ""塑料软管"",
""country"": ""CN"",
""pageIndex"": 1,
""pageSize"": 10,
""filterFailureCode"": true
}
}"
- 分页外层字段:
pageIndex、pageSize、totalPageCount、totalItemCount、isPreviousPage、isNextPage、items。 items类型:search_instance → InstanceSearchResult[],search_code → CNCode[]/JPCode[]/USCode[],search_unified → CIQ[]/HazardousChemicals[]/PortSearchResult[]。
POST /mcp/tools/call(get_code_detail)
按国家+编码返回非分页详情对象。
{
"toolName": "get_code_detail",
"arguments": {
"country": "CN",
"code": "3926909090"
}
}
详细返回字段见下方
get_code_detail 接口章节。search_instance 参数与返回值说明
keywords 为商品名称关键词,如"自行车"、"塑料软管"、"手机壳"等具体商品名,不要使用描述性长句或短语。items 类型:
InstanceSearchResult[]| 字段 | 类型 | 说明 |
|---|---|---|
pageIndex | int | 当前页 |
pageSize | int | 每页条数 |
totalPageCount | int | 总页数 |
totalItemCount | int | 总条数 |
isPreviousPage | bool | 是否有上一页 |
isNextPage | bool | 是否有下一页 |
items[].InstanceName | string | 实例名(高亮版本) |
items[].InstanceNamePlain | string | 实例名纯文本 |
items[].Count | int | 关联条数 |
items[].IndexDocumentId | string | 索引文档ID |
items[].IndexTokens | string[] | 检索分词 |
items[].IndexInstanceNameTokens | string[] | 实例名分词 |
items[].IndexInstanceNameAsciiTokens | string[] | 实例名ASCII分词 |
items[].IndexCategoryNameTokens | string[] | 类目分词 |
items[].Index2CodeNameTokens | string[] | 2位类目分词 |
items[].Index4CodeNameTokens | string[] | 4位类目分词 |
items[].Index6CodeNameTokens | string[] | 6位类目分词 |
items[].MatchRank | double | 匹配排序得分 |
items[].ShortNamePenalty | double | 短词惩罚项 |
items[].ChineseHitPenalty | double | 中文命中惩罚项 |
items[].PrimaryHitPenalty | double | 主命中惩罚项 |
items[].MissingTokens | int | 未命中词数 |
items[].MissingRatio | double | 未命中比例 |
items[].MatchedTokens | int | 命中词数 |
items[].OrderPenalty | double | 顺序惩罚 |
items[].SpanLen | int | 跨度长度 |
items[].FirstPos | int | 首命中位置 |
items[].NameLength | int | 名称长度 |
items[].MaxScore | double | 最大原始分值 |
items[].CategoryResults | array | 类目树结果 |
search_code 返回参数字段说明
items 类型:
CNCode[] / JPCode[] / USCode[]分页外层字段
| 字段 | 类型 | 说明 |
|---|---|---|
pageIndex | int | 当前页 |
pageSize | int | 每页条数 |
totalPageCount | int | 总页数 |
totalItemCount | int | 总条数 |
isPreviousPage | bool | 是否有上一页 |
isNextPage | bool | 是否有下一页 |
items | array | 结果列表,具体项类型取决于 country |
公共字段(CN/JP/US)
| 字段 | 类型 | 说明 |
|---|---|---|
Status | int | 状态值 |
CreateTime | datetime? | 创建时间 |
UpdateTime | datetime? | 更新时间 |
Unit1 | string? | 法定第一计量单位 |
Unit2 | string? | 法定第二计量单位 |
UnitofMeasure | string? | 计量单位描述 |
Code | string | 海关编码 |
Name | string | 编码名称 |
CategoryId | string? | 类目ID |
CategoryName | string? | 类目名称 |
_2Code | string | 2位编码 |
_2CodeName | string | 2位编码名称 |
_4Code | string | 4位编码 |
_4CodeName | string | 4位编码名称 |
_6Code | string | 6位编码 |
_6CodeName | string | 6位编码名称 |
CNCode 扩展字段
| 字段 | 类型 | 说明 |
|---|---|---|
OldData | object | 中国税则原始对象 |
Import | string? | 进口税率摘要 |
Export | string? | 出口税率摘要 |
RCEP | string? | RCEP税率摘要 |
CT | string? | 协定税率摘要 |
ExportRebateCode | string? | 出口退税码 |
Remark | string? | 备注 |
Tokens | string[] | 检索分词 |
DocumentId | string | 索引文档ID |
JPCode 扩展字段
| 字段 | 类型 | 说明 |
|---|---|---|
General | string? | 一般税率 |
Temporary | string? | 暂定税率 |
WTO | string? | WTO税率 |
GSP | string? | 普惠税率 |
LDC | string? | 最不发达国家税率 |
Asean | string? | 东盟税率 |
Singapore | string? | 新加坡税率 |
Mexico | string? | 墨西哥税率 |
Malaysia | string? | 马来西亚税率 |
Chile | string? | 智利税率 |
Thailand | string? | 泰国税率 |
Indonesia | string? | 印尼税率 |
Brunei | string? | 文莱税率 |
Philippines | string? | 菲律宾税率 |
Switzerland | string? | 瑞士税率 |
Vietnam | string? | 越南税率 |
India | string? | 印度税率 |
Peru | string? | 秘鲁税率 |
Australia | string? | 澳大利亚税率 |
Mongolia | string? | 蒙古税率 |
CPTPP | string? | CPTPP税率 |
EU | string? | 欧盟税率 |
UK | string? | 英国税率 |
US | string? | 美国税率 |
RCEP_China | string? | RCEP中国税率 |
RCEP_Korea | string? | RCEP韩国税率 |
RCEP_Australia | string? | RCEP澳洲税率 |
Law | string? | 法律备注 |
Tokens | string[] | 检索分词 |
DocumentId | string | 索引文档ID |
USCode 扩展字段
| 字段 | 类型 | 说明 |
|---|---|---|
Indent | string? | 层级缩进标记 |
GeneralRateofDuty | string? | 一般税率 |
SpecialRateofDuty | string? | 特别税率 |
Column2RateofDuty | string? | 第二栏税率 |
QuotaQuantity | string? | 配额数量 |
AdditionalDuties | string? | 附加税说明 |
Tokens | string[] | 检索分词 |
DocumentId | string | 索引文档ID |
search_unified 返回参数字段说明
items 类型:
CIQ[] / HazardousChemicals[] / PortSearchResult[]分页外层字段
| 字段 | 类型 | 说明 |
|---|---|---|
pageIndex | int | 当前页 |
pageSize | int | 每页条数 |
totalPageCount | int | 总页数 |
totalItemCount | int | 总条数 |
isPreviousPage | bool | 是否有上一页 |
isNextPage | bool | 是否有下一页 |
items | array | 结果列表,具体项类型取决于 unifiedType |
当 unifiedType=ciq(CIQ)
| 字段 | 类型 | 说明 |
|---|---|---|
Status | int | 状态值 |
CreateTime | datetime? | 创建时间 |
UpdateTime | datetime? | 更新时间 |
Code | string | 海关编码 |
Id | string | CIQ项目编号 |
Name | string | CIQ项目名称 |
Number | string | 监管条件编号 |
Tokens | string[] | 检索分词 |
DocumentId | string | 索引文档ID |
当 unifiedType=hazardous(HazardousChemicals)
| 字段 | 类型 | 说明 |
|---|---|---|
Id | int | 危化品主键 |
Name | string | 危化品名称 |
Alias | string? | 别名 |
CAS | string? | CAS号 |
HSCode | string? | 关联HS编码 |
Remarks | string? | 备注 |
CreateTime | datetime | 创建时间 |
Tokens | string[] | 检索分词 |
DocumentId | string | 索引文档ID |
当 unifiedType=port(PortSearchResult)
| 字段 | 类型 | 说明 |
|---|---|---|
Id | int | 港口主键 |
Code | string | 港口代码(高亮版本) |
CodePlain | string | 港口代码纯文本 |
CName | string | 中文名(高亮版本) |
CNamePlain | string | 中文名纯文本 |
EName | string | 英文名(高亮版本) |
ENamePlain | string | 英文名纯文本 |
Country | object? | 国家对象,含 Id/Name |
ShippingLine | object? | 航线对象,含 Id/Name |
get_code_detail 返回参数字段说明
返回对象类型:
MCPCodeDetailResult(非分页)顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
Country | string | 国家:CN / JP / US |
Code | string | 海关编码 |
Name | string | 编码名称 |
Status | int | 状态值 |
UpdateTime | datetime? | 更新时间 |
Unit1 | string? | 法定第一计量单位 |
Unit2 | string? | 法定第二计量单位 |
UnitOfMeasure | string? | 计量单位描述 |
Remark | string? | 备注 |
Taxes | Dictionary<string,string> | 税率键值映射 |
Extensions | object | 分国家扩展对象 |
Taxes 常见键
| 国家 | 键名示例 | 说明 |
|---|---|---|
| CN | mfnImportRate、generalImportRate、vatRate、exportTaxRebateRate | 中国税率键 |
| JP | general、temporary、wto、rcepChina | 日本税率键 |
| US | generalRateOfDuty、specialRateOfDuty、column2RateOfDuty | 美国税率键 |
Extensions.Cn
| 字段 | 类型 | 说明 |
|---|---|---|
Reporting | array | 申报要素列表(MCPCodeItem) |
Regulatory | Dictionary<string,string> | 监管条件映射 |
Inspect | Dictionary<string,string> | 检验检疫映射 |
RegulatoryCodes | array | 禁限管制识别码列表(MCPRegulatoryCodeItem) |
Ciqs | array | CIQ列表(MCPCodeItem) |
HSMap | array | 税号注释映射(MCPCodeItem) |
ExportRebateCodes | array | 出口退税码列表(MCPExportRebateCodeItem) |
Ct | Dictionary<string,string> | 协定税率映射 |
Rcep | Dictionary<string,string> | RCEP税率映射 |
Extensions.Jp
| 字段 | 类型 | 说明 |
|---|---|---|
AgreementRates | Dictionary<string,string> | 日本协定税率映射 |
Extensions.Us
| 字段 | 类型 | 说明 |
|---|---|---|
QuotaQuantity | string? | 配额数量 |
AdditionalDuties | string? | 附加税说明 |
明细对象
| 对象 | 字段 | 说明 |
|---|---|---|
MCPCodeItem | Key | 键值(代码/序号) |
MCPCodeItem | Value | 显示文本 |
MCPCodeItem | IsRequired | 是否必填 |
MCPRegulatoryCodeItem | Code | 禁限管制识别码 |
MCPRegulatoryCodeItem | Name | 管制名称 |
MCPRegulatoryCodeItem | Mofcomcode | 商务部代码 |
MCPRegulatoryCodeItem | Iemark | 进出口标记 |
MCPRegulatoryCodeItem | Reportingcategorycode | 申报类别代码 |
MCPRegulatoryCodeItem | ReportingElements | 申报要素列表(MCPReportingElementItem) |
MCPReportingElementItem | Elementname | 要素名称 |
MCPReportingElementItem | Elementorder | 排序 |
MCPExportRebateCodeItem | Id | 退税扩展码 |
MCPExportRebateCodeItem | Name | 退税名称 |
MCPExportRebateCodeItem | Rate | 退税率 |
create_guilei_form 参数与返回值说明
创建 HS 归类咨询单,AI 可直接提交产品信息和图片(base64 编码)。每人每天有独立配额限制。
请求示例
curl -X POST "https://www.hsciq.com/mcp/tools/call" ^
-H "Content-Type: application/json" ^
-H "X-API-Key: your_api_key" ^
-d "{
""toolName"": ""create_guilei_form"",
""arguments"": {
""productNameCn"": ""智能手机壳"",
""productNameEn"": ""Smartphone Case"",
""uses"": ""手机保护套"",
""ingredients"": ""硅胶"",
""brand"": ""某品牌"",
""model"": ""X1"",
""images"": [
{
""fileName"": ""front.jpg"",
""data"": ""base64编码的图片数据""
}
]
}
}"
输入参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
productNameCn | string | 是 | 产品中文名称 |
productNameEn | string? | 否 | 产品英文名称 |
uses | string? | 否 | 产品用途 |
ingredients | string? | 否 | 产品成分/材质 |
cas | string? | 否 | CAS 号 |
brand | string? | 否 | 品牌 |
model | string? | 否 | 型号 |
otherProductInfo | string? | 否 | 其他产品信息 |
qq | string? | 否 | QQ 联系方式 |
weixin | string? | 否 | 微信联系方式 |
isPaid | bool? | 否 | 是否付费咨询 |
images | array? | 否 | 图片列表,每项含 fileName(文件名)和 data(base64 数据) |
图片限制:最多 3 张,每张 ≤ 1MB,支持 JPG / PNG / GIF / WebP 格式(通过文件头魔数校验,不依赖扩展名)。
成功返回示例
{
"ok": true,
"toolName": "create_guilei_form",
"data": {
"formId": "a1b2c3d4-...",
"status": "已创建",
"imageCount": 1,
"imageUrls": [ "https://www.hsciq.com/uploads/guilei/..." ]
}
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
formId | string | 创建的归类咨询单 GUID |
status | string | 创建状态:已创建 |
imageCount | int | 成功上传的图片数量 |
imageUrls | string[] | 图片的公开访问 URL 列表 |
get_guilei_form 参数与返回值说明
获取归类咨询单详情,包含所有字段的讨论对话、归类结论等信息。AI 可借此获知专家在哪个字段上提出了问题。
请求示例
curl -X POST "https://www.hsciq.com/mcp/tools/call" ^
-H "Content-Type: application/json" ^
-H "X-API-Key: your_api_key" ^
-d "{
""toolName"": ""get_guilei_form"",
""arguments"": {
""formId"": ""a1b2c3d4-...""
}
}"
输入参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
formId | string | 是 | 归类咨询单 GUID |
返回值说明
返回
GuiLeiFormDetail 对象,包含以下顶层字段:| 字段 | 类型 | 说明 |
|---|---|---|
form | object | 归类单基本信息(产品名称、用途、成分、品牌、型号、状态等) |
acl | array | 访问控制列表 |
dialogs | array | 字段讨论对话列表,每项含 fieldKey(字段名)、messages(消息列表) |
shares | array | 分享链接列表 |
finalization | object? | 归类结论(含 confirmedCode 和 classificationReason) |
finalizationHistory | array | 归类结论修改历史 |
Dialogs 消息结构
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 对话 ID |
fieldKey | string | 关联的字段名(如 ProductNameCn、Ingredients) |
messages[].senderId | string | 消息发送者 ID |
messages[].content | string | 消息内容 |
messages[].createTime | datetime | 消息时间 |
messages[].messageType | int? | 消息类型 |
list_my_guilei_forms 参数与返回值说明
分页列出当前 API Key 所属用户的所有归类咨询单。
请求示例
curl -X POST "https://www.hsciq.com/mcp/tools/call" ^
-H "Content-Type: application/json" ^
-H "X-API-Key: your_api_key" ^
-d "{
""toolName"": ""list_my_guilei_forms"",
""arguments"": {
""pageIndex"": 1,
""pageSize"": 20
}
}"
输入参数
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
pageIndex | int? | 否 | 1 | 页码 |
pageSize | int? | 否 | 20 | 每页条数,最大 100 |
成功返回示例
{
"ok": true,
"toolName": "list_my_guilei_forms",
"data": {
"items": [
{
"id": "a1b2c3d4-...",
"productNameCn": "智能手机壳",
"status": 1,
"isFinalized": false,
"createTime": "2026-05-08T10:30:00"
}
],
"pageIndex": 1,
"pageSize": 20,
"totalItemCount": 3,
"totalPageCount": 1
}
}
add_guilei_dialog_message 参数与返回值说明
在归类咨询单的某个字段上创建新对话,或回复已有的对话。AI 可用此工具代表用户回复专家的提问。
请求示例(创建新对话)
curl -X POST "https://www.hsciq.com/mcp/tools/call" ^
-H "Content-Type: application/json" ^
-H "X-API-Key: your_api_key" ^
-d "{
""toolName"": ""add_guilei_dialog_message"",
""arguments"": {
""formId"": ""a1b2c3d4-..."",
""fieldKey"": ""Ingredients"",
""content"": ""主要成分是聚乙烯,不含阻燃剂""
}
}"
请求示例(回复已有对话)
{
"toolName": "add_guilei_dialog_message",
"arguments": {
"formId": "a1b2c3d4-...",
"fieldKey": "Ingredients",
"content": "已确认,确实不含阻燃剂",
"dialogId": "d5e6f7a8-..."
}
}
输入参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
formId | string | 是 | 归类咨询单 GUID |
fieldKey | string | 是 | 字段名(如 ProductNameCn、Uses、Ingredients、Cas、Brand、Model、OtherProductInfo 等) |
content | string | 是 | 消息内容 |
dialogId | string? | 否 | 如提供则回复已有对话;否则创建新对话 |
messageType | int? | 否 | 消息类型,透传至后台 |
成功返回示例
{
"ok": true,
"toolName": "add_guilei_dialog_message",
"data": {
"dialogId": "d5e6f7a8-...",
"messageId": "b9c0d1e2-...",
"action": "reply"
}
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
dialogId | string | 对话 ID |
messageId | string | 消息 ID |
action | string | 操作类型:created(新建对话)或 reply(回复已有对话) |
错误码说明
| HTTP | error | 含义 |
|---|---|---|
| 401 | missing_api_key | 未提供 API key |
| 401 | invalid_api_key | API key 无效 |
| 401 | api_key_expired | API key 已过期 |
| 401 | api_key_revoked | API key 已撤销 |
| 400 | invalid_params | 参数不合法(如 productNameCn 为空、图片格式不支持等) |
| 400 | forbidden_keyword | 关键词触发拦截 |
| 400 | unknown_tool | 工具名称不支持 |
| 429 | daily_quota_exceeded | 每日总调用次数已达上限 |
| 429 | daily_guilei_quota_exceeded | 每日创建归类咨询次数已达上限(默认5次) |
| 500 | internal_error | 服务器内部错误 |