Skip to content

Commit 6b53cbd

Browse files
committed
claude tool setup
Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
1 parent c5b663c commit 6b53cbd

File tree

4 files changed

+477
-199
lines changed

4 files changed

+477
-199
lines changed

README.md

Lines changed: 199 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
A Model Context Protocol (MCP) server that generates Kuadrant policy manifests in YAML format. Designed to work alongside Kubernetes MCP servers like [k8s-mcp-server](https://github.com/reza-gholizade/k8s-mcp-server) or [mcp-kubernetes](https://mcp.so/server/mcp-kubernetes/) for applying resources to clusters.
44

5+
## Quick Start (Claude Code CLI)
6+
7+
```bash
8+
# Clone and build
9+
git clone https://github.com/jasonmadigan/kuadrant-mcp-server
10+
cd kuadrant-mcp-server
11+
go build -o kuadrant-mcp-server
12+
13+
# Add to Claude Code (project-scoped)
14+
claude mcp add kuadrant ./kuadrant-mcp-server
15+
16+
# Or add for your user (available in all projects)
17+
claude mcp add kuadrant $(pwd)/kuadrant-mcp-server -s user
18+
19+
# Verify and use
20+
claude mcp list
21+
claude # Start new session, type /mcp to see available servers
22+
```
23+
524
## Overview
625

726
This MCP server generates Kuadrant-specific Kubernetes manifests:
@@ -32,25 +51,56 @@ docker build -t kuadrant-mcp-server:latest .
3251

3352
## Usage
3453

54+
### Transport Options
55+
56+
The server supports multiple transport protocols:
57+
58+
1. **stdio** (default) - Standard input/output for CLI integration
59+
2. **sse** - Server-Sent Events for web-based clients
60+
3. **http** - Streamable HTTP for modern web applications
61+
3562
### Standalone
63+
64+
#### Using stdio transport (default)
3665
```bash
3766
kuadrant-mcp-server
3867
```
3968

69+
#### Using SSE transport
70+
```bash
71+
kuadrant-mcp-server -transport sse -addr :8080
72+
```
73+
74+
#### Using StreamableHTTP transport
75+
```bash
76+
kuadrant-mcp-server -transport http -addr :8080
77+
```
78+
4079
### With Docker
80+
81+
#### stdio transport
4182
```bash
4283
docker run -i --rm ghcr.io/jasonmadigan/kuadrant-mcp-server:latest
4384
```
4485

86+
#### SSE transport
87+
```bash
88+
docker run -i --rm -p 8080:8080 ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -transport sse -addr :8080
89+
```
90+
91+
#### StreamableHTTP transport
92+
```bash
93+
docker run -i --rm -p 8080:8080 ghcr.io/jasonmadigan/kuadrant-mcp-server:latest -transport http -addr :8080
94+
```
95+
4596
### With Docker Compose
4697
```bash
4798
docker-compose up
4899
```
49100

50101
### MCP Client Configuration
51102

52-
Add to your MCP client configuration:
53-
103+
#### For stdio transport (Claude Desktop, CLI tools)
54104
```json
55105
{
56106
"mcpServers": {
@@ -62,6 +112,18 @@ Add to your MCP client configuration:
62112
}
63113
```
64114

115+
#### For HTTP transports (web applications)
116+
```json
117+
{
118+
"mcpServers": {
119+
"kuadrant-mcp": {
120+
"url": "http://localhost:8080",
121+
"transport": "streamablehttp" // or "sse" for SSE transport
122+
}
123+
}
124+
}
125+
```
126+
65127
## Available Tools
66128

67129
### `create_gateway`
@@ -443,6 +505,141 @@ docker-compose build
443505
docker-compose run --rm kuadrant-mcp
444506
```
445507

508+
## Claude Code CLI Setup
509+
510+
To use this server with Claude Code CLI:
511+
512+
1. **Build the server**
513+
```bash
514+
go build -o kuadrant-mcp-server
515+
```
516+
517+
2. **Add to Claude Code**
518+
```bash
519+
claude mcp add kuadrant /path/to/kuadrant-mcp-server
520+
```
521+
522+
For example:
523+
```bash
524+
claude mcp add kuadrant /Users/yourusername/kuadrant-mcp-server/kuadrant-mcp-server
525+
```
526+
527+
3. **Verify installation**
528+
```bash
529+
claude mcp list
530+
```
531+
532+
4. **Test in Claude**
533+
Start a new Claude session and type:
534+
```
535+
/mcp
536+
```
537+
538+
You should see "kuadrant" listed. Then try:
539+
```
540+
Create a Gateway manifest named 'test-gateway' in namespace 'default'
541+
```
542+
543+
### Troubleshooting
544+
545+
If `/mcp` shows "No MCP servers configured":
546+
- Make sure you're in the same directory where you ran `claude mcp add` (for project/local scope)
547+
- The MCP configuration scopes are:
548+
- `local`: Private to you in the current project (default)
549+
- `user`: Available to you in all projects
550+
- `project`: Shared with all users in the current project
551+
- Try adding with the full absolute path
552+
- Check the server is executable: `chmod +x kuadrant-mcp-server`
553+
- Start a new Claude session after adding the server
554+
555+
### Enable Logging (Optional)
556+
557+
To see when Claude uses your MCP server:
558+
559+
1. Use the logging wrapper script:
560+
```bash
561+
chmod +x run_with_logging.sh
562+
claude mcp remove kuadrant -s local
563+
claude mcp add kuadrant /path/to/kuadrant-mcp-server/run_with_logging.sh
564+
```
565+
566+
2. Monitor the logs:
567+
```bash
568+
tail -f /tmp/kuadrant-mcp.log
569+
```
570+
571+
### Testing Your Installation
572+
573+
After setting up the MCP server, test it with these commands in Claude:
574+
575+
1. **Verify MCP tools are available** in Claude:
576+
```
577+
/mcp
578+
```
579+
580+
You should see "kuadrant" listed. Then check what tools it provides:
581+
```
582+
What tools does the kuadrant MCP server provide?
583+
```
584+
585+
2. **Monitor the logs** (in a separate terminal):
586+
```bash
587+
tail -f /tmp/kuadrant-mcp.log
588+
```
589+
590+
3. **Test basic commands** in Claude:
591+
592+
```
593+
# Basic Gateway creation
594+
Use the kuadrant MCP server's create_gateway tool to generate a manifest with name 'api-gateway' in namespace 'production'
595+
596+
# HTTPRoute creation
597+
Use the create_httproute tool to generate a manifest for route 'api-route' in namespace 'production' with parentRef to gateway 'api-gateway'
598+
599+
# Rate limiting policy
600+
Use the create_ratelimitpolicy tool to generate a policy that limits to 100 requests per minute for HTTPRoute 'api-route' in namespace 'production'
601+
602+
# Authentication policy
603+
Use the create_authpolicy tool for JWT authentication on HTTPRoute 'api-route' in namespace 'production'
604+
605+
# DNS policy
606+
Use the create_dnspolicy tool for gateway 'api-gateway' in namespace 'production' with providerRef name 'aws-route53'
607+
608+
# TLS policy
609+
Use the create_tlspolicy tool for gateway 'api-gateway' with issuerRef 'letsencrypt-prod' in namespace 'production'
610+
```
611+
612+
Or use even more explicit commands:
613+
```
614+
Please call the kuadrant MCP server's create_gateway tool with these arguments:
615+
- name: "api-gateway"
616+
- namespace: "production"
617+
- gatewayClassName: "istio"
618+
- kuadrantEnabled: true
619+
```
620+
621+
4. **Test a complete setup**:
622+
```
623+
Using the kuadrant MCP tools, please:
624+
1. Call create_gateway for a Gateway named 'prod-api' in namespace 'production'
625+
2. Call create_httproute for route 'api-routes' routing to 'prod-api'
626+
3. Call create_ratelimitpolicy with 1000 requests per hour limit
627+
4. Call create_authpolicy for JWT authentication
628+
```
629+
630+
5. **What you should see in the logs**:
631+
```
632+
[KUADRANT MCP] Starting server with transport=stdio
633+
[KUADRANT MCP] create_gateway called with name=api-gateway, namespace=production
634+
[KUADRANT MCP] create_httproute called with name=api-route, namespace=production
635+
[KUADRANT MCP] create_ratelimitpolicy called with name=api-route, namespace=production
636+
```
637+
638+
If you don't see logs:
639+
- Type `/mcp` in Claude - verify "kuadrant" is listed
640+
- Make sure you started a new Claude session after adding the server
641+
- Try being more explicit: "Use the kuadrant MCP server to create a Gateway"
642+
446643
## MCP Configuration
447644

448645
To use this server with an MCP client (like Claude Desktop), add it to your MCP configuration:

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/jasonmadigan/kuadrant-mcp-server
22

3-
go 1.23
3+
go 1.23.0
4+
5+
toolchain go1.24.3
46

57
require (
68
github.com/modelcontextprotocol/go-sdk v0.1.0

0 commit comments

Comments
 (0)