Higress API Gateway MCP server

Enables DevOps teams to manage Higress API gateway configurations through natural language commands with human-in-the-loop validation for sensitive operations
Back to servers
Provider
Higress Group
Release date
Mar 29, 2025
Language
Python
Stats
18 stars

The Higress OPS MCP Server implements the Model Context Protocol (MCP) to provide comprehensive configuration and management capabilities for Higress. It's paired with an MCP client built using LangGraph and LangChain MCP Adapters to enable interaction through a structured agent flow architecture.

Environment Setup

Before getting started, you need to configure your environment variables:

  1. Copy the example environment file to create your own:

    cp .env.example .env
    
  2. Edit the .env file and fill in the appropriate values for your setup.

Starting the Server

The MCP server operates in stdio mode, which means it's started by the MCP client program. To launch both the client and server:

uv run client.py

This command starts both the MCP client and server processes together.

Working with Tools

Available Tool Categories

The MCP server provides several tool categories for managing Higress:

  • Common Tools - General operations
  • Request Block Tools - Tools for managing request blocking rules
  • Route Tools - Tools for routing configuration
  • Service Source Tools - Tools for managing service sources

Tool Usage Examples

Each tool follows a standard pattern for invocation. For example, to manage routes:

# To get all routes
get_routes()

# To add a new route
add_route(name="example-route", domain="example.com", path="/api/*", ...)

The server will provide feedback and results for each tool execution.

Sensitive Operations

Certain operations like adding routes, updating service sources, and other write operations require human confirmation before execution. These tools include:

  • add_route
  • add_service_source
  • update_route
  • update_request_block_plugin
  • update_service_source

The system will prompt for confirmation before executing these sensitive operations.

Tool Descriptions

Common Tools

Tools for general Higress management operations.

Request Block Tools

Tools for configuring request blocking rules and policies.

Route Tools

Tools for managing inbound traffic routing rules, including domain routing, path-based routing, and traffic splitting.

Service Source Tools

Tools for managing backend service sources that Higress connects to.

Each tool is accessible through the MCP client interface and accepts specific parameters based on its function. The server provides detailed help information for each tool when requested.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later