- 文件分析
- 知识库管理
- 工作流
- MCP管理
- 数据库开发
- mineruPOST
MCP服务器工具的添加
开发中
开发环境
http://172.29.50.10:2333
开发环境
http://172.29.50.10:2333
POST
http://172.29.50.10:5004/server/tool/add
请求参数
Body 参数application/json
add_data
string
新增的工具openapi数据
data
string
openapi文档
user_id
string
用户id
config
string
config配置文件
示例
{
"user_id": "001",
"data": "openapi: 3.1.0\ninfo:\n title: Example API\n version: 1.0.0\n description: API示例文档\nservers:\n - url: https://api.example.com/v1\n description: 生产环境\npaths:\n /users:\n post:\n summary: 创建用户\n operationId: createUser\n tags: [Users]\n parameters:\n - name: X-Request-ID\n in: header\n description: 请求唯一ID\n required: true\n schema:\n type: string\n format: uuid\n - name: Authorization\n in: header\n description: Bearer token\n required: true\n schema:\n type: string\n example: Bearer <token>\n requestBody:\n description: 用户数据\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n basicUser:\n summary: 基础用户示例\n value:\n name: \"John Doe\"\n email: \"john@example.com\"\n responses:\n '201':\n description: 用户创建成功\n headers:\n Location:\n description: 新用户资源URL\n schema:\n type: string\n format: uri\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/UserResponse\"\n '400':\n description: 无效请求\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/Error\"\n security:\n - BearerAuth: []\ncomponents:\n schemas:\n User:\n type: object\n required: [name, email]\n properties:\n name:\n type: string\n email:\n type: string\n format: email\n UserResponse:\n type: object\n properties:\n id:\n type: string\n createdAt:\n type: string\n format: date-time\n Error:\n type: object\n properties:\n code:\n type: integer\n message:\n type: string\n securitySchemes:\n BearerAuth:\n type: http\n scheme: bearer\n bearerFormat: JWT\n examples:\n InvalidEmail:\n value:\n code: 400\n message: \"邮箱格式无效\"",
"config":{ "transport": "streamable-http",
"url": "http://127.0.0.1:58922/mcp"},
"add_data":"openapi: 3.1.0\ninfo:\n title: Example API\n version: 1.0.0\n description: API示例文档\nservers:\n - url: https://api.example.com/v1\n description: 生产环境\npaths:\n /users:\n post:\n summary: 创建用户\n operationId: createUser2\n tags: [Users]\n parameters:\n - name: X-Request-ID\n in: header\n description: 请求唯一ID\n required: true\n schema:\n type: string\n format: uuid\n - name: Authorization\n in: header\n description: Bearer token\n required: true\n schema:\n type: string\n example: Bearer <token>\n requestBody:\n description: 用户数据\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n basicUser:\n summary: 基础用户示例\n value:\n name: \"John Doe\"\n email: \"john@example.com\"\n responses:\n '201':\n description: 用户创建成功\n headers:\n Location:\n description: 新用户资源URL\n schema:\n type: string\n format: uri\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/UserResponse\"\n '400':\n description: 无效请求\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/Error\"\n security:\n - BearerAuth: []\ncomponents:\n schemas:\n User:\n type: object\n required: [name, email]\n properties:\n name:\n type: string\n email:\n type: string\n format: email\n UserResponse:\n type: object\n properties:\n id:\n type: string\n createdAt:\n type: string\n format: date-time\n Error:\n type: object\n properties:\n code:\n type: integer\n message:\n type: string\n securitySchemes:\n BearerAuth:\n type: http\n scheme: bearer\n bearerFormat: JWT\n examples:\n InvalidEmail:\n value:\n code: 400\n message: \"邮箱格式无效\""
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://172.29.50.10:5004/server/tool/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"user_id": "001",
"data": "openapi: 3.1.0\ninfo:\n title: Example API\n version: 1.0.0\n description: API示例文档\nservers:\n - url: https://api.example.com/v1\n description: 生产环境\npaths:\n /users:\n post:\n summary: 创建用户\n operationId: createUser\n tags: [Users]\n parameters:\n - name: X-Request-ID\n in: header\n description: 请求唯一ID\n required: true\n schema:\n type: string\n format: uuid\n - name: Authorization\n in: header\n description: Bearer token\n required: true\n schema:\n type: string\n example: Bearer <token>\n requestBody:\n description: 用户数据\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n basicUser:\n summary: 基础用户示例\n value:\n name: \"John Doe\"\n email: \"john@example.com\"\n responses:\n '\''201'\'':\n description: 用户创建成功\n headers:\n Location:\n description: 新用户资源URL\n schema:\n type: string\n format: uri\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/UserResponse\"\n '\''400'\'':\n description: 无效请求\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/Error\"\n security:\n - BearerAuth: []\ncomponents:\n schemas:\n User:\n type: object\n required: [name, email]\n properties:\n name:\n type: string\n email:\n type: string\n format: email\n UserResponse:\n type: object\n properties:\n id:\n type: string\n createdAt:\n type: string\n format: date-time\n Error:\n type: object\n properties:\n code:\n type: integer\n message:\n type: string\n securitySchemes:\n BearerAuth:\n type: http\n scheme: bearer\n bearerFormat: JWT\n examples:\n InvalidEmail:\n value:\n code: 400\n message: \"邮箱格式无效\"",
"config":{ "transport": "streamable-http",
"url": "http://127.0.0.1:58922/mcp"},
"add_data":"openapi: 3.1.0\ninfo:\n title: Example API\n version: 1.0.0\n description: API示例文档\nservers:\n - url: https://api.example.com/v1\n description: 生产环境\npaths:\n /users:\n post:\n summary: 创建用户\n operationId: createUser2\n tags: [Users]\n parameters:\n - name: X-Request-ID\n in: header\n description: 请求唯一ID\n required: true\n schema:\n type: string\n format: uuid\n - name: Authorization\n in: header\n description: Bearer token\n required: true\n schema:\n type: string\n example: Bearer <token>\n requestBody:\n description: 用户数据\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n basicUser:\n summary: 基础用户示例\n value:\n name: \"John Doe\"\n email: \"john@example.com\"\n responses:\n '\''201'\'':\n description: 用户创建成功\n headers:\n Location:\n description: 新用户资源URL\n schema:\n type: string\n format: uri\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/UserResponse\"\n '\''400'\'':\n description: 无效请求\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/Error\"\n security:\n - BearerAuth: []\ncomponents:\n schemas:\n User:\n type: object\n required: [name, email]\n properties:\n name:\n type: string\n email:\n type: string\n format: email\n UserResponse:\n type: object\n properties:\n id:\n type: string\n createdAt:\n type: string\n format: date-time\n Error:\n type: object\n properties:\n code:\n type: integer\n message:\n type: string\n securitySchemes:\n BearerAuth:\n type: http\n scheme: bearer\n bearerFormat: JWT\n examples:\n InvalidEmail:\n value:\n code: 400\n message: \"邮箱格式无效\""
}'
返回响应
🟢200成功
application/json
Body
status
string
状态
示例
{
"message": "工具已添加",
"status": "success"
}
修改于 2025-06-18 03:41:49