Token导航 LogoToken导航TokenDH.com
Higress OPS MCP Server logo
开发工具stdio官方级别未说明来源级核验

Higress OPS MCP Server

MCP Server

A Model Context Protocol (MCP) server implementation that enables comprehensive configuration and management of Higress.

工具数

0

提示词数

0

GitHub Stars

22

资源数

0
API网关配置管理Python本地部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

higress-group

提供方

higress-group

最后核验

2026/5/18 03:28

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run client.py

详细介绍

Higress OPS MCP服务器

演示

https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7

配置环境变量

复制 .env.example 文件到 .env 并填写相应的值。

启动MCP客户端和MCP服务器

在stdio模式下,MCP服务器进程由MCP客户端程序启动。运行以下命令以启动MCP客户端和MCP服务器:

uv run client.py

添加新工具

步骤1:创建新的工具类或扩展现有的工具类

  • 如果添加一个全新的工具类别,请在工具目录中创建一个新文件
  • 或者,如果工具符合现有类别,则将其添加到现有类中
from typing import Dict, List, Any
from fastmcp import FastMCP

class YourTools:
    def register_tools(self, mcp: FastMCP):
        @mcp.tool()
        async def your_tool_function(arg1: str, arg2: int) -> List[Dict]:
            """
            Your tool description.
            
            Args:
                arg1: Description of arg1
                arg2: Description of arg2

            Returns:
                Description of the return value
            
            Raises:
                ValueError: If the request fails
            """
            # Implementation using self.higress_client to make API calls
            return self.higress_client.your_api_method(arg1, arg2)

步骤2:如果您的工具需要与Higress Console API交互,请向HigressClient添加一个新方法

  • 将封装API调用的方法添加到utils/higress_client.py
  • 使用现有的HTTP方法(get、put、post)进行实际的API通信
def your_api_method(self, arg1: str, arg2: int) -> List[Dict]:
    """
    Description of what this API method does.
    
    Args:
        arg1: Description of arg1
        arg2: Description of arg2
        
    Returns:
        Response data
        
    Raises:
        ValueError: If the request fails
    """
    path = "/v1/your/api/endpoint"
    data = {"arg1": arg1, "arg2": arg2}
    return self.put(path, data)  # or self.get(path) or self.post(path, data)

步骤3:在服务器中注册您的工具类

  • 将您的工具类添加到server.py中的tool_classes列表中
  • 此列表由ToolsRegister用于实例化和注册所有工具
  • ToolsRegister将自动设置记录器和highress_client属性
tool_classes = [
    CommonTools,
    RequestBlockTools,
    RouteTools,
    ServiceSourceTools,
    YourTools  # Add your tool class here
]

步骤4:将您的工具添加到 SENSITIVE_TOOLS 如果需要人工确认

  • 此列表中的工具在执行前需要人工确认
# Define write operations that require human confirmation
SENSITIVE_TOOLS = [
    "add_route", 
    "add_service_source",
    "update_route",
    "update_request_block_plugin", 
    "update_service_source",
    "your_tool_function"  # Add your tool name here if it requires confirmation
]

目录标签

目录标签

API网关配置管理Python本地部署developer-toolsMCP协议LangChain集成

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP