Skip to content

Commit 7a1db13

Browse files
committed
docs: refactor README.md with improved structure and formatting
- Enhanced introduction with clearer value proposition - Added emojis and better visual hierarchy - Reorganized sections with improved flow - Created structured tables for tool parameters - Added advanced features section with security highlights - Improved code examples and formatting - Streamlined installation and configuration sections
1 parent dfd6390 commit 7a1db13

File tree

1 file changed

+90
-91
lines changed

1 file changed

+90
-91
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 90 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,54 @@
22

33
[![tests](https://github.com/kkb0318/kubernetes-mcp/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/kkb0318/kubernetes-mcp/actions/workflows/test.yml)
44

5-
65
https://github.com/user-attachments/assets/89df70b0-65d1-461c-b4ab-84b2087136fa
76

8-
9-
A Model Context Protocol (MCP) server for Kubernetes debugging and inspection. This server provides read-only access to Kubernetes resources without the ability to create or modify them, making it safe for debugging and monitoring purposes.
7+
A Model Context Protocol (MCP) server that provides safe, read-only access to Kubernetes resources for debugging and inspection. Built with security in mind, it offers comprehensive cluster visibility without modification capabilities.
108

119
## Features
1210

13-
- **Read-only access**: Safely inspect Kubernetes resources without modification capabilities
14-
- **CRD support**: Works with any Custom Resource Definitions (CRDs) in your cluster
15-
- **Substring search**: Discover resources by API group substring (e.g., "flux" for FluxCD, "argo" for ArgoCD)
16-
- **Built-in tools**:
17-
- `list_resources`: List and filter Kubernetes resources
11+
- **πŸ”’ Read-only security**: Safely inspect Kubernetes resources without modification capabilities
12+
- **🎯 CRD support**: Works seamlessly with any Custom Resource Definitions in your cluster
13+
- **πŸ” Smart discovery**: Find resources by API group substring (e.g., "flux" for FluxCD, "argo" for ArgoCD)
14+
- **⚑ High performance**: Efficient resource querying with filtering and pagination
15+
- **πŸ› οΈ Comprehensive toolset**:
16+
- `list_resources`: List and filter Kubernetes resources with advanced options
1817
- `describe_resource`: Get detailed information about specific resources
19-
- `get_pod_logs`: Retrieve pod logs with advanced filtering
18+
- `get_pod_logs`: Retrieve pod logs with sophisticated filtering capabilities
2019

21-
## Installation
20+
## πŸš€ Quick Start
2221

2322
### Prerequisites
2423

25-
- Access to a Kubernetes cluster (kubeconfig required)
24+
- Kubernetes cluster access with a valid kubeconfig file
25+
- Go 1.24+ (for building from source)
2626

27-
### Option 1: Install with Go
27+
### Installation Options
2828

29-
If you have Go installed, this is the easiest way:
29+
#### Option 1: Install with Go (Recommended)
3030

3131
```bash
3232
go install github.com/kkb0318/kubernetes-mcp@latest
3333
```
3434

35-
The binary will be installed to `$GOPATH/bin/kubernetes-mcp` (or `$HOME/go/bin/kubernetes-mcp` if `GOPATH` is not set).
36-
37-
### Option 2: Build from source
38-
39-
If you prefer to build from source:
35+
The binary will be available at `$GOPATH/bin/kubernetes-mcp` (or `$HOME/go/bin/kubernetes-mcp` if `GOPATH` is not set).
4036

41-
**Requirements:**
42-
- Go 1.24 or later
37+
#### Option 2: Build from Source
4338

4439
```bash
4540
git clone https://github.com/kkb0318/kubernetes-mcp.git
4641
cd kubernetes-mcp
4742
go build -o kubernetes-mcp .
4843
```
4944

50-
## Usage
45+
## βš™οΈ Configuration
5146

52-
### Configuration
47+
### MCP Server Setup
5348

54-
To use this MCP server, add it to your configuration file:
49+
Add the server to your MCP configuration:
5550

56-
**Basic setup (uses ~/.kube/config automatically):**
51+
#### Basic Configuration
52+
Uses `~/.kube/config` automatically:
5753
```json
5854
{
5955
"mcpServers": {
@@ -64,14 +60,12 @@ To use this MCP server, add it to your configuration file:
6460
}
6561
```
6662

67-
**Replace `/path/to/kubernetes-mcp` with the actual path to your binary.**
68-
69-
**Custom kubeconfig location:**
63+
#### Custom Kubeconfig
7064
```json
7165
{
7266
"mcpServers": {
7367
"kubernetes": {
74-
"command": "/usr/local/bin/kubernetes-mcp",
68+
"command": "/path/to/kubernetes-mcp",
7569
"env": {
7670
"KUBECONFIG": "/path/to/your/kubeconfig"
7771
}
@@ -80,58 +74,62 @@ To use this MCP server, add it to your configuration file:
8074
}
8175
```
8276

77+
> **Note**: Replace `/path/to/kubernetes-mcp` with your actual binary path.
8378
84-
### Manual Usage
85-
86-
The server uses your default kubeconfig for cluster access. Ensure you have proper read permissions for the resources you want to inspect.
79+
### Standalone Usage
8780

8881
```bash
82+
# Default kubeconfig (~/.kube/config)
8983
./kubernetes-mcp
84+
85+
# Custom kubeconfig path
86+
KUBECONFIG=/path/to/your/kubeconfig ./kubernetes-mcp
9087
```
9188

92-
## Available Tools
89+
**Important**: Ensure you have appropriate read permissions for the Kubernetes resources you want to inspect.
9390

94-
### 1. `list_resources`
91+
## πŸ› οΈ Available Tools
9592

96-
List Kubernetes resources with filtering capabilities.
93+
### `list_resources`
94+
List and filter Kubernetes resources with advanced capabilities.
9795

98-
**Parameters:**
99-
- `kind` (required): Resource type (Pod, Deployment, Service, etc.) or "all" for discovery
100-
- `groupFilter` (optional): Filter by API group substring to discover project-specific resources
101-
- `namespace` (optional): Target namespace (defaults to all namespaces)
102-
- `labelSelector` (optional): Filter by labels (e.g., "app=nginx")
103-
- `fieldSelector` (optional): Filter by fields (e.g., "metadata.name=my-pod")
104-
- `limit` (optional): Maximum number of resources to return
105-
- `timeoutSeconds` (optional): Request timeout (default: 30s)
106-
- `showDetails` (optional): Return full resource objects instead of summary
96+
| Parameter | Type | Description |
97+
|-----------|------|-------------|
98+
| `kind` | **required** | Resource type (Pod, Deployment, Service, etc.) or "all" for discovery |
99+
| `groupFilter` | optional | Filter by API group substring for project-specific resources |
100+
| `namespace` | optional | Target namespace (defaults to all namespaces) |
101+
| `labelSelector` | optional | Filter by labels (e.g., "app=nginx") |
102+
| `fieldSelector` | optional | Filter by fields (e.g., "metadata.name=my-pod") |
103+
| `limit` | optional | Maximum number of resources to return |
104+
| `timeoutSeconds` | optional | Request timeout (default: 30s) |
105+
| `showDetails` | optional | Return full resource objects instead of summary |
107106

108-
**Example usage:**
107+
**Examples:**
109108
```json
109+
// List pods with label selector
110110
{
111111
"kind": "Pod",
112112
"namespace": "default",
113113
"labelSelector": "app=nginx"
114114
}
115-
```
116115

117-
**Discovery mode:**
118-
```json
116+
// Discover FluxCD resources
119117
{
120118
"kind": "all",
121119
"groupFilter": "flux"
122120
}
123121
```
124122

125-
### 2. `describe_resource`
126-
127-
Get detailed information about a specific resource.
123+
### `describe_resource`
124+
Get detailed information about a specific Kubernetes resource.
128125

129-
**Parameters:**
130-
- `kind` (required): Resource type
131-
- `name` (required): Resource name
132-
- `namespace` (optional): Target namespace
126+
| Parameter | Type | Description |
127+
|-----------|------|-------------|
128+
| `kind` | **required** | Resource type (Pod, Deployment, etc.) |
129+
| `name` | **required** | Resource name |
130+
| `namespace` | optional | Target namespace |
133131

134-
**Example usage:**
132+
**Example:**
135133
```json
136134
{
137135
"kind": "Pod",
@@ -140,58 +138,59 @@ Get detailed information about a specific resource.
140138
}
141139
```
142140

143-
### 3. `get_pod_logs`
144-
145-
Retrieve pod logs with various filtering options.
146-
147-
**Parameters:**
148-
- `name` (required): Pod name
149-
- `namespace` (optional): Pod namespace (defaults to "default")
150-
- `container` (optional): Specific container name
151-
- `tail` (optional): Number of lines from the end (default: 100)
152-
- `since` (optional): Duration like "5s", "2m", "3h"
153-
- `sinceTime` (optional): RFC3339 timestamp
154-
- `timestamps` (optional): Include timestamps
155-
- `previous` (optional): Get logs from previous container instance
156-
157-
**Example usage:**
141+
### `get_pod_logs`
142+
Retrieve pod logs with sophisticated filtering options.
143+
144+
| Parameter | Type | Description |
145+
|-----------|------|-------------|
146+
| `name` | **required** | Pod name |
147+
| `namespace` | optional | Pod namespace (defaults to "default") |
148+
| `container` | optional | Specific container name |
149+
| `tail` | optional | Number of lines from the end (default: 100) |
150+
| `since` | optional | Duration like "5s", "2m", "3h" |
151+
| `sinceTime` | optional | RFC3339 timestamp |
152+
| `timestamps` | optional | Include timestamps in output |
153+
| `previous` | optional | Get logs from previous container instance |
154+
155+
**Example:**
158156
```json
159157
{
160158
"name": "nginx-pod",
161159
"namespace": "default",
162160
"tail": 50,
163-
"since": "5m"
161+
"since": "5m",
162+
"timestamps": true
164163
}
165164
```
166165

167-
## Key Features
168-
169-
### CRD Support
166+
## 🌟 Advanced Features
170167

171-
The server automatically discovers and works with any Custom Resource Definitions in your cluster. Simply use the CRD's Kind name with the `list_resources` or `describe_resource` tools.
172-
173-
### Resource Discovery
168+
### 🎯 Custom Resource Definition (CRD) Support
169+
Automatically discovers and works with any CRDs in your cluster. Simply use the CRD's Kind name with `list_resources` or `describe_resource` tools.
174170

171+
### πŸ” Smart Resource Discovery
175172
Use the `groupFilter` parameter to discover resources by API group substring:
176173

177-
- `"flux"` - Discover FluxCD resources (HelmReleases, Kustomizations, etc.)
178-
- `"argo"` - Discover ArgoCD resources (Applications, AppProjects, etc.)
179-
- `"istio"` - Discover Istio resources (VirtualServices, DestinationRules, etc.)
180-
- `"cert-manager"` - Discover cert-manager resources (Certificates, Issuers, etc.)
174+
| Filter | Discovers | Examples |
175+
|--------|-----------|----------|
176+
| `"flux"` | FluxCD resources | HelmReleases, Kustomizations, GitRepositories |
177+
| `"argo"` | ArgoCD resources | Applications, AppProjects, ApplicationSets |
178+
| `"istio"` | Istio resources | VirtualServices, DestinationRules, Gateways |
179+
| `"cert-manager"` | cert-manager resources | Certificates, Issuers, ClusterIssuers |
181180

182-
### Safety First
181+
### πŸ”’ Security & Safety
182+
Built with security as a primary concern:
183+
- βœ… **Read-only access** - No resource creation, modification, or deletion
184+
- βœ… **Production safe** - Secure for use in production environments
185+
- βœ… **Minimal permissions** - Only requires read access to cluster resources
186+
- βœ… **No destructive operations** - Cannot harm your cluster
183187

184-
This server is designed for debugging and inspection only:
185-
- No resource creation, modification, or deletion capabilities
186-
- Read-only access to cluster resources
187-
- Safe to use in production environments for monitoring
188+
---
188189

189-
## Contributing
190+
## 🀝 Contributing
190191

191-
This project is open source and welcomes contributions. Please ensure all changes maintain the read-only nature of the server.
192+
We welcome contributions! Please ensure all changes maintain the read-only nature of the server and include appropriate tests.
192193

193-
## License
194+
## πŸ“„ License
194195

195196
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
196-
197-
## Support

0 commit comments

Comments
Β (0)