A Model Context Protocol (MCP) server that generates Kuadrant policy manifests in YAML format. Designed to work alongside Kubernetes MCP servers like mcp-server-kubernetes for applying resources to clusters.
# Add the MCP server using Docker (available in all projects)
claude mcp add kuadrant docker run -i --rm ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -s user
# Verify installation
claude mcp list
# Start using
claude # Start new session, type /mcp to see available servers
This MCP server generates Kuadrant-specific Kubernetes manifests:
- Gateway resources with Kuadrant annotations
- HTTPRoute configurations
- Kuadrant policies (DNS, TLS, RateLimit, Auth)
All manifests are generated in YAML format, matching the actual Kuadrant CRD specifications.
go install github.com/jasonmadigan/kuadrant-mcp-server@latest
The server is available as a Docker image from GitHub Container Registry:
docker pull ghcr.io/jasonmadigan/kuadrant-mcp-server:latest
git clone https://github.com/jasonmadigan/kuadrant-mcp-server
cd kuadrant-mcp-server
docker build -t kuadrant-mcp-server:latest .
The server supports multiple transport protocols:
- stdio (default) - Standard input/output for CLI integration
- sse - Server-Sent Events for web-based clients
- http - Streamable HTTP for modern web applications
kuadrant-mcp-server
kuadrant-mcp-server -transport sse -addr :8080
kuadrant-mcp-server -transport http -addr :8080
Using the pre-built image from GitHub Container Registry:
docker run -i --rm ghcr.io/jasonmadigan/kuadrant-mcp-server:latest
docker run -i --rm -p 8080:8080 ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -transport sse -addr :8080
docker run -i --rm -p 8080:8080 ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -transport http -addr :8080
docker-compose up
Using the pre-built Docker image:
{
"mcpServers": {
"kuadrant": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/jasonmadigan/kuadrant-mcp-server:latest"]
}
}
}
Or if running the binary directly:
{
"mcpServers": {
"kuadrant": {
"command": "/path/to/kuadrant-mcp-server"
}
}
}
{
"mcpServers": {
"kuadrant-mcp": {
"url": "http://localhost:8080",
"transport": "streamablehttp" // or "sse" for SSE transport
}
}
}
The MCP server provides comprehensive documentation and examples through resources:
kuadrant://docs/gateway-api
- Gateway API overview and Kuadrant integrationkuadrant://docs/dnspolicy
- Complete DNSPolicy reference with exampleskuadrant://docs/ratelimitpolicy
- RateLimitPolicy patterns and advanced usagekuadrant://docs/authpolicy
- AuthPolicy authentication and authorization methodskuadrant://docs/tlspolicy
- TLSPolicy certificate management guide
kuadrant://examples/basic-setup
- Simple API with rate limiting and API key authkuadrant://examples/production-setup
- Full production setup with TLS, DNS, JWT auth
kuadrant://troubleshooting
- Common issues, debugging techniques, and solutions
Access these resources in Claude by asking questions like:
- "Show me the Kuadrant rate limiting documentation"
- "How do I set up production TLS with Kuadrant?"
- "Help me troubleshoot my AuthPolicy not working"
Note: Claude may not always use resources automatically. To ensure resource usage:
- Be specific about wanting documentation or examples
- Reference Kuadrant policies by name (e.g., "RateLimitPolicy", "AuthPolicy")
- Ask for "complete examples" or "troubleshooting guide"
Generate a Gateway manifest with Kuadrant annotations.
Arguments:
name
(required): Gateway namenamespace
(required): NamespacegatewayClassName
: Gateway class (default: "istio")listeners
: Array of listener configurationskuadrantEnabled
: Enable Kuadrant annotations (default: true)
Example Output:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
annotations:
kuadrant.io/policy: enabled
name: prod-gateway
namespace: production
spec:
gatewayClassName: istio
listeners:
- name: https
port: 443
protocol: HTTPS
hostname: "*.example.com"
Generate an HTTPRoute manifest.
Arguments:
name
(required): Route namenamespace
(required): NamespaceparentRefs
(required): Parent gateway referenceshostnames
: List of hostnamesrules
: Routing rules
Example Output:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: api-route
namespace: production
spec:
parentRefs:
- name: prod-gateway
hostnames:
- api.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /api
backendRefs:
- name: api-service
port: 8080
Generate a Kuadrant DNSPolicy manifest.
Arguments:
name
(required): Policy namenamespace
(required): NamespacetargetRef
(required): Target resource referenceproviderRefs
(required): DNS provider referencesloadBalancing
: Load balancing configurationhealthCheck
: Health check configuration
Example Output:
apiVersion: kuadrant.io/v1
kind: DNSPolicy
metadata:
name: prod-dns
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: prod-gateway
providerRefs:
- name: aws-dns-credentials
loadBalancing:
defaultGeo: true
weight: 100
geo: US
healthCheck:
path: /health
failureThreshold: 3
interval: 5min
Generate a Kuadrant TLSPolicy manifest (v1alpha1).
Arguments:
name
(required): Policy namenamespace
(required): NamespacetargetRef
(required): Target resource referenceissuerRef
(required): Certificate issuer referencecommonName
: Certificate common nameduration
: Certificate durationrenewBefore
: Renew before expiry
Example Output:
apiVersion: kuadrant.io/v1alpha1
kind: TLSPolicy
metadata:
name: prod-tls
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: prod-gateway
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
name: letsencrypt-prod
commonName: "*.example.com"
duration: 90d
renewBefore: 15d
Generate a Kuadrant RateLimitPolicy manifest.
Arguments:
name
(required): Policy namenamespace
(required): NamespacetargetRef
(required): Target resource referencelimits
: Rate limit configurations (each limit must have arates
array withlimit
andwindow
fields)defaults
: Default rate limitsoverrides
: Override rate limits
Important: Rate limits must use the format:
{
"limit-name": {
"rates": [
{
"limit": 100,
"window": "60s" // Use time units: s, m, h (e.g., "10s", "5m", "1h")
}
]
}
}
Example Output:
apiVersion: kuadrant.io/v1
kind: RateLimitPolicy
metadata:
name: api-limit
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: api-route
limits:
"global":
rates:
- limit: 5
window: 10s
"per-user":
rates:
- limit: 2
window: 10s
when:
- predicate: "auth.identity.userid == 'bob'"
Generate a Kuadrant AuthPolicy manifest.
Arguments:
name
(required): Policy namenamespace
(required): NamespacetargetRef
(required): Target resource referencerules
: Authentication and authorization rulesdefaults
: Default auth rulesoverrides
: Override auth rules
Example Output:
apiVersion: kuadrant.io/v1
kind: AuthPolicy
metadata:
name: api-auth
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: api-route
rules:
authentication:
jwt-auth:
jwt:
issuerUrl: https://auth.example.com
authorization:
api-users:
opa:
rego: |
allow = true {
input.auth.identity.groups[_] == "api-users"
}
For a complete Kubernetes workflow, you can combine this server with the Kubernetes MCP server.
# Install globally
npm install -g @flux159/mcp-server-kubernetes
# Or use directly with npx
npx @flux159/mcp-server-kubernetes
The Kubernetes MCP server will:
- Automatically use your
~/.kube/config
- Connect to your current kubectl context
- Provide tools for managing Kubernetes resources
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
:
Using Docker (recommended):
{
"mcpServers": {
"kuadrant": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/jasonmadigan/kuadrant-mcp-server:latest"]
},
"kubernetes": {
"command": "npx",
"args": ["@flux159/mcp-server-kubernetes"]
}
}
}
Or using the binary directly:
{
"mcpServers": {
"kuadrant": {
"command": "/path/to/kuadrant-mcp-server"
},
"kubernetes": {
"command": "npx",
"args": ["@flux159/mcp-server-kubernetes"]
}
}
}
# Add Kuadrant server
claude mcp add kuadrant /path/to/kuadrant-mcp-server -s user
# Add Kubernetes server
claude mcp add kubernetes npx @flux159/mcp-server-kubernetes -s user
To prevent destructive operations, run the Kubernetes server in safe mode:
# In Claude Desktop config:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["@flux159/mcp-server-kubernetes"],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "true"
}
}
}
}
# Or with Claude Code CLI:
ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true npx @flux159/mcp-server-kubernetes
With both servers configured, you can:
-
Generate and Deploy:
Create a production gateway using Kuadrant and deploy it to my Kubernetes cluster
-
Create Complete Setup:
Create a Gateway with TLS and rate limiting policies, then apply them all to the production namespace in my Kubernetes cluster
-
Check Status:
Show me all Gateways and their associated Kuadrant policies in my Kubernetes cluster
User: Create a production API gateway with HTTPS and rate limiting, then deploy it
Assistant will:
- Use kuadrant MCP to generate Gateway manifest
- Use kuadrant MCP to generate RateLimitPolicy
- Use kubernetes MCP to apply both manifests
- Use kubernetes MCP to verify deployment status
Here's a complete example setting up a Gateway with all policies:
- Generate Gateway
# Generated output:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: api-route
namespace: production
spec:
parentRefs:
- name: api-gateway
hostnames:
- api.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /v1
backendRefs:
- name: api-v1
port: 8080
- Generate DNSPolicy
# Generated output:
apiVersion: kuadrant.io/v1
kind: DNSPolicy
metadata:
name: api-dns
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: api-gateway
providerRefs:
- name: route53-credentials
- Generate RateLimitPolicy
# Generated output:
apiVersion: kuadrant.io/v1
kind: RateLimitPolicy
metadata:
name: api-ratelimit
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: api-route
limits:
"global":
rates:
- limit: 10
window: 60s
- Generate AuthPolicy
# Generated output:
apiVersion: kuadrant.io/v1
kind: AuthPolicy
metadata:
name: api-auth
namespace: production
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: api-route
rules:
authentication:
jwt:
jwt:
issuerUrl: https://auth.example.com/realms/api
- Gateway/HTTPRoute:
gateway.networking.k8s.io/v1
- DNSPolicy:
kuadrant.io/v1
- TLSPolicy:
kuadrant.io/v1alpha1
- RateLimitPolicy:
kuadrant.io/v1
- AuthPolicy:
kuadrant.io/v1
git clone https://github.com/jasonmadigan/kuadrant-mcp-server
cd kuadrant-mcp-server
go build -o kuadrant-mcp-server
To use this server with Claude Code CLI:
# Add using Docker image
claude mcp add kuadrant docker run -i --rm ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -s user
# Verify installation
claude mcp list
# Start using
claude # Start new session, type /mcp to see available servers
-
Build the server
go build -o kuadrant-mcp-server
-
Add to Claude Code
claude mcp add kuadrant /path/to/kuadrant-mcp-server
For example:
claude mcp add kuadrant /Users/yourusername/kuadrant-mcp-server/kuadrant-mcp-server
-
Verify installation
claude mcp list
-
Test in Claude Start a new Claude session and type:
/mcp
You should see "kuadrant" listed. Then try:
Create a Gateway manifest named 'test-gateway' in namespace 'default'
If /mcp
shows "No MCP servers configured":
- Make sure you're in the same directory where you ran
claude mcp add
(for project/local scope) - The MCP configuration scopes are:
local
: Private to you in the current project (default)user
: Available to you in all projectsproject
: Shared with all users in the current project
- Try adding with the full absolute path
- Check the server is executable:
chmod +x kuadrant-mcp-server
- Start a new Claude session after adding the server
To see when Claude uses your MCP server:
-
Use the logging wrapper script:
chmod +x run_with_logging.sh claude mcp remove kuadrant -s local claude mcp add kuadrant /path/to/kuadrant-mcp-server/run_with_logging.sh
-
Monitor the logs:
tail -f /tmp/kuadrant-mcp.log
After setting up the MCP server, test it with these commands in Claude:
-
Verify MCP tools are available in Claude:
/mcp
You should see "kuadrant" listed. Then check what tools it provides:
What tools does the kuadrant MCP server provide?
-
Monitor the logs (in a separate terminal):
tail -f /tmp/kuadrant-mcp.log
-
Test with natural language commands in Claude:
# Gateway creation Create a Kuadrant Gateway named 'api-gateway' in the 'gateway-system' namespace with HTTPS enabled and apply this in my Kubernetes cluster with the kubernetes tool # HTTPRoute creation Create an HTTPRoute named 'api-routes' in namespace 'gateway-system' that routes traffic from gateway 'api-gateway' to service 'api-backend' on port 8080 and apply this in my Kubernetes cluster with the kubernetes tool # Rate limiting Create a RateLimitPolicy that limits requests to 100 per minute for the HTTPRoute 'api-routes' in namespace 'gateway-system' and apply this in my Kubernetes cluster with the kubernetes tool # Per-user rate limiting Create a RateLimitPolicy for HTTPRoute 'api-routes' that allows 5 requests per 10 seconds for user 'alice' and 2 requests per 10 seconds for user 'bob' and apply this in my Kubernetes cluster with the kubernetes tool # Authentication Create an AuthPolicy for HTTPRoute 'api-routes' that requires JWT authentication from issuer 'https://auth.example.com' and apply this in my Kubernetes cluster with the kubernetes tool # DNS management Create a DNSPolicy for gateway 'api-gateway' using AWS Route53 credentials 'route53-creds' with multi-region load balancing and apply this in my Kubernetes cluster with the kubernetes tool # TLS certificates Create a TLSPolicy for gateway 'api-gateway' using Let's Encrypt to get a wildcard certificate for '*.example.com' and apply this in my Kubernetes cluster with the kubernetes tool
With Kubernetes integration:
Create a production API gateway with rate limiting of 50 requests per minute and deploy it to my Kubernetes cluster with the kubernetes tool Generate a complete Kuadrant setup with Gateway, HTTPRoute, rate limiting, and JWT auth for my API, then apply it to the 'gateway-system' namespace in my Kubernetes cluster with the kubernetes tool
-
Common real-world scenarios:
E-commerce API protection:
I need to protect my e-commerce API. Create a Gateway with rate limiting that allows regular users 100 requests per minute but gives premium users 1000 requests per minute and apply this in my Kubernetes cluster
Multi-tenant SaaS platform:
Set up a Gateway for my SaaS platform with different rate limits per tenant: - Free tier: 10 requests per minute - Pro tier: 100 requests per minute - Enterprise: unlimited Then apply this configuration to my Kubernetes cluster
Public API with authentication:
Create a public API gateway that requires API key authentication and limits each API key to 50 requests per second and deploy it to my Kubernetes cluster
Complete production setup:
Set up a production-ready API gateway with: - HTTPS using Let's Encrypt certificates - JWT authentication from Auth0 - Rate limiting of 1000 requests per hour per user - DNS managed by Route53 Then deploy everything to my Kubernetes cluster
-
What you should see in the logs:
[KUADRANT MCP] Starting server with transport=stdio [KUADRANT MCP] create_gateway called with name=api-gateway, namespace=production [KUADRANT MCP] create_httproute called with name=api-route, namespace=production [KUADRANT MCP] create_ratelimitpolicy called with name=api-route, namespace=production
If you don't see logs:
- Type
/mcp
in Claude - verify "kuadrant" is listed - Make sure you started a new Claude session after adding the server
- Try being more explicit: "Use the kuadrant MCP server to create a Gateway"
RateLimitPolicy format errors:
If you get errors like "unknown field spec.limits.xxx.rates[0].duration", make sure your rate limits use the correct format:
✅ Correct:
rates:
- limit: 100
window: 60s # or "1m", "5m", "1h", etc.
❌ Incorrect:
rates:
- limit: 100
duration: 60
unit: second
To use this server with an MCP client (like Claude Desktop), add it to your MCP configuration:
Using the pre-built Docker image:
{
"mcpServers": {
"kuadrant": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/jasonmadigan/kuadrant-mcp-server:latest"]
}
}
}
Or if running the binary locally:
{
"mcpServers": {
"kuadrant": {
"command": "/path/to/kuadrant-mcp-server"
}
}
}
Apache 2.0