diff --git a/plugins/wasm-go/mcp-servers/mcp-bravesearch/README.md b/plugins/wasm-go/mcp-servers/mcp-bravesearch/README.md new file mode 100644 index 0000000000..8d21112cb9 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-bravesearch/README.md @@ -0,0 +1,34 @@ +# Brave Search MCP Server + +An MCP server implementation that integrates the Brave Search API, providing web and local search capabilities. + +## Features + +- **Web Search**: Supports general queries, news, articles, with pagination and time control +- **Local Search**: Find businesses, restaurants, and services with detailed information + +Source code: [https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search](https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search) + +# Usage Guide + +## Get API-KEY + +1. Register for a Brave Search API account [Visit official website](https://brave.com/search/api/) +2. Choose a plan (free plan includes 2000 queries per month) +3. Generate API key through developer console [Go to console](https://api.search.brave.com/app/keys) + +## Generate SSE URL + +On the MCP Server interface, log in and enter the API-KEY to generate the URL. + +## Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "bravesearch": { + "url": "http://mcp.higress.ai/mcp-brave-search/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-bravesearch/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-bravesearch/README_ZH.md new file mode 100644 index 0000000000..7ea4cbe328 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-bravesearch/README_ZH.md @@ -0,0 +1,38 @@ +# Brave Search MCP Server + +一个集成Brave搜索API的MCP服务器实现,提供网页和本地搜索功能。 + +## 功能 + +- **网页搜索**:支持通用查询、新闻、文章,具备分页和时效性控制 +- **本地搜索**:查找带有详细信息的企业、餐厅和服务 + +源码地址:[https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search](https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search) + +# 使用教程 + +## 获取 API-KEY + +1. 注册Brave搜索API账号 [访问官网](https://brave.com/search/api/) +2. 选择套餐(免费套餐每月包含2000次查询) +3. 通过开发者控制台生成 API 密钥 [前往控制台](https://api.search.brave.com/app/keys) + +## 生成 SSE URL + +在 MCP Server 界面,登录后输入 API-KEY,生成URL。 + + + +## 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到MCP Server列表中。 + +```json +"mcpServers": { + "bravesearch": { + "url": "http://mcp.higress.ai/mcp-brave-search/{generate_key}", + } +} +``` + + diff --git a/plugins/wasm-go/mcp-servers/mcp-bravesearch/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-bravesearch/mcp-server.yaml new file mode 100644 index 0000000000..a72ab8ff24 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-bravesearch/mcp-server.yaml @@ -0,0 +1,76 @@ +server: + name: brave-search-server + config: + apiKey: "" +tools: +- name: brave_web_search + description: "使用Brave Search API进行网页搜索,适用于一般查询、新闻、文章和在线内容。支持分页、内容过滤和新鲜度控制。每次请求最多返回20条结果。" + args: + - name: query + description: "搜索查询(最多400字符,50个词)" + type: string + required: true + - name: count + description: "结果数量(1-20,默认10)" + type: integer + required: false + default: 10 + - name: offset + description: "分页偏移量(最大9,默认0)" + type: integer + required: false + default: 0 + requestTemplate: + url: "https://api.search.brave.com/res/v1/web/search" + method: GET + argsToUrlParam: true + headers: + - key: Accept + value: "application/json" + - key: Accept-Encoding + value: "gzip" + - key: X-Subscription-Token + value: "{{.config.apiKey}}" + responseTemplate: + body: | + {{- range $index, $item := .web.results }} + ## 结果 {{add $index 1}} + - **标题**: {{ $item.title }} + - **描述**: {{ $item.description }} + - **URL**: {{ $item.url }} + {{- end }} + +- name: brave_local_search + description: "使用Brave的Local Search API搜索本地商家和地点。适用于与物理位置、商家、餐厅、服务等相关的查询。返回详细信息包括商家名称、地址、评分、评论数、电话号码、营业时间等。如果没有本地结果,会自动回退到网页搜索。" + args: + - name: query + description: "本地搜索查询(例如'Central Park附近的披萨')" + type: string + required: true + - name: count + description: "结果数量(1-20,默认5)" + type: integer + required: false + default: 5 + requestTemplate: + url: "https://api.search.brave.com/res/v1/web/search" + method: GET + argsToUrlParam: true + headers: + - key: Accept + value: "application/json" + - key: Accept-Encoding + value: "gzip" + - key: X-Subscription-Token + value: "{{.config.apiKey}}" + responseTemplate: + body: | + {{- range $index, $item := .results }} + ## 结果 {{add $index 1}} + - **名称**: {{ $item.name }} + - **地址**: {{ $item.address.streetAddress }}, {{ $item.address.addressLocality }}, {{ $item.address.addressRegion }} {{ $item.address.postalCode }} + - **电话**: {{ $item.phone }} + - **评分**: {{ $item.rating.ratingValue }} ({{ $item.rating.ratingCount }} 条评论) + - **价格范围**: {{ $item.priceRange }} + - **营业时间**: {{ join $item.openingHours ", " }} + {{- end }} diff --git a/plugins/wasm-go/mcp-servers/mcp-chatppt/README.md b/plugins/wasm-go/mcp-servers/mcp-chatppt/README.md new file mode 100644 index 0000000000..f1feb25f6a --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-chatppt/README.md @@ -0,0 +1,27 @@ +# ChatPPT MCP Server + +Biyou Technology's MCP Server currently covers 18 intelligent document processing interfaces, including but not limited to PPT creation, PPT beautification, PPT generation, resume creation, resume analysis, and person-job matching. Users can build their own document creation tools through the server, enabling more possibilities for intelligent document creation. + +Source code: [https://github.com/YOOTeam/chatppt-mcp](https://github.com/YOOTeam/chatppt-mcp) + +## Usage Guide + +### Get API-KEY + +Refer to the official documentation to get API-KEY [Create Application and Get Token](https://wiki.yoo-ai.com/mcp/McpServe/serve1.3.html) + +### Generate SSE URL + +On the MCP Server interface, log in and enter the API-KEY to generate the URL. + +### Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "chatppt": { + "url": "http://mcp.higress.ai/mcp-chatppt/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-chatppt/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-chatppt/README_ZH.md new file mode 100644 index 0000000000..4244761696 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-chatppt/README_ZH.md @@ -0,0 +1,28 @@ +# ChatPPT MCP Server + +必优科技 MCP Server 目前已经覆盖了 18 个智能文档的接口能力,包括但不限于 PPT 创作,PPT 美化,PPT 生成,简历创作,简历分析,人岗匹配等场景下的文档处理能力,用户可通过 server 搭建自己的文档创作工具,让智能文档创作有更多可能。 + +源码地址: [https://github.com/YOOTeam/chatppt-mcp](https://github.com/YOOTeam/chatppt-mcp) + +## 使用教程 + +### 获取 API-KEY + +参考官方文档获取 API-KEY [创建应用获取 Token](https://wiki.yoo-ai.com/mcp/McpServe/serve1.3.html) + +### 生成 SSE URL + +在 MCP Server 界面,登录后输入 API-KEY,生成URL。 + +### 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。 + +```json +"mcpServers": { + "chatppt": { + "url": "http://mcp.higress.ai/mcp-chatppt/{generate_key}", + } +} +``` + diff --git a/plugins/wasm-go/mcp-servers/mcp-chatppt/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-chatppt/mcp-server.yaml new file mode 100644 index 0000000000..0e5389ff5e --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-chatppt/mcp-server.yaml @@ -0,0 +1,121 @@ +server: + name: chatppt-server + config: + apiKey: "" + +tools: +- name: check + description: "查询用户当前配置token" + args: [] + requestTemplate: + url: "https://saas.api.yoo-ai.com" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "apiKey": "{{.body}}" + } + +- name: query_ppt + description: "根据PPT任务ID查询异步生成结果" + args: + - name: ppt_id + description: "PPT-ID" + type: string + required: true + requestTemplate: + url: "https://saas.api.yoo-ai.com/apps/ppt-result" + method: GET + argsToUrlParam: true + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "status": "{{.body.status}}", + "process_url": "{{.body.process_url}}" + } + +- name: build_ppt + description: "根据描述的文本或markdown生成PPT" + args: + - name: text + description: "输入描述的文本或markdown" + type: string + required: true + requestTemplate: + url: "https://saas.api.yoo-ai.com/apps/ppt-create" + method: POST + argsToFormBody: true + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "ppt_id": "{{.body}}" + } + +- name: replace_template_ppt + description: "根据PPT-ID执行替换模板" + args: + - name: ppt_id + description: "PPT-ID" + type: string + required: true + requestTemplate: + url: "https://saas.api.yoo-ai.com/apps/ppt-create-task" + method: POST + argsToFormBody: true + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "new_ppt_id": "{{.body}}" + } + +- name: download_ppt + description: "生成PPT下载地址" + args: + - name: ppt_id + description: "PPT-ID" + type: string + required: true + requestTemplate: + url: "https://saas.api.yoo-ai.com/apps/ppt-download" + method: GET + argsToUrlParam: true + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "download_url": "{{.body}}" + } + +- name: editor_ppt + description: "生成PPT编辑器界面URL" + args: + - name: ppt_id + description: "PPT-ID" + type: string + required: true + requestTemplate: + url: "https://saas.api.yoo-ai.com/apps/ppt-editor" + method: POST + argsToFormBody: true + headers: + - key: Authorization + value: "Bearer {{.config.apiKey}}" + responseTemplate: + body: | + { + "editor_url": "{{.body}}" + } diff --git a/plugins/wasm-go/mcp-servers/mcp-firecrawl/README.md b/plugins/wasm-go/mcp-servers/mcp-firecrawl/README.md new file mode 100644 index 0000000000..c536e46b0f --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-firecrawl/README.md @@ -0,0 +1,33 @@ +# Firecrawl MCP Server + +An implementation of the Model Context Protocol (MCP) server that integrates [Firecrawl](https://github.com/mendableai/firecrawl), providing web scraping capabilities. + +## Features + +- Supports scraping, crawling, searching, extracting, deep research, and batch scraping +- Supports JavaScript-rendered web page scraping +- URL discovery and crawling +- Web search and content extraction +- Scraping result transformation + +## Usage Guide + +### Get API-KEY +1. Register for a Firecrawl account [Visit official website](https://www.firecrawl.dev/app) +2. Generate API Key through developer console [Go to console](https://www.firecrawl.dev/app/api-keys) + +### Generate SSE URL + +On the MCP Server interface, log in and enter the API-KEY to generate the URL. + +### Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "firecrawl": { + "url": "http://mcp.higress.ai/mcp-firecrawl/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-firecrawl/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-firecrawl/README_ZH.md new file mode 100644 index 0000000000..4915590fd8 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-firecrawl/README_ZH.md @@ -0,0 +1,34 @@ +# Firecrawl MCP Server + +一个集成了[Firecrawl](https://github.com/mendableai/firecrawl)的模型上下文协议(MCP)服务器实现,提供网页抓取功能。 + +## 功能 + +- 支持抓取、爬取、搜索、提取、深度研究和批量抓取 +- 支持JavaScript渲染的网页抓取 +- URL发现和爬取 +- 网页搜索与内容提取 +- 抓取结果转换 + +## 使用教程 + +### 获取 API-KEY +1. 注册Firecrawl 账号 [访问官网](https://www.firecrawl.dev/app) +2. 通过开发者控制台生成 API Key [前往控制台](https://www.firecrawl.dev/app/api-keys) + +### 生成 SSE URL + +在 MCP Server 界面,登录后输入 API-KEY,生成URL。 + +### 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。 + +```json +"mcpServers": { + "firecrawl": { + "url": "http://mcp.higress.ai/mcp-firecrawl/{generate_key}", + } +} +``` + diff --git a/plugins/wasm-go/mcp-servers/mcp-firecrawl/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-firecrawl/mcp-server.yaml new file mode 100644 index 0000000000..09b4677a7e --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-firecrawl/mcp-server.yaml @@ -0,0 +1,940 @@ +server: + config: + apiKey: "" + name: "rest-crawl-server" +tools: +- args: + - description: "要抓取的URL" + name: "url" + required: true + type: "string" + - default: + - "markdown" + description: "输出中包含的格式" + items: + enum: + - "markdown" + - "html" + - "rawHtml" + - "links" + - "screenshot" + - "screenshot@fullPage" + - "json" + type: "string" + name: "formats" + type: "array" + - default: true + description: "是否只返回主要内容" + name: "onlyMainContent" + type: "boolean" + - description: "输出中包含的标签" + items: + type: "string" + name: "includeTags" + type: "array" + - description: "输出中排除的标签" + items: + type: "string" + name: "excludeTags" + type: "array" + - description: "请求头信息" + name: "headers" + type: "object" + - default: 0 + description: "抓取前的等待时间(毫秒)" + name: "waitFor" + type: "integer" + - default: false + description: "是否模拟移动设备" + name: "mobile" + type: "boolean" + - default: false + description: "是否跳过TLS验证" + name: "skipTlsVerification" + type: "boolean" + - default: 30000 + description: "请求超时时间(毫秒)" + name: "timeout" + type: "integer" + - description: "JSON提取选项" + name: "jsonOptions" + properties: + prompt: + description: "提取提示" + type: "string" + schema: + description: "提取使用的schema" + type: "object" + systemPrompt: + description: "系统提示" + type: "string" + type: "object" + - description: "抓取前执行的操作" + items: + oneOf: + - properties: + milliseconds: + minimum: 1 + type: "integer" + selector: + type: "string" + type: + enum: + - "wait" + type: "string" + type: "object" + - properties: + fullPage: + default: false + type: "boolean" + type: + enum: + - "screenshot" + type: "string" + type: "object" + - properties: + all: + default: false + type: "boolean" + selector: + type: "string" + type: + enum: + - "click" + type: "string" + type: "object" + - properties: + text: + type: "string" + type: + enum: + - "write" + type: "string" + type: "object" + - properties: + key: + type: "string" + type: + enum: + - "press" + type: "string" + type: "object" + - properties: + direction: + default: "down" + enum: + - "up" + - "down" + type: "string" + selector: + type: "string" + type: + enum: + - "scroll" + type: "string" + type: "object" + - properties: + type: + enum: + - "scrape" + type: "string" + type: "object" + - properties: + script: + type: "string" + type: + enum: + - "executeJavascript" + type: "string" + type: "object" + name: "actions" + type: "array" + - description: "位置设置" + name: "location" + properties: + country: + default: "US" + pattern: "^[A-Z]{2}$" + type: "string" + languages: + items: + type: "string" + type: "array" + type: "object" + - description: "是否移除base64图片" + name: "removeBase64Images" + type: "boolean" + - default: true + description: "是否启用广告拦截" + name: "blockAds" + type: "boolean" + - description: "使用的代理类型" + enum: + - "basic" + - "stealth" + name: "proxy" + type: "string" + description: "抓取单个URL并可选地使用LLM提取信息" + name: "scrape" + requestTemplate: + argsToJsonBody: true + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "POST" + url: "https://api.firecrawl.dev/v1/scrape" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 数据: + Markdown: {{ .data.markdown }} + HTML: {{ .data.html }} + Raw HTML: {{ .data.rawHtml }} + 链接: {{ .data.links }} + 截图: {{ .data.screenshot }} + 元数据: + 标题: {{ .data.metadata.title }} + 描述: {{ .data.metadata.description }} + 语言: {{ .data.metadata.language }} + 源URL: {{ .data.metadata.sourceURL }} + 状态码: {{ .data.metadata.statusCode }} + 错误: {{ .data.metadata.error }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "要抓取的URL列表" + items: + format: "uri" + type: "string" + name: "urls" + required: true + type: "array" + - description: "Webhook配置" + name: "webhook" + properties: + events: + description: "触发Webhook的事件类型" + items: + enum: + - "completed" + - "page" + - "failed" + - "started" + type: "string" + type: "array" + headers: + description: "Webhook请求头" + type: "object" + metadata: + description: "自定义元数据" + type: "object" + url: + description: "Webhook URL" + type: "string" + type: "object" + - default: false + description: "是否忽略无效URL" + name: "ignoreInvalidURLs" + type: "boolean" + - default: + - "markdown" + description: "输出中包含的格式" + items: + enum: + - "markdown" + - "html" + - "rawHtml" + - "links" + - "screenshot" + - "screenshot@fullPage" + - "json" + type: "string" + name: "formats" + type: "array" + - default: true + description: "是否只返回主要内容" + name: "onlyMainContent" + type: "boolean" + - description: "输出中包含的标签" + items: + type: "string" + name: "includeTags" + type: "array" + - description: "输出中排除的标签" + items: + type: "string" + name: "excludeTags" + type: "array" + - description: "请求头信息" + name: "headers" + type: "object" + - default: 0 + description: "抓取前的等待时间(毫秒)" + name: "waitFor" + type: "integer" + - default: false + description: "是否模拟移动设备" + name: "mobile" + type: "boolean" + - default: false + description: "是否跳过TLS验证" + name: "skipTlsVerification" + type: "boolean" + - default: 30000 + description: "请求超时时间(毫秒)" + name: "timeout" + type: "integer" + - description: "JSON提取选项" + name: "jsonOptions" + properties: + prompt: + description: "提取提示" + type: "string" + schema: + description: "提取使用的schema" + type: "object" + systemPrompt: + description: "系统提示" + type: "string" + type: "object" + - description: "抓取前执行的操作" + items: + oneOf: + - properties: + milliseconds: + minimum: 1 + type: "integer" + selector: + type: "string" + type: + enum: + - "wait" + type: "string" + type: "object" + - properties: + fullPage: + default: false + type: "boolean" + type: + enum: + - "screenshot" + type: "string" + type: "object" + - properties: + all: + default: false + type: "boolean" + selector: + type: "string" + type: + enum: + - "click" + type: "string" + type: "object" + - properties: + text: + type: "string" + type: + enum: + - "write" + type: "string" + type: "object" + - properties: + key: + type: "string" + type: + enum: + - "press" + type: "string" + type: "object" + - properties: + direction: + default: "down" + enum: + - "up" + - "down" + type: "string" + selector: + type: "string" + type: + enum: + - "scroll" + type: "string" + type: "object" + - properties: + type: + enum: + - "scrape" + type: "string" + type: "object" + - properties: + script: + type: "string" + type: + enum: + - "executeJavascript" + type: "string" + type: "object" + name: "actions" + type: "array" + - description: "位置设置" + name: "location" + properties: + country: + default: "US" + pattern: "^[A-Z]{2}$" + type: "string" + languages: + items: + type: "string" + type: "array" + type: "object" + - description: "是否移除base64图片" + name: "removeBase64Images" + type: "boolean" + - default: true + description: "是否启用广告拦截" + name: "blockAds" + type: "boolean" + - description: "使用的代理类型" + enum: + - "basic" + - "stealth" + name: "proxy" + type: "string" + description: "批量抓取多个URL并可选地使用LLM提取信息" + name: "batch_scrape" + requestTemplate: + argsToJsonBody: true + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "POST" + url: "https://api.firecrawl.dev/v1/batch/scrape" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 任务ID: {{ .id }} + URL: {{ .url }} + 无效URL: {{ .invalidURLs }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "基础URL" + format: "uri" + name: "url" + required: true + type: "string" + - description: "搜索查询" + name: "search" + type: "string" + - default: true + description: "是否忽略网站地图" + name: "ignoreSitemap" + type: "boolean" + - default: false + description: "是否只返回网站地图中的链接" + name: "sitemapOnly" + type: "boolean" + - default: false + description: "是否包含子域名" + name: "includeSubdomains" + type: "boolean" + - default: 5000 + description: "最大返回链接数" + maximum: 5000 + name: "limit" + type: "integer" + - description: "超时时间(毫秒)" + name: "timeout" + type: "integer" + description: "根据选项映射多个URL" + name: "map" + requestTemplate: + argsToJsonBody: true + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "POST" + url: "https://api.firecrawl.dev/v1/map" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 链接: {{ .links }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "要提取数据的URL" + items: + format: "uri" + type: "string" + name: "urls" + required: true + type: "array" + - description: "指导提取过程的提示" + name: "prompt" + type: "string" + - description: "定义提取数据结构的schema" + name: "schema" + properties: + property1: + description: "属性1的描述" + required: true + type: "string" + property2: + description: "属性2的描述" + required: true + type: "integer" + type: "object" + - default: false + description: "是否启用网络搜索" + name: "enableWebSearch" + type: "boolean" + - default: false + description: "是否忽略网站地图" + name: "ignoreSitemap" + type: "boolean" + - default: true + description: "是否包含子域名" + name: "includeSubdomains" + type: "boolean" + - default: false + description: "是否显示数据来源" + name: "showSources" + type: "boolean" + - description: "抓取选项" + name: "scrapeOptions" + properties: + actions: + description: "抓取前执行的操作" + items: + oneOf: + - properties: + milliseconds: + minimum: 1 + type: "integer" + selector: + type: "string" + type: + enum: + - "wait" + type: "string" + type: "object" + - properties: + fullPage: + default: false + type: "boolean" + type: + enum: + - "screenshot" + type: "string" + type: "object" + - properties: + all: + default: false + type: "boolean" + selector: + type: "string" + type: + enum: + - "click" + type: "string" + type: "object" + - properties: + text: + type: "string" + type: + enum: + - "write" + type: "string" + type: "object" + - properties: + key: + type: "string" + type: + enum: + - "press" + type: "string" + type: "object" + - properties: + direction: + default: "down" + enum: + - "up" + - "down" + type: "string" + selector: + type: "string" + type: + enum: + - "scroll" + type: "string" + type: "object" + - properties: + type: + enum: + - "scrape" + type: "string" + type: "object" + - properties: + script: + type: "string" + type: + enum: + - "executeJavascript" + type: "string" + type: "object" + type: "array" + blockAds: + default: true + description: "是否启用广告拦截" + type: "boolean" + excludeTags: + description: "输出中排除的标签" + items: + type: "string" + type: "array" + formats: + default: + - "markdown" + description: "输出中包含的格式" + items: + enum: + - "markdown" + - "html" + - "rawHtml" + - "links" + - "screenshot" + - "screenshot@fullPage" + - "json" + type: "string" + type: "array" + headers: + description: "请求头信息" + type: "object" + includeTags: + description: "输出中包含的标签" + items: + type: "string" + type: "array" + jsonOptions: + description: "JSON提取选项" + properties: + prompt: + description: "提取提示" + type: "string" + schema: + description: "提取使用的schema" + type: "object" + systemPrompt: + description: "系统提示" + type: "string" + type: "object" + location: + description: "位置设置" + properties: + country: + default: "US" + pattern: "^[A-Z]{2}$" + type: "string" + languages: + items: + type: "string" + type: "array" + type: "object" + mobile: + default: false + description: "是否模拟移动设备" + type: "boolean" + onlyMainContent: + default: true + description: "是否只返回主要内容" + type: "boolean" + proxy: + description: "使用的代理类型" + enum: + - "basic" + - "stealth" + type: "string" + removeBase64Images: + description: "是否移除base64图片" + type: "boolean" + skipTlsVerification: + default: false + description: "是否跳过TLS验证" + type: "boolean" + timeout: + default: 30000 + description: "请求超时时间(毫秒)" + type: "integer" + waitFor: + default: 0 + description: "抓取前的等待时间(毫秒)" + type: "integer" + type: "object" + description: "使用LLM从页面中提取结构化数据" + name: "extract" + requestTemplate: + argsToJsonBody: true + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "POST" + url: "https://api.firecrawl.dev/v1/extract" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 任务ID: {{ .id }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "搜索查询" + name: "query" + required: true + type: "string" + - default: 5 + description: "最大返回结果数" + maximum: 10 + minimum: 1 + name: "limit" + type: "integer" + - description: "基于时间的搜索参数" + name: "tbs" + type: "string" + - default: "en" + description: "搜索结果的语言代码" + name: "lang" + type: "string" + - default: "us" + description: "搜索结果的国家代码" + name: "country" + type: "string" + - description: "搜索结果的location参数" + name: "location" + type: "string" + - default: 60000 + description: "超时时间(毫秒)" + name: "timeout" + type: "integer" + - default: {} + description: "抓取搜索结果的选项" + name: "scrapeOptions" + properties: + formats: + default: [] + description: "输出中包含的格式" + items: + enum: + - "markdown" + - "html" + - "rawHtml" + - "links" + - "screenshot" + - "screenshot@fullPage" + - "extract" + type: "string" + type: "array" + type: "object" + description: "搜索并可选地抓取搜索结果" + name: "search" + requestTemplate: + argsToJsonBody: true + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "POST" + url: "https://api.firecrawl.dev/v1/search" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 数据: + {{- range .data }} + - 标题: {{ .title }} + 描述: {{ .description }} + URL: {{ .url }} + Markdown: {{ .markdown }} + HTML: {{ .html }} + Raw HTML: {{ .rawHtml }} + 链接: {{ .links }} + 截图: {{ .screenshot }} + 元数据: + 标题: {{ .metadata.title }} + 描述: {{ .metadata.description }} + 源URL: {{ .metadata.sourceURL }} + 状态码: {{ .metadata.statusCode }} + 错误: {{ .metadata.error }} + {{- end }} + 警告: {{ .warning }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "批量抓取任务的ID" + name: "id" + required: true + type: "string" + description: "获取批量抓取任务的状态" + name: "get_batch_scrape_status" + requestTemplate: + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "GET" + url: "https://api.firecrawl.dev/v1/batch/scrape/{{.args.id}}" + responseTemplate: + body: | + {{- if .status }} + 状态: {{ .status }} + 总数: {{ .total }} + 已完成: {{ .completed }} + 使用信用: {{ .creditsUsed }} + 过期时间: {{ .expiresAt }} + 数据: + {{- range .data }} + - Markdown: {{ .markdown }} + HTML: {{ .html }} + Raw HTML: {{ .rawHtml }} + 链接: {{ .links }} + 截图: {{ .screenshot }} + 元数据: + 标题: {{ .metadata.title }} + 描述: {{ .metadata.description }} + 语言: {{ .metadata.language }} + 源URL: {{ .metadata.sourceURL }} + 状态码: {{ .metadata.statusCode }} + 错误: {{ .metadata.error }} + {{- end }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "批量抓取任务的ID" + name: "id" + required: true + type: "string" + description: "获取批量抓取任务的错误信息" + name: "get_batch_scrape_errors" + requestTemplate: + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "GET" + url: "https://api.firecrawl.dev/v1/batch/scrape/{{.args.id}}/errors" + responseTemplate: + body: | + {{- if .errors }} + 错误: + {{- range .errors }} + - ID: {{ .id }} + 时间戳: {{ .timestamp }} + URL: {{ .url }} + 错误信息: {{ .error }} + {{- end }} + 被robots.txt阻止的URL: + {{- range .robotsBlocked }} + - {{ . }} + {{- end }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "爬取任务的ID" + name: "id" + required: true + type: "string" + description: "获取爬取任务的状态" + name: "get_crawl_status" + requestTemplate: + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "GET" + url: "https://api.firecrawl.dev/v1/crawl/{{.args.id}}" + responseTemplate: + body: | + {{- if .status }} + 状态: {{ .status }} + 总数: {{ .total }} + 已完成: {{ .completed }} + 使用信用: {{ .creditsUsed }} + 过期时间: {{ .expiresAt }} + 数据: + {{- range .data }} + - Markdown: {{ .markdown }} + HTML: {{ .html }} + Raw HTML: {{ .rawHtml }} + 链接: {{ .links }} + 截图: {{ .screenshot }} + 元数据: + 标题: {{ .metadata.title }} + 描述: {{ .metadata.description }} + 语言: {{ .metadata.language }} + 源URL: {{ .metadata.sourceURL }} + 状态码: {{ .metadata.statusCode }} + 错误: {{ .metadata.error }} + {{- end }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "爬取任务的ID" + name: "id" + required: true + type: "string" + description: "获取爬取任务的错误信息" + name: "get_crawl_errors" + requestTemplate: + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "GET" + url: "https://api.firecrawl.dev/v1/crawl/{{.args.id}}/errors" + responseTemplate: + body: | + {{- if .errors }} + 错误: + {{- range .errors }} + - ID: {{ .id }} + 时间戳: {{ .timestamp }} + URL: {{ .url }} + 错误信息: {{ .error }} + {{- end }} + 被robots.txt阻止的URL: + {{- range .robotsBlocked }} + - {{ . }} + {{- end }} + {{- else }} + 错误: {{ .error }} + {{- end }} +- args: + - description: "提取任务的ID" + name: "id" + required: true + type: "string" + description: "获取提取任务的状态" + name: "get_extract_job_status" + requestTemplate: + headers: + - key: "Authorization" + value: "Bearer {{.config.apiKey}}" + method: "GET" + url: "https://api.firecrawl.dev/v1/extract/{{.args.id}}" + responseTemplate: + body: | + {{- if .success }} + 成功: {{ .success }} + 数据: {{ .data }} + 状态: {{ .status }} + 过期时间: {{ .expiresAt }} + {{- else }} + 错误: {{ .error }} + {{- end }} \ No newline at end of file diff --git a/plugins/wasm-go/mcp-servers/mcp-github/README.md b/plugins/wasm-go/mcp-servers/mcp-github/README.md new file mode 100644 index 0000000000..3850007925 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-github/README.md @@ -0,0 +1,39 @@ +# GitHub MCP Server + +An MCP server implementation of the GitHub API, supporting file operations, repository management, search, and more. + +Source code: [https://github.com/modelcontextprotocol/servers/tree/main/src/github](https://github.com/modelcontextprotocol/servers/tree/main/src/github) + +## Features + +- **Automatic branch creation**: Automatically creates branches if they don't exist when creating/updating files or pushing changes +- **Comprehensive error handling**: Provides clear error messages for common issues +- **Git history preservation**: Operations preserve complete Git history, no force pushing +- **Batch operations**: Supports both single file and batch file operations +- **Advanced search**: Supports code, issues/PRs, and user search + +## Usage Guide + +### Get AccessToken +[Create GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens): + 1. Visit [Personal access tokens](https://github.com/settings/tokens) (in GitHub Settings > Developer settings) + 2. Select repositories the token can access (public, all, or selected) + 3. Create token with `repo` permissions ("Full control of private repositories") + - Or, if only using public repositories, select only `public_repo` permissions + 4. Copy the generated token + +### Generate SSE URL + +On the MCP Server interface, log in and enter the AccessToken to generate the URL. + +### Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "github": { + "url": "http://mcp.higress.ai/mcp-github/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-github/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-github/README_ZH.md new file mode 100644 index 0000000000..6bb38542b5 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-github/README_ZH.md @@ -0,0 +1,40 @@ +# GitHub MCP Server + +GitHub API 的 MCP 服务器实现,支持文件操作、仓库管理、搜索等功能。 + +源码地址:[https://github.com/modelcontextprotocol/servers/tree/main/src/github](https://github.com/modelcontextprotocol/servers/tree/main/src/github) + +## 功能 + +- **自动分支创建**: 在创建/更新文件或推送更改时,如果分支不存在会自动创建 +- **全面的错误处理**: 提供常见问题的清晰错误信息 +- **Git 历史保留**: 操作会保留完整的 Git 历史记录,不会强制推送 +- **批量操作**: 支持单文件和批量文件操作 +- **高级搜索**: 支持代码、issues/PRs 和用户的搜索 + +## 使用教程 + +### 获取 AccessToken +[创建 GitHub 个人访问令牌](https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens): + 1. 访问 [个人访问令牌](https://github.com/settings/tokens)(在 GitHub 设置 > 开发者设置中) + 2. 选择该令牌可以访问的仓库(公开、所有或选择) + 3. 创建具有 `repo` 权限的令牌("对私有仓库的完全控制") + - 或者,如果仅使用公开仓库,选择仅 `public_repo` 权限 + 4. 复制生成的令牌 + +### 生成 SSE URL + +在 MCP Server 界面,登录后输入 AccessToken,生成URL。 + +### 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。 + +```json +"mcpServers": { + "github": { + "url": "http://mcp.higress.ai/mcp-github/{generate_key}", + } +} +``` + diff --git a/plugins/wasm-go/mcp-servers/mcp-github/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-github/mcp-server.yaml new file mode 100644 index 0000000000..755b44d7d0 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-github/mcp-server.yaml @@ -0,0 +1,998 @@ +server: + name: github-mcp-server + config: + accessToken: "" + +tools: +- name: create_or_update_file + description: 在GitHub仓库创建或更新单个文件 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: path + type: string + required: true + description: "Path where to create/update the file" + - name: content + type: string + required: true + description: "Content of the file" + - name: message + type: string + required: true + description: "Commit message" + - name: branch + type: string + required: true + description: "Branch to create/update the file in" + - name: sha + type: string + required: false + description: "SHA of the file being replaced (required when updating existing files)" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/contents/{{.args.path}}" + method: PUT + body: | + { + "message": "{{.args.message}}", + "content": "{{.args.content | b64enc}}", + "branch": "{{.args.branch}}", + "sha": "{{.args.sha}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: search_repositories + description: 搜索GitHub仓库 + args: + - name: query + type: string + required: true + description: "Search query (see GitHub search syntax)" + - name: page + type: number + required: false + description: "Page number for pagination (default: 1)" + - name: perPage + type: number + required: false + description: "Number of results per page (default: 30, max: 100)" + requestTemplate: + url: "https://api.github.com/search/repositories?q={{.args.query}}&page={{.args.page}}&per_page={{.args.perPage}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: create_repository + description: 在您的账户中创建新的GitHub仓库 + args: + - name: name + type: string + required: true + description: "Repository name" + - name: description + type: string + required: false + description: "Repository description" + - name: private + type: boolean + required: false + description: "Whether the repository should be private" + - name: autoInit + type: boolean + required: false + description: "Initialize with README.md" + requestTemplate: + url: "https://api.github.com/user/repos" + method: POST + body: | + { + "name": "{{.args.name}}", + "description": "{{.args.description}}", + "private": {{.args.private}}, + "auto_init": {{.args.autoInit}} + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_file_contents + description: 从GitHub仓库获取文件或目录内容 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: path + type: string + required: true + description: "Path to the file or directory" + - name: branch + type: string + required: false + description: "Branch to get contents from" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/contents/{{.args.path}}?ref={{.args.branch}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: push_files + description: 在单个提交中推送多个文件到GitHub仓库 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: branch + type: string + required: true + description: "Branch to push to (e.g., 'main' or 'master')" + - name: files + type: array + items: + type: object + properties: + path: + type: string + content: + type: string + required: true + description: "Array of files to push" + - name: message + type: string + required: true + description: "Commit message" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/git/commits" + method: POST + body: | + { + "message": "{{.args.message}}", + "tree": "{{.args.files | toJson}}", + "parents": ["{{.args.branch}}"] + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: create_issue + description: 在GitHub仓库创建新Issue + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: title + type: string + required: true + description: "Issue title" + - name: body + type: string + required: false + description: "Issue description" + - name: assignees + type: array + items: + type: string + required: false + description: "Usernames to assign" + - name: labels + type: array + items: + type: string + required: false + description: "Labels to add" + - name: milestone + type: number + required: false + description: "Milestone number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/issues" + method: POST + body: | + { + "title": "{{.args.title}}", + "body": "{{.args.body}}", + "assignees": {{.args.assignees | toJson}}, + "labels": {{.args.labels | toJson}}, + "milestone": {{.args.milestone}} + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: create_pull_request + description: 在GitHub仓库创建新的Pull Request + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: title + type: string + required: true + description: "Pull request title" + - name: body + type: string + required: false + description: "Pull request body/description" + - name: head + type: string + required: true + description: "The name of the branch where your changes are implemented" + - name: base + type: string + required: true + description: "The name of the branch you want the changes pulled into" + - name: draft + type: boolean + required: false + description: "Whether to create the pull request as a draft" + - name: maintainer_can_modify + type: boolean + required: false + description: "Whether maintainers can modify the pull request" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls" + method: POST + body: | + { + "title": "{{.args.title}}", + "body": "{{.args.body}}", + "head": "{{.args.head}}", + "base": "{{.args.base}}", + "draft": {{.args.draft}}, + "maintainer_can_modify": {{.args.maintainer_can_modify}} + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: fork_repository + description: 将GitHub仓库fork到您的账户或指定组织 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: organization + type: string + required: false + description: "Optional: organization to fork to (defaults to your personal account)" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/forks" + method: POST + body: | + { + "organization": "{{.args.organization}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: create_branch + description: 在GitHub仓库创建新分支 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: branch + type: string + required: true + description: "Name for the new branch" + - name: from_branch + type: string + required: false + description: "Optional: source branch to create from (defaults to the repository's default branch)" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/git/refs" + method: POST + body: | + { + "ref": "refs/heads/{{.args.branch}}", + "sha": "{{.args.from_branch}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: list_commits + description: 获取GitHub仓库分支的提交列表 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: page + type: number + required: false + description: "Page number for pagination" + - name: perPage + type: number + required: false + description: "Number of results per page" + - name: sha + type: string + required: false + description: "Branch name" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/commits?page={{.args.page}}&per_page={{.args.perPage}}&sha={{.args.sha}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: list_issues + description: 列出并过滤GitHub仓库的Issues + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: state + type: string + required: false + description: "Filter by state ('open', 'closed', 'all')" + - name: labels + type: array + items: + type: string + required: false + description: "Filter by labels" + - name: sort + type: string + required: false + description: "Sort by ('created', 'updated', 'comments')" + - name: direction + type: string + required: false + description: "Sort direction ('asc', 'desc')" + - name: since + type: string + required: false + description: "Filter by date (ISO 8601 timestamp)" + - name: page + type: number + required: false + description: "Page number" + - name: per_page + type: number + required: false + description: "Results per page" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/issues?state={{.args.state}}&labels={{.args.labels | join ','}}&sort={{.args.sort}}&direction={{.args.direction}}&since={{.args.since}}&page={{.args.page}}&per_page={{.args.per_page}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: update_issue + description: 更新GitHub仓库中的现有Issue + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: issue_number + type: number + required: true + description: "Issue number to update" + - name: title + type: string + required: false + description: "New title" + - name: body + type: string + required: false + description: "New description" + - name: state + type: string + required: false + description: "New state ('open' or 'closed')" + - name: labels + type: array + items: + type: string + required: false + description: "New labels" + - name: assignees + type: array + items: + type: string + required: false + description: "New assignees" + - name: milestone + type: number + required: false + description: "New milestone number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/issues/{{.args.issue_number}}" + method: PATCH + body: | + { + "title": "{{.args.title}}", + "body": "{{.args.body}}", + "state": "{{.args.state}}", + "labels": {{.args.labels | toJson}}, + "assignees": {{.args.assignees | toJson}}, + "milestone": {{.args.milestone}} + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: add_issue_comment + description: 在GitHub Issue中添加评论 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: issue_number + type: number + required: true + description: "Issue number to comment on" + - name: body + type: string + required: true + description: "Comment text" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/issues/{{.args.issue_number}}/comments" + method: POST + body: | + { + "body": "{{.args.body}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: search_code + description: 在GitHub仓库中搜索代码 + args: + - name: q + type: string + required: true + description: "Search query using GitHub code search syntax" + - name: sort + type: string + required: false + description: "Sort field ('indexed' only)" + - name: order + type: string + required: false + description: "Sort order ('asc' or 'desc')" + - name: per_page + type: number + required: false + description: "Results per page (max 100)" + - name: page + type: number + required: false + description: "Page number" + requestTemplate: + url: "https://api.github.com/search/code?q={{.args.q}}&sort={{.args.sort}}&order={{.args.order}}&per_page={{.args.per_page}}&page={{.args.page}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: search_issues + description: 在GitHub仓库中搜索Issues和Pull Requests + args: + - name: q + type: string + required: true + description: "Search query using GitHub issues search syntax" + - name: sort + type: string + required: false + description: "Sort field (comments, reactions, created, etc.)" + - name: order + type: string + required: false + description: "Sort order ('asc' or 'desc')" + - name: per_page + type: number + required: false + description: "Results per page (max 100)" + - name: page + type: number + required: false + description: "Page number" + requestTemplate: + url: "https://api.github.com/search/issues?q={{.args.q}}&sort={{.args.sort}}&order={{.args.order}}&per_page={{.args.per_page}}&page={{.args.page}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: search_users + description: 在GitHub中搜索用户 + args: + - name: q + type: string + required: true + description: "Search query using GitHub users search syntax" + - name: sort + type: string + required: false + description: "Sort field (followers, repositories, joined)" + - name: order + type: string + required: false + description: "Sort order ('asc' or 'desc')" + - name: per_page + type: number + required: false + description: "Results per page (max 100)" + - name: page + type: number + required: false + description: "Page number" + requestTemplate: + url: "https://api.github.com/search/users?q={{.args.q}}&sort={{.args.sort}}&order={{.args.order}}&per_page={{.args.per_page}}&page={{.args.page}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_issue + description: 获取GitHub仓库中特定Issue的详细信息 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: issue_number + type: number + required: true + description: "Issue number to retrieve" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/issues/{{.args.issue_number}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_pull_request + description: 获取GitHub仓库中特定Pull Request的详细信息 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: list_pull_requests + description: 列出并过滤GitHub仓库的Pull Requests + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: state + type: string + required: false + description: "State of the pull requests to return" + - name: head + type: string + required: false + description: "Filter by head user or head organization and branch name" + - name: base + type: string + required: false + description: "Filter by base branch name" + - name: sort + type: string + required: false + description: "What to sort results by" + - name: direction + type: string + required: false + description: "The direction of the sort" + - name: per_page + type: number + required: false + description: "Results per page (max 100)" + - name: page + type: number + required: false + description: "Page number of the results" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls?state={{.args.state}}&head={{.args.head}}&base={{.args.base}}&sort={{.args.sort}}&direction={{.args.direction}}&per_page={{.args.per_page}}&page={{.args.page}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: create_pull_request_review + description: 在GitHub Pull Request上创建review + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + - name: commit_id + type: string + required: false + description: "The SHA of the commit that needs a review" + - name: body + type: string + required: true + description: "The body text of the review" + - name: event + type: string + required: true + description: "The review action to perform" + - name: comments + type: array + items: + type: object + properties: + path: + type: string + description: "The relative path to the file being commented on" + position: + type: number + description: "The position in the diff where you want to add a review comment" + body: + type: string + description: "Text of the review comment" + required: false + description: "Comments to post as part of the review (specify either position or line, not both)" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/reviews" + method: POST + body: | + { + "body": "{{.args.body}}", + "event": "{{.args.event}}", + "commit_id": "{{.args.commit_id}}", + "comments": {{.args.comments | toJson}} + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: merge_pull_request + description: 合并GitHub Pull Request + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + - name: commit_title + type: string + required: false + description: "Title for the automatic commit message" + - name: commit_message + type: string + required: false + description: "Extra detail to append to automatic commit message" + - name: merge_method + type: string + required: false + description: "Merge method to use" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/merge" + method: PUT + body: | + { + "commit_title": "{{.args.commit_title}}", + "commit_message": "{{.args.commit_message}}", + "merge_method": "{{.args.merge_method}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_pull_request_files + description: 获取GitHub Pull Request中更改的文件列表 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/files" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_pull_request_status + description: 获取GitHub Pull Request的状态检查结果 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/status" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: update_pull_request_branch + description: 使用base分支的最新更改更新Pull Request分支 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + - name: expected_head_sha + type: string + required: false + description: "The expected SHA of the pull request's HEAD ref" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/update-branch" + method: PUT + body: | + { + "expected_head_sha": "{{.args.expected_head_sha}}" + } + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_pull_request_comments + description: 获取GitHub Pull Request的review评论 + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/comments" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" + +- name: get_pull_request_reviews + description: 获取GitHub Pull Request的reviews + args: + - name: owner + type: string + required: true + description: "Repository owner (username or organization)" + - name: repo + type: string + required: true + description: "Repository name" + - name: pull_number + type: number + required: true + description: "Pull request number" + requestTemplate: + url: "https://api.github.com/repos/{{.args.owner}}/{{.args.repo}}/pulls/{{.args.pull_number}}/reviews" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.accessToken}}" + - key: Accept + value: "application/vnd.github+json" + - key: X-GitHub-Api-Version + value: "2022-11-28" diff --git a/plugins/wasm-go/mcp-servers/mcp-notion/README.md b/plugins/wasm-go/mcp-servers/mcp-notion/README.md new file mode 100644 index 0000000000..2b7977753c --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-notion/README.md @@ -0,0 +1,38 @@ +# Notion MCP Server + +A Notion workspace is a collaborative environment where teams can organize work, manage projects, and store information in a highly customizable way. Notion's REST API facilitates direct interactions with workspace elements through programming. + +Source code: [https://github.com/makenotion/notion-mcp-server/tree/main](https://github.com/makenotion/notion-mcp-server/tree/main) + +## Feature + +Notion MCP Server provides the following features: + +- **Pages**: Create, update, and retrieve page content. +- **Databases**: Manage database, properties, entries, and schemas. +- **Users**: Access user profiles and permissions. +- **Comments**: Handle page and inline comments. +- **Content Queries**: Search through workspace content. + +## Usage Guide + +### Get Notion Integration token + +Go to [https://www.notion.so/profile/integrations](https://www.notion.so/profile/integrations) and create a new internal integration or select an existing one. + + +### Generate SSE URL + +On the MCP Server interface, log in and enter the token to generate the URL. + +### Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "notion": { + "url": "http://mcp.higress.ai/mcp-notion/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-notion/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-notion/README_ZH.md new file mode 100644 index 0000000000..4f4858c125 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-notion/README_ZH.md @@ -0,0 +1,38 @@ +# Notion MCP Server + +Notion 工作区是一个协作环境,团队可以在其中以高度可定制的方式组织工作、管理项目和存储信息。Notion 的 REST API 方便通过编程与工作区元素直接交互。 + +源码地址:[https://github.com/makenotion/notion-mcp-server/tree/main](https://github.com/makenotion/notion-mcp-server/tree/main) + +## 功能 + +Notion MCP Server 提供了以下功能: + +- **页面**:创建、更新和检索页面内容。 +- **数据库**:管理数据库、属性、条目和模式。 +- **用户**:访问用户配置文件和权限。 +- **评论**:处理页面和内联评论。 +- **内容查询**:搜索工作区内容。 + +## 使用教程 + +### 获取 Notion 集成 Key + +在Notion中设置集成,转到 [https://www.notion.so/profile/integrations](https://www.notion.so/profile/integrations) 并创建一个新的内部集成或选择一个现有的集成。 + + +### 生成 SSE URL + +在 MCP Server 界面,登录后输入 AccessToken,生成URL。 + +### 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。 + +```json +"mcpServers": { + "notion": { + "url": "http://mcp.higress.ai/mcp-notion/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-notion/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-notion/mcp-server.yaml new file mode 100644 index 0000000000..7e62bd0cc4 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-notion/mcp-server.yaml @@ -0,0 +1,434 @@ +server: + name: notion-api-server + config: + token: "" +tools: +- name: getUser + description: "获取指定用户信息" + args: + - name: user_id + description: "用户UUID" + type: string + required: true + requestTemplate: + url: "https://api.notion.com/v1/users/{{.args.user_id}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ### 用户信息 + - **ID**: {{.id}} + - **类型**: {{.type}} + - **名称**: {{.name}} + {{- if eq .type "person"}} + - **邮箱**: {{.person.email}} + {{- end}} + - **头像**: [链接]({{.avatar_url}}) + +- name: listUsers + description: "分页列出所有用户" + args: + - name: start_cursor + description: "分页起始游标" + type: string + required: false + - name: page_size + description: "每页数量(默认100)" + type: integer + required: false + default: 100 + requestTemplate: + url: "https://api.notion.com/v1/users" + method: GET + argsToUrlParam: true + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + 用户列表(共{{len .results}}项) + {{- range .results}} + ### {{.name}} + - 类型: {{.type}} + - 最后编辑时间: {{.last_edited_time}} + {{- end}} + +- name: getCurrentUser + description: "获取当前认证用户信息" + requestTemplate: + url: "https://api.notion.com/v1/users/me" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 当前用户 + - **身份类型**: {{.type}} + {{- if .bot}} + - **所属者**: {{.bot.owner.user.name}} ({{.bot.owner.user.person.email}}) + {{- end}} + +- name: queryDatabase + description: "查询数据库" + args: + - name: database_id + type: string + required: true + - name: filter_properties + type: array + items: + type: string + requestTemplate: + url: "https://api.notion.com/v1/databases/{{.args.database_id}}/query" + method: POST + body: | + { + "filter": {{toJson .args.filter}}, + "sorts": {{toJson .args.sorts}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 查询结果 + {{- range .results}} + ### {{.properties.Name.title.plain_text}} + - 创建时间: {{.created_time}} + - 最后编辑时间: {{.last_edited_time}} + {{- end}} + +- name: search + description: "搜索页面和数据库" + args: + - name: query + type: string + required: false + - name: sort + type: object + properties: + direction: + type: string + timestamp: + type: string + requestTemplate: + url: "https://api.notion.com/v1/search" + method: POST + body: | + { + "query": "{{.args.query}}", + "sort": {{toJson .args.sort}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 搜索结果 + {{- range .results}} + ### {{.title.plain_text}} + - 类型: {{.object}} + - 最后编辑时间: {{.last_edited_time}} + {{- end}} + +- name: getBlock + description: "获取指定块信息" + args: + - name: block_id + type: string + required: true + requestTemplate: + url: "https://api.notion.com/v1/blocks/{{.args.block_id}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 块信息 + - 类型: {{.type}} + - 创建时间: {{.created_time}} + - 最后编辑时间: {{.last_edited_time}} + +- name: updateBlock + description: "更新块内容" + args: + - name: block_id + type: string + required: true + - name: type + type: object + properties: {} + - name: archived + type: boolean + default: true + requestTemplate: + url: "https://api.notion.com/v1/blocks/{{.args.block_id}}" + method: PATCH + body: | + { + "type": {{toJson .args.type}}, + "archived": {{.args.archived}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 更新结果 + - 状态: 成功 + - 块ID: {{.id}} + +- name: deleteBlock + description: "删除指定块" + args: + - name: block_id + type: string + required: true + requestTemplate: + url: "https://api.notion.com/v1/blocks/{{.args.block_id}}" + method: DELETE + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 删除结果 + - 状态: 成功 + - 块ID: {{.args.block_id}} + +- name: getPage + description: "获取指定页面信息" + args: + - name: page_id + type: string + required: true + - name: filter_properties + type: string + required: false + requestTemplate: + url: "https://api.notion.com/v1/pages/{{.args.page_id}}" + method: GET + argsToUrlParam: true + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 页面信息 + - 标题: {{.properties.title.title.plain_text}} + - 创建时间: {{.created_time}} + - 最后编辑时间: {{.last_edited_time}} + +- name: updatePage + description: "更新页面属性" + args: + - name: page_id + type: string + required: true + - name: properties + type: object + properties: {} + - name: in_trash + type: boolean + default: false + requestTemplate: + url: "https://api.notion.com/v1/pages/{{.args.page_id}}" + method: PATCH + body: | + { + "properties": {{toJson .args.properties}}, + "in_trash": {{.args.in_trash}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 更新结果 + - 状态: 成功 + - 页面ID: {{.id}} + +- name: createDatabase + description: "创建新数据库" + args: + - name: parent + type: object + properties: + page_id: + type: string + required: true + - name: properties + type: object + properties: {} + required: true + requestTemplate: + url: "https://api.notion.com/v1/databases" + method: POST + body: | + { + "parent": {{toJson .args.parent}}, + "properties": {{toJson .args.properties}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 创建结果 + - 数据库ID: {{.id}} + - 标题: {{.title.plain_text}} + - 创建时间: {{.created_time}} + +- name: updateDatabase + description: "更新数据库" + args: + - name: database_id + type: string + required: true + - name: title + type: array + items: + type: object + properties: + text: + type: object + properties: + content: + type: string + requestTemplate: + url: "https://api.notion.com/v1/databases/{{.args.database_id}}" + method: PATCH + body: | + { + "title": {{toJson .args.title}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 更新结果 + - 数据库ID: {{.id}} + - 新标题: {{.title.plain_text}} + +- name: getDatabase + description: "获取数据库信息" + args: + - name: database_id + type: string + required: true + requestTemplate: + url: "https://api.notion.com/v1/databases/{{.args.database_id}}" + method: GET + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 数据库信息 + - 标题: {{.title.plain_text}} + - 创建时间: {{.created_time}} + - 最后编辑时间: {{.last_edited_time}} + - 属性数量: {{len .properties}} + +- name: getPageProperty + description: "获取页面属性项" + args: + - name: page_id + type: string + required: true + - name: property_id + type: string + required: true + - name: page_size + type: integer + required: false + - name: start_cursor + type: string + required: false + requestTemplate: + url: "https://api.notion.com/v1/pages/{{.args.page_id}}/properties/{{.args.property_id}}" + method: GET + argsToUrlParam: true + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 属性项 + {{- range .results}} + - 类型: {{.type}} + - 值: {{.value}} + {{- end}} + +- name: createComment + description: "创建评论" + args: + - name: parent + type: object + properties: + page_id: + type: string + required: true + - name: rich_text + type: array + items: + type: object + properties: + text: + type: object + properties: + content: + type: string + required: true + requestTemplate: + url: "https://api.notion.com/v1/comments" + method: POST + body: | + { + "parent": {{toJson .args.parent}}, + "rich_text": {{toJson .args.rich_text}} + } + headers: + - key: Authorization + value: "Bearer {{.config.token}}" + - key: Notion-Version + value: 2022-06-28 + responseTemplate: + body: | + ## 评论创建结果 + - 评论ID: {{.id}} + - 创建时间: {{.created_time}} + - 内容: {{.rich_text.text.content}} diff --git a/plugins/wasm-go/mcp-servers/mcp-openweather/README.md b/plugins/wasm-go/mcp-servers/mcp-openweather/README.md new file mode 100644 index 0000000000..8aa50dec78 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-openweather/README.md @@ -0,0 +1,23 @@ +# Weather MCP Server + +A weather query MCP service based on OpenWeather API, retrieving weather information for specified cities. + +Source code: [https://github.com/MrCare/mcp_tool](https://github.com/MrCare/mcp_tool) + +## Usage Guide + +### Generate SSE URL + +On the MCP Server interface, log in to generate the URL. + +### Configure MCP Client + +On the user's MCP Client interface, add the generated SSE URL to the MCP Server list. + +```json +"mcpServers": { + "weather": { + "url": "http://mcp.higress.ai/mcp-weather/{generate_key}", + } +} +``` diff --git a/plugins/wasm-go/mcp-servers/mcp-openweather/README_ZH.md b/plugins/wasm-go/mcp-servers/mcp-openweather/README_ZH.md new file mode 100644 index 0000000000..4e3162a637 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-openweather/README_ZH.md @@ -0,0 +1,24 @@ +# Weather MCP Server + +基于 OpenWeather API 的天气查询 MCP 服务,获取指定城市的天气信息。 + +源码地址:[https://github.com/MrCare/mcp_tool](https://github.com/MrCare/mcp_tool) + +## 使用教程 + +### 生成 SSE URL + +在 MCP Server 界面,登录后生成URL。 + +### 配置 MCP Client + +在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。 + +```json +"mcpServers": { + "weather": { + "url": "http://mcp.higress.ai/mcp-weather/{generate_key}", + } +} +``` + diff --git a/plugins/wasm-go/mcp-servers/mcp-openweather/mcp-server.yaml b/plugins/wasm-go/mcp-servers/mcp-openweather/mcp-server.yaml new file mode 100644 index 0000000000..d35698f9d8 --- /dev/null +++ b/plugins/wasm-go/mcp-servers/mcp-openweather/mcp-server.yaml @@ -0,0 +1,85 @@ +server: + name: weather-server + config: + apiKey: "" +tools: +- name: get_weather + description: "获取指定城市的实时天气信息" + args: + - name: city + description: "城市名称(支持中文或英文,如:苏州、suzhou)" + type: string + required: true + - name: units + description: "温度单位 (metric: 摄氏度, imperial: 华氏度)" + type: string + required: false + default: "metric" + - name: lang + description: "返回语言 (zh_cn: 中文, en: 英文)" + type: string + required: false + default: "zh_cn" + requestTemplate: + url: "http://api.openweathermap.org/data/2.5/weather" + method: GET + argsToUrlParam: true + headers: + - key: x-api-key + value: "{{.config.apiKey}}" + responseTemplate: + body: | + { + "description": "{{ (index .weather 0).description}}", + "temperature": {{.main.temp}}, + "humidity": {{.main.humidity}}, + "wind_speed": {{.wind.speed}}, + "city": "{{.args.city}}" + } + +- name: get_weather_forecast + description: "获取指定城市的天气预报信息" + args: + - name: city + description: "城市名称(支持中文或英文,如:苏州、suzhou)" + type: string + required: true + - name: days + description: "预报天数(最多5天)" + type: integer + required: false + default: 5 + - name: units + description: "温度单位 (metric: 摄氏度, imperial: 华氏度)" + type: string + required: false + default: "metric" + - name: lang + description: "返回语言 (zh_cn: 中文, en: 英文)" + type: string + required: false + default: "zh_cn" + requestTemplate: + url: "http://api.openweathermap.org/data/2.5/forecast" + method: GET + argsToUrlParam: true + headers: + - key: x-api-key + value: "{{.config.apiKey}}" + responseTemplate: + body: | + { + "forecasts": + {{- range $index, $item := .list }} + { + "date": "{{$item.dt_txt}}", + "description": "{{ (index $item.weather0).description}}", + "temp_min": {{$item.main.temp_min}}, + "temp_max": {{$item.main.temp_max}}, + "humidity": {{$item.main.humidity}}, + "wind_speed": {{$item.wind.speed}}, + "city": "{{$.args.city}}" + }{{if not $index.last}},{{end}} + {{- end }} + + }