Skip to main content
Glama

Higress OPS MCP Server

Official

Higress OPS MCP 服务器

模型上下文协议 (MCP) 服务器实现,可实现对Higress的全面配置和管理。此存储库还提供了基于LangGraphLangChain MCP 适配器构建的 MCP 客户端,通过精心设计的代理流架构,方便与 Higress 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 添加一个新方法

  • 向 utils/higress_client.py 添加封装 API 调用的方法
  • 使用现有的 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 将自动设置 logger 和 higress_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 ]
-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器,通过精心设计的代理流架构实现对 Higress 的全面配置和管理。

  1. 演示
    1. 配置环境变量
      1. 启动 MCP 客户端和 MCP 服务器
        1. 添加新工具

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables AI models to perform real-time internet and knowledge searches through Higress, enhancing model responses with up-to-date information from Google, Bing, Arxiv, and internal knowledge bases.
            Last updated -
            1
            5
            Python
            Apache 2.0
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables integration with the TESS API, allowing users to list and manage agents, execute agents with custom messages, and manage files through natural language interfaces.
            Last updated -
            TypeScript
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that allows language models to manage Hetzner Cloud resources through structured functions, including servers, volumes, firewalls, and SSH keys.
            Last updated -
            33
            Python
            MIT License
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that provides a comprehensive interface to Alteryx Servers, enabling AI assistants to manage workflows, collections, users, schedules, credentials, and more.
            Last updated -
            43
            8
            Python

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/higress-group/higress-ops-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server