APISIX-MCP

Official
by api7

create_or_update_stream_route

Define and manage stream routes in the APISIX-MCP server by creating new routes or updating existing ones with specific configurations, ensuring efficient traffic handling.

Instructions

Create a stream route, if the stream route already exists, it will be updated

Input Schema

NameRequiredDescriptionDefault
idNostream route id
routeYesstream route configuration

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "id": { "description": "stream route id", "type": "string" }, "route": { "additionalProperties": true, "description": "stream route configuration", "properties": { "desc": { "description": "stream route description", "maxLength": 256, "type": "string" }, "plugins": { "additionalProperties": {}, "description": "plugins", "type": "object" }, "protocol": { "additionalProperties": false, "properties": { "conf": { "additionalProperties": {}, "description": "protocol-specific configuration", "type": "object" }, "logger": { "items": { "additionalProperties": false, "properties": { "conf": { "additionalProperties": {}, "description": "logger plugin configuration", "type": "object" }, "filter": { "description": "logger filter rules", "items": { "type": "string" }, "type": "array" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "name": { "type": "string" }, "superior_id": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "remote_addr": { "anyOf": [ { "$ref": "#/properties/route/properties/server_addr/anyOf/0" }, { "$ref": "#/properties/route/properties/server_addr/anyOf/1" }, { "$ref": "#/properties/route/properties/server_addr/anyOf/2" }, { "$ref": "#/properties/route/properties/server_addr/anyOf/3" } ], "description": "client IP" }, "server_addr": { "anyOf": [ { "description": "IPv4", "format": "ipv4", "type": "string" }, { "description": "IPv4/CIDR", "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\/([12]?[0-9]|3[0-2])$", "type": "string" }, { "description": "IPv6", "format": "ipv6", "type": "string" }, { "description": "IPv6/CIDR", "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?\\/[0-9]{1,3}$", "type": "string" } ], "description": "server IP" }, "server_port": { "description": "server port", "type": "number" }, "service_id": { "description": "service id", "type": "string" }, "sni": { "description": "SNI", "type": "string" }, "upstream": { "additionalProperties": true, "description": "upstream service configuration object", "properties": { "checks": { "additionalProperties": false, "description": "health check configuration", "properties": { "active": { "additionalProperties": false, "description": "active health check configuration", "properties": { "healthy": { "additionalProperties": false, "properties": { "interval": { "description": "check interval for healthy status", "type": "number" }, "successes": { "description": "success count threshold", "type": "number" } }, "type": "object" }, "host": { "description": "host for health check", "type": "string" }, "http_path": { "description": "HTTP path for health check", "type": "string" }, "https_verify_certificate": { "description": "verify HTTPS certificate", "type": "boolean" }, "port": { "description": "port for health check", "type": "number" }, "timeout": { "description": "timeout for health check", "type": "number" }, "unhealthy": { "additionalProperties": false, "properties": { "http_failures": { "description": "HTTP failure count threshold", "type": "number" }, "interval": { "description": "check interval for unhealthy status", "type": "number" } }, "type": "object" } }, "type": "object" }, "passive": { "additionalProperties": false, "description": "passive health check configuration", "properties": { "healthy": { "additionalProperties": false, "properties": { "http_statuses": { "description": "HTTP status codes for healthy state", "items": { "type": "number" }, "type": "array" }, "successes": { "description": "success count threshold", "type": "number" } }, "type": "object" }, "unhealthy": { "additionalProperties": false, "properties": { "http_failures": { "description": "HTTP failure count threshold", "type": "number" }, "http_statuses": { "description": "HTTP status codes for unhealthy state", "items": { "type": "number" }, "type": "array" }, "timeout": { "description": "timeout threshold", "type": "number" } }, "type": "object" } }, "type": "object" } }, "type": "object" }, "desc": { "description": "upstream description", "maxLength": 256, "type": "string" }, "hash_on": { "description": "hash on type for chash algorithm", "enum": [ "vars", "header", "cookie", "consumer", "vars_combinations" ], "type": "string" }, "keepalive_pool": { "additionalProperties": false, "description": "keepalive pool configuration", "properties": { "idle_timeout": { "default": 60, "description": "idle timeout", "type": "number" }, "requests": { "default": 1000, "description": "requests", "type": "number" }, "size": { "default": 320, "description": "size", "type": "number" } }, "type": "object" }, "key": { "description": "hash key for chash algorithm", "type": "string" }, "labels": { "additionalProperties": { "type": "string" }, "description": "upstream labels", "type": "object" }, "name": { "description": "upstream name", "type": "string" }, "nodes": { "description": "upstream nodes with weights", "items": { "additionalProperties": false, "properties": { "host": { "description": "upstream host", "type": "string" }, "port": { "description": "upstream port", "type": "number" }, "priority": { "description": "upstream priority", "minimum": 0, "type": "number" }, "weight": { "description": "upstream weight", "minimum": 0, "type": "number" } }, "required": [ "host", "port" ], "type": "object" }, "type": "array" }, "pass_host": { "default": "pass", "description": "host passing mode", "enum": [ "pass", "node", "rewrite" ], "type": "string" }, "retries": { "description": "retry count", "minimum": 0, "type": "number" }, "retry_timeout": { "description": "retry timeout", "minimum": 0, "type": "number" }, "scheme": { "default": "http", "description": "upstream scheme", "enum": [ "http", "https", "grpc", "grpcs", "tcp", "tls", "udp", "kafka" ], "type": "string" }, "timeout": { "additionalProperties": false, "description": "timeout configuration", "properties": { "connect": { "description": "connection timeout in seconds", "type": "number" }, "read": { "description": "read timeout in seconds", "type": "number" }, "send": { "description": "send timeout in seconds", "type": "number" } }, "type": "object" }, "tls": { "additionalProperties": false, "description": "TLS configuration", "properties": { "client_cert": { "description": "TLS certificate", "type": "string" }, "client_cert_id": { "description": "TLS certificate id", "items": { "type": "string" }, "type": "array" }, "client_key": { "description": "TLS key", "type": "string" }, "verify": { "description": "TLS verification", "type": "boolean" } }, "type": "object" }, "type": { "default": "roundrobin", "description": "load balancing algorithm", "enum": [ "roundrobin", "chash", "ewma", "least_conn" ], "type": "string" }, "upstream_host": { "description": "upstream host for rewrite mode", "type": "string" } }, "type": "object" }, "upstream_id": { "description": "upstream id", "type": "string" } }, "required": [ "server_addr", "server_port" ], "type": "object" } }, "required": [ "route" ], "type": "object" }
ID: s62o271u37