@@ -11,12 +11,15 @@ This MCP server enables AI assistants (like Claude, Gemini, Cursor, and others)
1111- Go package layout follows the standard Go conventions:
1212 - ` cmd/kubernetes-mcp-server/ ` – main application entry point using Cobra CLI framework.
1313 - ` pkg/ ` – libraries grouped by domain.
14+ - ` api/ ` - API-related functionality, tool definitions, and toolset interfaces.
1415 - ` config/ ` – configuration management.
1516 - ` helm/ ` - Helm chart operations integration.
1617 - ` http/ ` - HTTP server and authorization middleware.
1718 - ` kubernetes/ ` - Kubernetes client management, authentication, and access control.
1819 - ` mcp/ ` - Model Context Protocol (MCP) server implementation with tool registration and STDIO/HTTP support.
1920 - ` output/ ` - output formatting and rendering.
21+ - ` toolsets/ ` - Toolset registration and management for MCP tools.
22+ - ` version/ ` - Version information management.
2023- ` .github/ ` – GitHub-related configuration (Actions workflows, issue templates...).
2124- ` docs/ ` – documentation files.
2225- ` npm/ ` – Node packages that wraps the compiled binaries for distribution through npmjs.com.
@@ -30,6 +33,21 @@ Implement new functionality in the Go sources under `cmd/` and `pkg/`.
3033The JavaScript (` npm/ ` ) and Python (` python/ ` ) directories only wrap the compiled binary for distribution (npm and PyPI).
3134Most changes will not require touching them unless the version or packaging needs to be updated.
3235
36+ ### Adding new MCP tools
37+
38+ The project uses a toolset-based architecture for organizing MCP tools:
39+
40+ - ** Tool definitions** are created in ` pkg/api/ ` using the ` ServerTool ` struct.
41+ - ** Toolsets** group related tools together (e.g., config tools, core Kubernetes tools, Helm tools).
42+ - ** Registration** happens in ` pkg/toolsets/ ` where toolsets are registered at initialization.
43+ - Each toolset lives in its own subdirectory under ` pkg/toolsets/ ` (e.g., ` pkg/toolsets/config/ ` , ` pkg/toolsets/core/ ` , ` pkg/toolsets/helm/ ` ).
44+
45+ When adding a new tool:
46+ 1 . Define the tool handler function that implements the tool's logic.
47+ 2 . Create a ` ServerTool ` struct with the tool definition and handler.
48+ 3 . Add the tool to an appropriate toolset (or create a new toolset if needed).
49+ 4 . Register the toolset in ` pkg/toolsets/ ` if it's a new toolset.
50+
3351## Building
3452
3553Use the provided Makefile targets:
@@ -105,6 +123,45 @@ make lint
105123
106124The ` lint ` target downloads the specified ` golangci-lint ` version if it is not already present under ` _output/tools/bin/ ` .
107125
126+ ## Additional Makefile targets
127+
128+ Beyond the basic build, test, and lint targets, the Makefile provides additional utilities:
129+
130+ ** Local Development:**
131+ ``` bash
132+ # Setup a complete local development environment with Kind cluster
133+ make local-env-setup
134+
135+ # Tear down the local Kind cluster
136+ make local-env-teardown
137+
138+ # Show Keycloak status and connection info (for OIDC testing)
139+ make keycloak-status
140+
141+ # Tail Keycloak logs
142+ make keycloak-logs
143+
144+ # Install required development tools (like Kind) to ./_output/bin/
145+ make tools
146+ ```
147+
148+ ** Distribution and Publishing:**
149+ ``` bash
150+ # Copy compiled binaries to each npm package
151+ make npm-copy-binaries
152+
153+ # Publish the npm packages
154+ make npm-publish
155+
156+ # Publish the Python packages
157+ make python-publish
158+
159+ # Update README.md with the latest toolsets
160+ make update-readme-tools
161+ ```
162+
163+ Run ` make help ` to see all available targets with descriptions.
164+
108165## Dependencies
109166
110167When introducing new modules run ` make tidy ` so that ` go.mod ` and ` go.sum ` remain tidy.
0 commit comments