# APISIX MCP server

> Lets AI clients view and manage APISIX gateway resources such as routes, services, upstreams, plugins, and secrets via the Admin API.

- Repository: https://github.com/api7/apisix-mcp
- Page: https://hostedmcp.org/servers/api7/apisix-mcp
- Transport: stdio
- Stars: 38
- License: Apache-2.0

## Install

### Claude Code

```sh
claude mcp add apisix-mcp -- npx -y apisix-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "apisix-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "apisix-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"apisix-mcp","type":"stdio","command":"npx","args":["-y","apisix-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "apisix-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add apisix-mcp -- npx -y apisix-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.apisix-mcp]
command = "npx"
args = ["-y", "apisix-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user apisix-mcp npx -- -y apisix-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "apisix-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "apisix-mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `APISIX_ADMIN_API_PORT` | no | no |  |
| `APISIX_ADMIN_API_PREFIX` | no | no |  |
| `APISIX_ADMIN_KEY` | no | no |  |
| `APISIX_SERVER_HOST` | no | no |  |
| `APISIX_SERVER_PORT` | no | no |  |

## Tools (32)

- `get_resource`: Get resource details by ID or list all resources
- `delete_resource`: Delete a resource by ID
- `send_request_to_gateway`: Send a request or multiple requests to the APISIX gateway
- `create_route`: Create a route
- `update_route`: Update specific attributes of an existing route
- `create_service`: Create a service
- `update_service`: Update specific attributes of an existing service
- `create_upstream`: Create an upstream service with load balancing settings
- `update_upstream`: Update specific attributes of an existing upstream
- `create_or_update_consumer`: Create a consumer, if the consumer already exists, it will be updated
- `get_credential`: Get all credentials or a specific credential for a consumer
- `create_or_update_credential`: Create or update a credential for a consumer
- `delete_credential`: Delete a credential for a consumer
- `create_ssl`: Create an SSL certificate
- `update_ssl`: Update specific attributes of an existing SSL certificate
- `create_global_rule`: Create a global rule
- `update_global_rule`: Update specific attributes of an existing global rule
- `create_consumer_group`: Create a consumer group
- `update_consumer_group`: Update specific attributes of an existing consumer group
- `get_all_plugin_names`: Get all plugin names
- `get_plugin_schema`: Get all plugins schema or a specific plugin schema by name
- `get_plugin_metadata`: Get metadata for a specific plugin
- `create_plugin_config`: Create a new plugin config
- `update_plugin_config`: Update a plugin config
- `create_or_update_plugin_metadata`: Create or update plugin metadata
- `delete_plugin_metadata`: Delete plugin metadata
- `create_or_update_stream_route`: Create a stream route, if the stream route already exists, it will be updated
- `get_secret_by_id`: Get a secret by ID
- `create_secret`: Create a secret
- `update_secret`: Update specific attributes of an existing secret
- `delete_secret`: Delete a secret by ID
- `create_or_update_proto`: Create a proto, if the proto already exists, it will be updated

## FAQ

### What is the APISIX MCP server used for?

It bridges large language models with the APISIX Admin API so MCP-compatible AI clients can view and manage APISIX resources in natural language.

### How do I configure the APISIX MCP server in my AI client?

Add an mcpServers entry using npx -y apisix-mcp and set environment variables for the APISIX host, ports, prefix, and admin key.

### What environment variables does apisix-mcp require?

It uses APISIX_SERVER_HOST, APISIX_SERVER_PORT, APISIX_ADMIN_API_PORT, APISIX_ADMIN_API_PREFIX, and APISIX_ADMIN_KEY.

### Can it manage APISIX routes and services?

Yes, it provides tools to create, update, and delete routes, services, upstreams, SSL certificates, and stream routes.

### Does apisix-mcp support managing plugins?

Yes, it can list plugin names and retrieve plugin info, schemas, configs, global rules, and metadata.
