mirror of
https://github.com/alibaba/higress.git
synced 2026-06-10 05:07:30 +08:00
add mcp servers (#2076)
This commit is contained in:
29
plugins/wasm-go/mcp-servers/mcp-ip-query/README.md
Normal file
29
plugins/wasm-go/mcp-servers/mcp-ip-query/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# IP location query
|
||||
|
||||
The APP Code required for API authentication can be applied for on the Alibaba Cloud API Marketplace: https://market.aliyun.com/apimarket/detail/cmapi00054907
|
||||
|
||||
# MCP Server Configuration Function Overview
|
||||
|
||||
## Function Overview
|
||||
|
||||
This service can analyze the user's location based on their IP address. It can automatically obtain the IP without requiring the user to actively provide it (based on the API gateway's capabilities). The location information can also be used to determine the user's timezone, allowing for the provision of accurate local time based on their location.
|
||||
|
||||
## Tool Introduction
|
||||
|
||||
### Enhanced IP Address Query
|
||||
|
||||
- **Purpose**: This tool allows users to input an IP address (supports IPv6) and then returns the corresponding detailed location information.
|
||||
- **Use Cases**: Suitable for application development that requires precise geographic positioning of visitors or clients, such as online advertising placement and content localization services.
|
||||
- **Request Parameters**:
|
||||
- `ip` (required): The IP address to be queried.
|
||||
- **Response Structure**: Returns data in JSON format, containing the status code of the query result, specific geographical information (e.g., city name, district code), status message, and the task ID of this request.
|
||||
- **Notes**: In addition to basic location information, it also includes latitude and longitude coordinates.
|
||||
|
||||
### Precise IP Address Query
|
||||
|
||||
- **Purpose**: Compared to the previous version, this tool provides more dimensional information along with basic geographical details, such as the operator's name, time zone, and does not return latitude and longitude data for IPv4 addresses.
|
||||
- **Use Cases**: Suitable for services that not only care about where the visitor is from but also need to understand the characteristics of their network environment, such as cybersecurity monitoring systems or the design of globally distributed applications.
|
||||
- **Request Parameters**:
|
||||
- `ip` (required): The IP address to be queried.
|
||||
- **Response Structure**: Also presented in JSON format, the content is rich and diverse, covering everything from continent to postal code, and also retains the task identifier for tracking.
|
||||
- **Features**: Enhances the comprehensiveness of the information, especially with the different handling methods for IPv4 and IPv6, making it a more flexible choice.
|
||||
40
plugins/wasm-go/mcp-servers/mcp-ip-query/README_ZH.md
Normal file
40
plugins/wasm-go/mcp-servers/mcp-ip-query/README_ZH.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# ip查询位置
|
||||
|
||||
API认证需要的APP Code请在阿里云API市场申请: https://market.aliyun.com/apimarket/detail/cmapi00054907
|
||||
|
||||
## 什么是云市场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服务器配置功能简介
|
||||
|
||||
## 功能简介
|
||||
|
||||
该服务可以基于用户的IP分析用户所在位置,可以无需主动提供IP,支持IP自动获取(基于API网关的能力)。位置信息还可以用于确定用户所在的时区,从而提供基于用户位置的精确本地时间。
|
||||
|
||||
## 工具简介
|
||||
|
||||
### IP地址查询升级版
|
||||
|
||||
- **用途**:此工具允许用户输入一个IP地址(支持IPv6),然后返回该地址所对应的详细位置信息。
|
||||
- **使用场景**:适用于需要获取访客或客户端精确地理定位的应用程序开发中,如在线广告投放、内容本地化服务等领域。
|
||||
- **请求参数**:
|
||||
- `ip` (必填):待查询的IP地址。
|
||||
- **响应结构**:返回JSON格式的数据,其中包含了查询结果的状态码、具体的地理位置信息(例如城市名、区县编码等)、状态消息及本次请求的任务编号。
|
||||
- **注意点**:除了基础的位置信息外,还包括了经纬度坐标。
|
||||
|
||||
### IP地址查询精准版
|
||||
|
||||
- **用途**:相比上一版本,该工具在提供基本地理位置的同时增加了更多维度的信息,比如运营商名称、时区等,并且对于IPv4地址不会返回经纬度数据。
|
||||
- **使用场景**:适合于那些不仅关心访问者来自哪里,还需要了解其网络环境特点的服务,比如网络安全监控系统或是全球分布式应用的设计。
|
||||
- **请求参数**:
|
||||
- `ip` (必填):需查询的IP地址。
|
||||
- **响应结构**:同样以JSON形式呈现,内容丰富多样,从大洲到邮编均有覆盖,同时也保留了任务标识符以便追踪。
|
||||
- **特点**:增强了信息的全面性,特别是针对IPv4和IPv6的不同处理方式使得它成为了一个更为灵活的选择。
|
||||
218
plugins/wasm-go/mcp-servers/mcp-ip-query/api.json
Normal file
218
plugins/wasm-go/mcp-servers/mcp-ip-query/api.json
Normal file
@@ -0,0 +1,218 @@
|
||||
{
|
||||
"info": {
|
||||
"description": "【IP归属地查询IP地址查询IP地址归属地查询IP地址解析精准版】通过IP地址查询IP归属地相关信息,包含国家、省、市和运营商等信息,支持IPV4、IPV6查询。—— 我们只做精品!",
|
||||
"title": "精准版IP归属地查询-IP地址归属地-IP地址归属地查询-IP地址解析-IP归属地址-IP地址归属地查询(支持IPV6)",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"openapi": "3.0.1",
|
||||
"paths": {
|
||||
"/ip/query-v3": {
|
||||
"post": {
|
||||
"operationId": "IP地址查询精准版",
|
||||
"summary": "根据 IP地址查询归属地信息,包含国家、省、市等信息\n同时支持IPv6和IPv4\nIPv4不返回经纬度",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/x-www-form-urlencoded": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ip": {
|
||||
"description": "ip",
|
||||
"type": "string",
|
||||
"example": "IP地址"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"ip"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"description": "详见code返回码说明"
|
||||
},
|
||||
"msg": {
|
||||
"type": "string",
|
||||
"description": "code对应的描述"
|
||||
},
|
||||
"taskNo": {
|
||||
"type": "string",
|
||||
"description": "本次唯一请求号"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"longitude": {
|
||||
"type": "string",
|
||||
"description": "经度"
|
||||
},
|
||||
"latitude": {
|
||||
"type": "string",
|
||||
"description": "纬度"
|
||||
},
|
||||
"continent": {
|
||||
"type": "string",
|
||||
"description": "大洲"
|
||||
},
|
||||
"nation": {
|
||||
"type": "string",
|
||||
"description": "国家"
|
||||
},
|
||||
"province": {
|
||||
"type": "string",
|
||||
"description": "省份"
|
||||
},
|
||||
"city": {
|
||||
"type": "string",
|
||||
"description": "市"
|
||||
},
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "行政区划代码"
|
||||
},
|
||||
"areaCode": {
|
||||
"type": "string",
|
||||
"description": "国家编码"
|
||||
},
|
||||
"timezone": {
|
||||
"type": "string",
|
||||
"description": "时区"
|
||||
},
|
||||
"zipcode": {
|
||||
"type": "string",
|
||||
"description": "邮编"
|
||||
},
|
||||
"owner": {
|
||||
"type": "string",
|
||||
"description": "所属机构"
|
||||
},
|
||||
"isp": {
|
||||
"type": "string",
|
||||
"description": "运营商"
|
||||
},
|
||||
"radius": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "成功响应"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ipv3-group/ip/address-query-v2": {
|
||||
"post": {
|
||||
"operationId": "IP地址查询升级版",
|
||||
"summary": "根据IP地址查询归属地信息,包含国家、省、市等信息,支持IPv6",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/x-www-form-urlencoded": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ip": {
|
||||
"description": "ip",
|
||||
"type": "string",
|
||||
"example": "IP地址"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"ip"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"description": "详见code返回码说明",
|
||||
"example": 200
|
||||
},
|
||||
"msg": {
|
||||
"type": "string",
|
||||
"description": "code对应的描述",
|
||||
"example": "成功"
|
||||
},
|
||||
"taskNo": {
|
||||
"type": "string",
|
||||
"description": "本次唯一请求号",
|
||||
"example": 69564903663951240000
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"longitude": {
|
||||
"type": "string",
|
||||
"description": "经度",
|
||||
"example": 120.298501
|
||||
},
|
||||
"latitude": {
|
||||
"type": "string",
|
||||
"description": "纬度",
|
||||
"example": 30.41875
|
||||
},
|
||||
"nation": {
|
||||
"type": "string",
|
||||
"description": "国家",
|
||||
"example": "中国"
|
||||
},
|
||||
"province": {
|
||||
"type": "string",
|
||||
"description": "省份",
|
||||
"example": "浙江省"
|
||||
},
|
||||
"city": {
|
||||
"type": "string",
|
||||
"description": "市",
|
||||
"example": "杭州市"
|
||||
},
|
||||
"district": {
|
||||
"type": "string",
|
||||
"description": "区县",
|
||||
"example": "余杭区"
|
||||
},
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "区县编码",
|
||||
"example": 330110
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "成功响应"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://jmipquery3.market.alicloudapi.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
107
plugins/wasm-go/mcp-servers/mcp-ip-query/mcp-server.yaml
Normal file
107
plugins/wasm-go/mcp-servers/mcp-ip-query/mcp-server.yaml
Normal file
@@ -0,0 +1,107 @@
|
||||
server:
|
||||
name: ip-query
|
||||
config:
|
||||
appCode: ""
|
||||
tools:
|
||||
- name: ip-address-query
|
||||
description: 根据IP地址查询归属地信息,包含国家、省、市等信息,可以无需主动提供IP,支持IP自动获取
|
||||
args:
|
||||
- name: ip
|
||||
description: 要查询的ip,如果用户没有提供ip,可以传空字符串,该mcp服务会自动获取用户IP
|
||||
type: string
|
||||
required: true
|
||||
requestTemplate:
|
||||
url: https://jmipquery3.market.alicloudapi.com/ipv3-group/ip/address-query-v2
|
||||
method: POST
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/x-www-form-urlencoded
|
||||
- key: Authorization
|
||||
value: APPCODE {{.config.appCode}}
|
||||
- key: X-Ca-Nonce
|
||||
value: '{{uuidv4}}'
|
||||
body: |
|
||||
ip={{ if empty .args.ip }}{{ getRealIP }}{{ else }}{{ .args.ip }}{{ end }}
|
||||
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**: 详见code返回码说明 (Type: integer)
|
||||
- **data**: (Type: object)
|
||||
- **data.city**: 市 (Type: string)
|
||||
- **data.code**: 区县编码 (Type: string)
|
||||
- **data.district**: 区县 (Type: string)
|
||||
- **data.latitude**: 纬度 (Type: string)
|
||||
- **data.longitude**: 经度 (Type: string)
|
||||
- **data.nation**: 国家 (Type: string)
|
||||
- **data.province**: 省份 (Type: string)
|
||||
- **msg**: code对应的描述 (Type: string)
|
||||
- **taskNo**: 本次唯一请求号 (Type: string)
|
||||
|
||||
## Original Response
|
||||
|
||||
- name: ip-address-query-precision-version
|
||||
description: |-
|
||||
ip-address-query如果查询不到,可以使用此工具再查询一次
|
||||
根据 IP地址查询归属地信息,包含国家、省、市等信息,可以无需主动提供IP,支持IP自动获取
|
||||
同时支持IPv6和IPv4
|
||||
IPv4不返回经纬度
|
||||
args:
|
||||
- name: ip
|
||||
description: 要查询的ip,如果用户没有提供ip,可以传空字符串,该mcp服务会自动获取用户IP
|
||||
type: string
|
||||
required: true
|
||||
requestTemplate:
|
||||
url: https://jmipquery3.market.alicloudapi.com/ip/query-v3
|
||||
method: POST
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/x-www-form-urlencoded
|
||||
- key: Authorization
|
||||
value: APPCODE {{.config.appCode}}
|
||||
- key: X-Ca-Nonce
|
||||
value: '{{uuidv4}}'
|
||||
body: |
|
||||
ip={{ if empty .args.ip }}{{ getRealIP }}{{ else }}{{ .args.ip }}{{ end }}
|
||||
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**: 详见code返回码说明 (Type: integer)
|
||||
- **data**: (Type: object)
|
||||
- **data.areaCode**: 国家编码 (Type: string)
|
||||
- **data.city**: 市 (Type: string)
|
||||
- **data.code**: 行政区划代码 (Type: string)
|
||||
- **data.continent**: 大洲 (Type: string)
|
||||
- **data.isp**: 运营商 (Type: string)
|
||||
- **data.latitude**: 纬度 (Type: string)
|
||||
- **data.longitude**: 经度 (Type: string)
|
||||
- **data.nation**: 国家 (Type: string)
|
||||
- **data.owner**: 所属机构 (Type: string)
|
||||
- **data.province**: 省份 (Type: string)
|
||||
- **data.radius**: (Type: string)
|
||||
- **data.timezone**: 时区 (Type: string)
|
||||
- **data.zipcode**: 邮编 (Type: string)
|
||||
- **msg**: code对应的描述 (Type: string)
|
||||
- **taskNo**: 本次唯一请求号 (Type: string)
|
||||
|
||||
## Original Response
|
||||
|
||||
Reference in New Issue
Block a user