home / mcp / apisix mcp server

APISIX MCP Server

APISIX Model Context Protocol (MCP) server is used to bridge large language models (LLMs) with the APISIX Admin API.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "api7-apisix-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ],
      "env": {
        "APISIX_ADMIN_KEY": "your-apisix-api-key",
        "APISIX_SERVER_HOST": "your-apisix-server-host",
        "APISIX_SERVER_PORT": "your-apisix-server-port",
        "APISIX_ADMIN_API_PORT": "your-apisix-admin-api-port",
        "APISIX_ADMIN_API_PREFIX": "your-apisix-admin-api-prefix"
      }
    }
  }
}

APISIX MCP Server lets you interact with APISIX resources using natural language through MCP-compatible AI clients. You can view, create, update, and delete routes, services, upstreams, SSL certificates, and more, all via guided prompts without writing raw API calls. This server bridges conversational AI with the APISIX Admin API to streamline resource management and security configuration.

How to use

Connect your MCP client to the APISIX MCP Server and use natural language prompts to manage APISIX resources. You can ask it to retrieve resources by type, create or update routes and services, manage upstreams and SSL certificates, handle plugin configurations, and configure security-related data such as secrets and credentials. The server handles translating your intent into APISIX Admin API actions, returning results you can act on in your workflow.

How to install

Prerequisites you need before starting: Node.js and npm or pnpm, and access to your APISIX Admin API. Ensure APISIX is running and reachable from the machine where you install the MCP server.

Option 1: Install via npm/npx (recommended for quick setup) to run the MCP server locally.

Run the MCP server with the following configuration. This example uses npx to start the MCP server and passes the required environment variables for APISIX access.

{
  "mcpServers": {
    "apisix-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ],
      "env": {
        "APISIX_SERVER_HOST": "your-apisix-server-host",
        "APISIX_SERVER_PORT": "your-apisix-server-port",
        "APISIX_ADMIN_API_PORT": "your-apisix-admin-api-port",
        "APISIX_ADMIN_API_PREFIX": "your-apisix-admin-api-prefix",
        "APISIX_ADMIN_KEY": "your-apisix-api-key"
      }
    }
  }
}

Option 2: Install from source and run the server locally

Clone the MCP server repository, install dependencies, and build. Then start the server using Node with the built entry script.

git clone https://github.com/api7/apisix-mcp.git
cd apisix-mcp
pnpm install
pnpm build
```
```bash

Configure your AI client

Configure your MCP client to point to the local MCP server using one of the stdio configurations shown above. The client will send natural language requests, and the MCP server will translate them into APISIX Admin API calls.

Available tools

get_resource

Retrieve resources by type (routes, services, upstreams, etc.)

delete_resource

Remove resources by ID

send_request_to_gateway

Send requests to the APISIX gateway

create_route

Create a new route

update_route

Update an existing route

delete_route

Delete a route

create_service

Create a new service

update_service

Update an existing service

delete_service

Delete a service

create_upstream

Create a new upstream

update_upstream

Update an upstream

delete_upstream

Delete an upstream

create_ssl

Create an SSL certificate

update_ssl

Update an SSL certificate

delete_ssl

Delete an SSL certificate

create_or_update_proto

Manage protobuf definitions

create_or_update_stream_route

Manage stream routes

get_all_plugin_names

List all available plugin names

get_plugin_info

Get detailed plugin configuration information

get_plugins_by_type

Retrieve plugins by type

get_plugin_schema

Retrieve a plugin schema

create_plugin_config

Create plugin configuration

update_plugin_config

Update plugin configuration

create_global_rule

Create a global rule for plugins

update_global_rule

Update a global rule for plugins

get_plugin_metadata

Get plugin metadata

create_or_update_plugin_metadata

Create or update plugin metadata

delete_plugin_metadata

Delete plugin metadata

get_secret_by_id

Retrieve a secret by ID

create_secret

Create a secret

update_secret

Update a secret

create_or_update_consumer

Create or update a consumer

delete_consumer

Delete a consumer

get_credential

Get consumer credential

create_or_update_credential

Create or update a consumer credential

delete_credential

Delete a consumer credential

create_consumer_group

Create a consumer group

delete_consumer_group

Delete a consumer group