home / mcp / apisix mcp server
APISIX Model Context Protocol (MCP) server is used to bridge large language models (LLMs) with the APISIX Admin API.
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.
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.
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"
}
}
}
}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
```
```bashConfigure 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.
Retrieve resources by type (routes, services, upstreams, etc.)
Remove resources by ID
Send requests to the APISIX gateway
Create a new route
Update an existing route
Delete a route
Create a new service
Update an existing service
Delete a service
Create a new upstream
Update an upstream
Delete an upstream
Create an SSL certificate
Update an SSL certificate
Delete an SSL certificate
Manage protobuf definitions
Manage stream routes
List all available plugin names
Get detailed plugin configuration information
Retrieve plugins by type
Retrieve a plugin schema
Create plugin configuration
Update plugin configuration
Create a global rule for plugins
Update a global rule for plugins
Get plugin metadata
Create or update plugin metadata
Delete plugin metadata
Retrieve a secret by ID
Create a secret
Update a secret
Create or update a consumer
Delete a consumer
Get consumer credential
Create or update a consumer credential
Delete a consumer credential
Create a consumer group
Delete a consumer group