add mcp servers (#2076)

This commit is contained in:
澄潭
2025-04-16 14:48:53 +08:00
committed by GitHub
parent 4f0834d817
commit 8cce7f5d50
150 changed files with 34544 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
# Document Conversion
The APP Code required for API authentication can be applied for on the Alibaba Cloud API Marketplace: https://market.aliyun.com/apimarket/detail/cmapi00067671
# MCP Server Configuration Documentation
## Overview
This MCP server is primarily used to provide file format conversion services, supporting the conversion of PDF files into Word, PPT, or Excel formats, as well as converting common office document formats such as Word, Excel, PPT, and txt into PDF. Additionally, it provides a feature to query the results of file conversions, allowing users to track the status of their requests. With these tools, users can easily convert between different document types and add watermarks as needed to protect the content of documents.
## Tool Introduction
### PDF to Document
This tool allows users to convert PDF files into various Microsoft Office document formats, including but not limited to Word (.docx, .doc), PowerPoint (.pptx, .ppt), and Excel (.xlsx, .xls) files. It is ideal for situations where information needs to be extracted from a fixed-layout PDF and edited.
- **callBackUrl**: The callback URL for receiving notifications upon completion of the conversion.
- **fileUrl**: The URL link to the PDF file to be converted; there are certain limitations on file size and number of pages.
- **type**: Specifies the target output file format.
### Document to PDF
With this feature, users can create PDF versions from Word, Excel, PPT, and even plain text files. This is very useful for scenarios where cross-platform compatibility or enhanced security is desired. In addition to basic conversion capabilities, it also supports adding custom text or image watermarks to the generated PDF.
- **callBackUrl**: The notification address for receiving updates on the conversion status.
- **fileUrl**: The source file link that needs to be converted to PDF; different types of files have different maximum size limits.
- **watermarkColor**, **watermarkFontName**, **watermarkFontSize**, **watermarkImage**, **watermarkLocation**, **watermarkRotation**, **watermarkText**, **watermarkTransparency**: These parameters collectively define how the watermark effect will be displayed in the final PDF document.
### Document Conversion Result Query
After a conversion task is submitted, it may take some time to complete. This API allows users to check the status of a specific conversion request, thereby understanding whether the conversion was successful and obtaining any download links for the generated files.
- **convertTaskId**: The task identifier returned from a previously initiated conversion request, used to track the processing progress.
All of the above tools are invoked via POST requests and require setting the appropriate content type header (Content-Type: application/x-www-form-urlencoded) and authorization information (Authorization: APPCODE [appCode]) to access the relevant service endpoints on the Alibaba Cloud Marketplace. Each response includes information about the success or failure of the operation, and if applicable, provides a direct link to the converted file.

View File

@@ -0,0 +1,39 @@
# 文档转换
API认证需要的APP Code请在阿里云API市场申请: https://market.aliyun.com/apimarket/detail/cmapi00067671
## 什么是云市场API MCP服务
阿里云云市场是生态伙伴的交易服务平台我们致力于为合作伙伴提供覆盖上云、商业化和售卖的全链路服务帮助客户高效获取、部署和管理优质生态产品。云市场的API服务涵盖以下几个类目应用开发、身份验证与金融、车辆交通与物流、企业服务、短信与运营商、AI应用与OCR、生活服务。
云市场API依托Higress提供MCP服务您只需在云市场完成订阅并获取AppCode通过Higress MCP Server进行配置即可无缝集成云市场API服务。
## 如何在使用云市场API MCP服务
1. 进入API详情页订阅该API。您可以优先使用免费试用。
2. 前往云市场用户控制台使用阿里云账号登陆后查看已订阅API服务的AppCode并配置到Higress MCP Server的配置中。注意在阿里云市场订阅API服务后您将获得AppCode。对于您订阅的所有API服务此AppCode是相同的您只需使用这一个AppCode即可访问所有已订阅的API服务。
3. 云市场用户控制台会实时展示已订阅的预付费API服务的可用额度如您免费试用额度已用完您可以选择重新订阅。
# MCP服务器配置文档
## 功能简介
该MCP服务器主要用于提供文件格式转换服务支持将PDF文件转换为Word、PPT或Excel格式以及将Word、Excel、PPT和txt等常见办公文档格式转换成PDF。此外还提供了查询文件转换结果的功能以便用户能够跟踪其请求的状态。通过这些工具用户可以轻松地在不同文档类型之间进行转换并且可以根据需要添加水印以保护文档内容。
## 工具简介
### PDF转文档
此工具允许用户将PDF文件转换成多种Microsoft Office文档格式包括但不限于Word (.docx, .doc), PowerPoint (.pptx, .ppt) 和 Excel (.xlsx, .xls) 文件。它非常适合那些需要从固定布局的PDF中提取信息并编辑的情况。
- **callBackUrl**: 用于接收转换完成后通知的回调地址。
- **fileUrl**: 指向待转换PDF文件的URL链接对文件大小及页数有一定限制。
- **type**: 指定目标输出文件格式。
### 文档转PDF
利用此功能用户可以从Word、Excel、PPT甚至纯文本文件创建PDF版本。这对于希望确保跨平台兼容性或增加安全性的场景非常有用。除了基本的转换能力外还支持添加自定义文字或图片水印到生成的PDF中。
- **callBackUrl**: 接收转换状态更新的通知地址。
- **fileUrl**: 需要被转换成PDF的源文件链接不同类型文件有不同的最大尺寸限制。
- **watermarkColor**, **watermarkFontName**, **watermarkFontSize**, **watermarkImage**, **watermarkLocation**, **watermarkRotation**, **watermarkText**, **watermarkTransparency**: 这些参数共同定义了如何在最终PDF文档中显示水印效果。
### 文档转换结果查询
当一个转换任务提交后可能需要一段时间才能完成。此API允许用户检查特定转换请求的状态从而了解转换是否成功以及获取任何已生成文件的下载链接。
- **convertTaskId**: 之前发起的转换请求所返回的任务标识符,用于追踪处理进度。
以上工具均通过POST请求调用并要求设置适当的内容类型头部(Content-Type: application/x-www-form-urlencoded)及授权信息(Authorization: APPCODE [appCode])来访问阿里云市场上的相关服务端点。每个响应都包含有关操作成功与否的信息,以及如果适用的话,还会提供转换后文件的直接链接。

View File

@@ -0,0 +1,242 @@
{
"info": {
"description": "【Word文档转PDF PDF转Word等文档】接口可实现PDF与Word\\PPT\\Excel\\TXT等文档的互相转换支持设置水印等功能。 —— 我们只做精品!",
"title": "【聚美智数】PDF转Word\\PPT\\Excel\\TXT-Word文档转PDF-文档转换-文档格式转换-文件格式转换",
"version": "1.0.0"
},
"openapi": "3.0.1",
"paths": {
"/file-convert/word2pdf": {
"post": {
"operationId": "文档转PDF",
"summary": "文件转PDF",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"watermarkImage": {
"description": "水印图片base64或图片url若需要在转换后的pdf加上图片水印传入该参数即可",
"type": "string"
},
"watermarkFontName": {
"description": "文字水印字体,直接传字体的中文名称。支持:宋体、黑体、微软雅黑。默认: 黑体",
"type": "string"
},
"callBackUrl": {
"description": "接入商接收文件转换结果的接口地址,聚美智数通过该地址,将信息推送给接入商,详见:推送说明",
"type": "string"
},
"watermarkTransparency": {
"description": "透明度默认0.4",
"type": "number"
},
"fileUrl": {
"description": "可外网下载的文件URL地址支持Word、Excel、PPT和txtWord和Excel最大支持10MPPT最大支持80M, txt最大支持2M",
"type": "string"
},
"watermarkFontSize": {
"description": "文字水印大小默认20",
"type": "integer"
},
"watermarkRotation": {
"description": "内容旋转角度默认0",
"type": "integer"
},
"watermarkText": {
"description": "水印文字若需要在转换后的pdf加上文字水印传入该参数即可",
"type": "string"
},
"watermarkColor": {
"description": "文字水印颜色16进制值默认#666666",
"type": "string"
},
"watermarkLocation": {
"description": "位置默认LAY。LAY - 3 * 3 平铺TOP_LEFT - 顶部居左TOP_CENTER - 顶部居中TOP_RIGHT - 顶部局右CENTER_LEFT - 中部居左CENTER - 居中CENTER_RIGHT - 中部局右BOTTOM_LEFT - 底部居左BOTTOM_CENTER - 底部居中BOTTOM_RIGHT - 底部局右",
"type": "string"
}
},
"required": [
"fileUrl"
]
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"description": "返回码"
},
"msg": {
"type": "string",
"description": "返回信息"
},
"taskNo": {
"type": "string",
"description": "本次请求号"
},
"data": {
"type": "object",
"properties": {
"convertTaskId": {
"type": "string",
"description": "转换任务Id"
}
}
}
}
}
}
},
"description": "成功响应"
}
}
}
},
"/file-convert/pdf2word": {
"post": {
"operationId": "PDF转文档",
"summary": "将PDF转换为Word、PPT、Excel",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"callBackUrl": {
"description": "接入商接收文件转换结果的接口地址,聚美智数通过该地址,将信息推送给接入商,详见:推送说明",
"type": "string"
},
"fileUrl": {
"description": "可外网下载的文件URL地址支持Word、PPT、ExcelPDF文件最大支持30M页数限制在80页之内",
"type": "string"
},
"type": {
"description": "转换为目标文档扩展名可选值docx, doc, pptx, ppt, xlsx, xls",
"type": "string"
}
},
"required": [
"fileUrl",
"type"
]
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"description": "状态码"
},
"msg": {
"type": "string",
"description": "消息"
},
"taskNo": {
"type": "string",
"description": "任务编号"
},
"data": {
"type": "object",
"properties": {
"convertTaskId": {
"type": "string",
"description": "转换任务Id"
}
}
}
}
}
}
},
"description": "成功响应"
}
}
}
},
"/file-convert/result": {
"post": {
"operationId": "文档转换结果查询",
"summary": "文件转换结果查询",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"convertTaskId": {
"description": "转换任务ID",
"type": "string"
}
},
"required": [
"convertTaskId"
]
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 200
},
"msg": {
"type": "string",
"example": "成功"
},
"taskNo": {
"type": "string",
"example": 41020892700032660000
},
"data": {
"type": "object",
"properties": {
"urls": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
},
"description": "成功响应"
}
}
}
}
},
"servers": [
{
"url": "https://jmwjzhwjzh.market.alicloudapi.com"
}
]
}

View File

@@ -0,0 +1,168 @@
server:
name: document-conversion
config:
appCode: ""
tools:
- name: pdf-to-doc
description: 将PDF转换为Word、PPT、Excel
args:
- name: callBackUrl
description: 接入商接收文件转换结果的接口地址,聚美智数通过该地址,将信息推送给接入商,详见:推送说明
type: string
position: body
- name: fileUrl
description: 可外网下载的文件URL地址支持Word、PPT、ExcelPDF文件最大支持30M页数限制在80页之内
type: string
required: true
position: body
- name: type
description: 转换为目标文档扩展名可选值docx, doc, pptx, ppt, xlsx, xls
type: string
required: true
position: body
requestTemplate:
url: https://jmwjzhwjzh.market.alicloudapi.com/file-convert/pdf2word
method: POST
headers:
- key: Content-Type
value: application/x-www-form-urlencoded
- key: Authorization
value: APPCODE {{.config.appCode}}
- key: X-Ca-Nonce
value: '{{uuidv4}}'
responseTemplate:
prependBody: |+
# API Response Information
Below is the response from an API call. To help you understand the data, I've provided:
1. A detailed description of all fields in the response structure
2. The complete API response
## Response Structure
> Content-Type: application/json
- **code**: 状态码 (Type: integer)
- **data**: (Type: object)
- **data.convertTaskId**: 转换任务Id (Type: string)
- **msg**: 消息 (Type: string)
- **taskNo**: 任务编号 (Type: string)
## Original Response
- name: doc-to-pdf
description: 文件转PDF
args:
- name: callBackUrl
description: 接入商接收文件转换结果的接口地址,聚美智数通过该地址,将信息推送给接入商,详见:推送说明
type: string
position: body
- name: fileUrl
description: 可外网下载的文件URL地址支持Word、Excel、PPT和txtWord和Excel最大支持10MPPT最大支持80M, txt最大支持2M
type: string
required: true
position: body
- name: watermarkColor
description: 文字水印颜色16进制值默认#666666
type: string
position: body
- name: watermarkFontName
description: 文字水印字体,直接传字体的中文名称。支持:宋体、黑体、微软雅黑。默认: 黑体
type: string
position: body
- name: watermarkFontSize
description: 文字水印大小默认20
type: integer
position: body
- name: watermarkImage
description: 水印图片base64或图片url若需要在转换后的pdf加上图片水印传入该参数即可
type: string
position: body
- name: watermarkLocation
description: 位置默认LAY。LAY - 3 * 3 平铺TOP_LEFT - 顶部居左TOP_CENTER - 顶部居中TOP_RIGHT - 顶部局右CENTER_LEFT - 中部居左CENTER - 居中CENTER_RIGHT - 中部局右BOTTOM_LEFT - 底部居左BOTTOM_CENTER - 底部居中BOTTOM_RIGHT - 底部局右
type: string
position: body
- name: watermarkRotation
description: 内容旋转角度默认0
type: integer
position: body
- name: watermarkText
description: 水印文字若需要在转换后的pdf加上文字水印传入该参数即可
type: string
position: body
- name: watermarkTransparency
description: 透明度默认0.4
type: number
position: body
requestTemplate:
url: https://jmwjzhwjzh.market.alicloudapi.com/file-convert/word2pdf
method: POST
headers:
- key: Content-Type
value: application/x-www-form-urlencoded
- key: Authorization
value: APPCODE {{.config.appCode}}
- key: X-Ca-Nonce
value: '{{uuidv4}}'
responseTemplate:
prependBody: |+
# API Response Information
Below is the response from an API call. To help you understand the data, I've provided:
1. A detailed description of all fields in the response structure
2. The complete API response
## Response Structure
> Content-Type: application/json
- **code**: 返回码 (Type: integer)
- **data**: (Type: object)
- **data.convertTaskId**: 转换任务Id (Type: string)
- **msg**: 返回信息 (Type: string)
- **taskNo**: 本次请求号 (Type: string)
## Original Response
- name: doc-convert-result-query
description: 文件转换结果查询
args:
- name: convertTaskId
description: 转换任务ID
type: string
required: true
position: body
requestTemplate:
url: https://jmwjzhwjzh.market.alicloudapi.com/file-convert/result
method: POST
headers:
- key: Content-Type
value: application/x-www-form-urlencoded
- key: Authorization
value: APPCODE {{.config.appCode}}
- key: X-Ca-Nonce
value: '{{uuidv4}}'
responseTemplate:
prependBody: |+
# API Response Information
Below is the response from an API call. To help you understand the data, I've provided:
1. A detailed description of all fields in the response structure
2. The complete API response
## Response Structure
> Content-Type: application/json
- **code**: (Type: integer)
- **data**: (Type: object)
- **data.urls**: (Type: array)
- **data.urls[]**: Items of type string
- **msg**: (Type: string)
- **taskNo**: (Type: string)
## Original Response