
higress-group/higress-ops-mcp-server
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Model Context Protocol (MCP) 서버 구현은 Higress의 종합 구성과 관리를 가능하게 합니다.
개요
Model Context Protocol (MCP) 서버 구현은 Higress의 종합 구성과 관리를 가능하게 합니다. 이 저장소는 또한 LangGraph와 LangChain MCP 접합기의 정상에 건설된 MCP 클라이언트를, 잘 설계한 대리인 교류 건축술을 통해 Higress MCP 서버와 가진 상호 작용을 촉진합니다. https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7] [T0]] [T0]] [T0]] [T0]] [T0]] [T0]] [T0]] [T0] [T0] [T0]] [T0] [T0] [T0]] [T0]] [T0] [T0] [T0] [T0] [T0]] [T0] [T0]] [T0] [T0] [T0]] [T0]] [T0] [T0] [T0]] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]] [[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]] [[[[[[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]]]]]]]]] [[[[[[[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]]]]]]]]]]]]] [[[[[[[[[[[[[[[[[[[[[[ .env.example 파일을 .env로 복사하고 해당 값에 채웁니다. stdio 모드에서 MCP 서버 프로세스는 MCP 클라이언트 프로그램에 의해 시작된다. 다음 명령을 실행하여 MCP 클라이언트와 MCP 서버: - 도구 디렉토리에 새 파일을 작성하면 완전히 새로운 도구 범주를 추가합니다. 또는 기존 범주에 맞는 경우 기존 클래스에 도구 추가 - API 호출을 캡슐화하는 utils/higress client.py 메소드를 추가하십시오 - 실제 API 통신을위한 기존 HTTP 메소드 (get, put, post)를 사용하십시오. - 서버의 tool classes 목록에 도구 클래스를 추가하십시오.
개요(AI 번역)
Model Context Protocol (MCP) 서버 구현은 Higress의 종합 구성과 관리를 가능하게 합니다. 이 저장소는 또한 LangGraph와 LangChain MCP 접합기의 정상에 건설된 MCP 클라이언트를, 잘 설계한 대리인 교류 건축술을 통해 Higress MCP 서버와 가진 상호 작용을 촉진합니다.
데모
https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7] [T0]] [T0]] [T0]] [T0]] [T0]] [T0]] [T0]] [T0] [T0] [T0]] [T0] [T0] [T0]] [T0]] [T0] [T0] [T0] [T0] [T0]] [T0] [T0]] [T0] [T0] [T0]] [T0]] [T0] [T0] [T0]] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]] https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]] [[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]] [[[[[[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]]]]]]]]] [[[[[[[https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7]]]]]]]]]]]]]]]]]] [[[[[[[[[[[[[[[[[[[[[[
Config 환경 변수
.env.example]파일을 .env로 복사하고 해당 값에 기입합니다.
MCP 클라이언트 및 MCP 서버 시작
stdio 모드에서 MCP 서버 프로세스는 MCP 클라이언트 프로그램에 의해 시작된다. 다음 명령을 실행하여 MCP 클라이언트와 MCP 서버:
새 도구 추가
** 단계 1: 새로운 도구 클래스를 생성하거나 기존의 하나를 확장 **
- 도구 디렉토리에 새 파일을 작성하면 완전히 새로운 도구 범주를 추가하십시오.
- 또는 기존 범주에 맞는 경우 기존 클래스에 도구 추가
**Step 2: Higress Console API와 상호 작용해야 하는 경우 HigressClient에 새로운 메소드를 추가 **
- API 호출을 캡슐화하는 utils/higress client.py 메소드 추가
- 기존 HTTP 메소드(get, put, post)를 실제 API 통신에 사용
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
Higress OPS MCP Server
A Model Context Protocol (MCP) server implementation that enables comprehensive configuration and management of Higress. This repository also provides an MCP client built on top of LangGraph and LangChain MCP Adapters, facilitating interaction with the Higress MCP Server through a well-designed agent flow architecture.
Demo
https://github.com/user-attachments/assets/bae66b77-a158-452e-9196-98060bac0df7
Config Environment Variables
Copy the .env.example file to .env and fill in the corresponding values.
Start MCP Client and MCP Server
In stdio mode, the MCP server process is started by the MCP client program. Run the following command to start the MCP client and MCP server:
uv run client.py
Add a new tool
Step 1: Create a new tool class or extend an existing one
- Create a new file in the tools directory if adding a completely new tool category
- Or add your tool to an existing class if it fits an existing category
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)
Step 2: Add a new method to HigressClient if your tool needs to interact with the Higress Console API
- Add methods to utils/higress_client.py that encapsulate API calls
- Use the existing HTTP methods (get, put, post) for actual API communication
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)
Step 3: Register your tool class in the server
- Add your tool class to the tool_classes list in server.py
- This list is used by ToolsRegister to instantiate and register all tools
- The ToolsRegister will automatically set logger and higress_client attributes
tool_classes = [
CommonTools,
RequestBlockTools,
RouteTools,
ServiceSourceTools,
YourTools # Add your tool class here
]
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →