You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@
4
4
5
5
GreenNode MCP Servers provide AI assistants (Claude, Cursor, Gemini, etc.) with tools to manage GreenNode services via the Model Context Protocol.
6
6
7
-
-**Single server** — `greenode-mcp-server` covers all products via bundled OpenAPI specs
7
+
-**Single server** — `greenode-mcp-server` covers all VNG Cloud products via a spec registry (`docs.api.vngcloud.vn`, fetched at startup, cached at `~/.greenode/mcp-specs/`)
-**VKS API pagination is 0-based**: page 0 = first page
48
+
-**Pagination is 1-based across VNG Cloud APIs**: page 1 = first page (standard convention for all products)
47
49
-**API returns 202** for most successful operations (not 200)
50
+
-**List response wrapper keys vary**: `items`, `listData`, `data`, `results`, `records` — the formatter in `api_caller.py` recognises all of them
51
+
-**`{projectId}` / `{project_id}` path placeholders** are auto-substituted by `call_api` from `config.default_project_id` (set by `grn configure` or `GRN_DEFAULT_PROJECT_ID` env var)
52
+
-**K8s `api_version`** is optional for common kinds (Pod, Deployment, PVC, ...) via `COMMON_API_VERSIONS` in `k8s_handler.py`; custom resources still need it explicit
53
+
-**VKS kubeconfig endpoint** returns `{kubeConfig: "<yaml>", status: "ACTIVE"|"CREATING"|...}` — not raw YAML. `k8s_client_cache.py` extracts the `kubeConfig` field and checks `status`
48
54
49
55
## Adding a new tool (to existing server)
50
56
@@ -57,7 +63,7 @@ greenode-mcp/
57
63
58
64
## Adding a new MCP server (new product)
59
65
60
-
The greenode-mcp-server now covers all products via bundled OpenAPI specs, so adding a new product typically means adding a new spec file to `src/greenode-mcp-server/specs/` rather than creating a separate server.
66
+
The greenode-mcp-server covers all products via the spec registry (`docs.api.vngcloud.vn`). Adding a new product = VNG Cloud team publishes the product's OpenAPI page on the docs portal. The server picks it up on next restart — no code change, no release needed.
61
67
62
68
If a truly separate server is needed:
63
69
@@ -74,8 +80,10 @@ See `src/greenode-mcp-server/` as reference.
74
80
75
81
-**Input validation**: All resource IDs validated via `validators.validate_id()` before URL construction — prevents path traversal
76
82
-**Write guard**: Mutating operations must check `self.allow_write` flag
77
-
-**Sensitive data guard**: K8s Secret reads must check `self.allow_sensitive_data_access`
78
-
-**Credential env vars supported**: `GRN_ACCESS_KEY_ID`/`GRN_SECRET_ACCESS_KEY` override credentials file (highest priority)
83
+
-**Sensitive data guard**: Only K8s Secret reads check `self.allow_sensitive_data_access`. Pod logs and K8s events are NOT guarded — they're routine debug reads
@@ -96,7 +100,7 @@ See [GreenNode MCP Server](src/greenode-mcp-server/) as reference.
96
100
All GreenNode MCP servers share these security principles:
97
101
98
102
-**Read-only by default** — Write operations require explicit `--allow-write` flag
99
-
-**Sensitive data protection** — Kubernetes Secrets require`--allow-sensitive-data-access`
103
+
-**Sensitive data protection** — Reading Kubernetes Secrets requires`--allow-sensitive-data-access`; other K8s reads (pods, deployments, logs, events) are allowed by default
100
104
-**Credential security** — `~/.greenode/credentials` stored with `0600` permissions
101
105
-**Input validation** — All resource IDs validated to prevent path traversal
102
106
-**Token handling** — In memory only, never written to disk or logged
0 commit comments