KMCP CLI - #3
Conversation
| @@ -0,0 +1,676 @@ | |||
| # Template System Refactoring Plan | |||
There was a problem hiding this comment.
we can remove this file; it should now be resolved (for fastmcp)
| kmcp deploy --deploy-controller # Deploy controller | ||
| kmcp deploy --deploy-controller --controller-version 0.0.1 # Deploy controller with specific version | ||
| kmcp deploy --deploy-controller --controller-namespace my-namespace # Deploy controller to custom namespace | ||
| kmcp deploy --deploy-controller --registry-config ~/.docker/config.json # Specify docker registry config`, |
There was a problem hiding this comment.
I considered separating the controller deployment into a separate command but this felt a bit more compact happy to split it up if folks think otherwise.
|
|
||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "kagent.dev/kmcp/api/v1alpha1" | ||
| "github.com/onsi/ginkgo/v2" |
There was a problem hiding this comment.
I thought we were moving away from ginkgo in our projects but I wanted to check in with folks. I can refactor this to use the go test library
| // TODO: this var is currently required because the controller img is in a private registry but this may change | ||
| deployCmd.Flags().StringVar(&deployRegistryConfig, "registry-config", "", "Path to docker registry config file") |
There was a problem hiding this comment.
this is currently only needed because our image is in a private registry once we OSS the project this can be removed
| fmt.Printf("🚀 The tool will be automatically loaded when the server starts\n") | ||
|
|
||
| if addToolDescription != "" { | ||
| fmt.Printf("📋 Description: %s\n", addToolDescription) |
There was a problem hiding this comment.
not needed, because the description will be displayed a couple of lines above this one (if provideD)
There was a problem hiding this comment.
Thanks Peter, responding here because I am unable to tag you in a comment for some reason but I've addressed your feedback above.
MCP Go is provided as an option, but it's not implemented (it should be removed if it's not implemented yet)
I removed MCP Go as an option for now. We plan to follow up on this but it is currently not implemented cc @ilackarms
I didn't see Typescript/Nodejs as an option
After discussing with @ilackarms we wanted to start with python and go first which is why Typescript/NodeJs are currently not available options.
these notes that are displayed after the first step don't make sense -- we should display them at the end, once the user provides all information and the project is scaffolded:
FastMCP Python uses dynamic tool loading - no template selection needed!
Tools will be automatically discovered from the src/tools/ directory.
Use 'kmcp add-tool <name>' to add new tools after project creation.
Removed the first sentence i feel like its unnecessary and moved the last two lines to the end of the output after project is scaffolded.
an invalid tool.py file gets created when you run init:
Fixed. There was a templating issue. Also fixed a number of python lint issues detected by ruff.
the notes after init tell me how to run the server (uv run python src/main.py), but I was missing instructions on how to test it out locally (without deploying to k8s)
I added some additional instructions on using mcp inspector for local testing purposes after the project is scaffolded.
duplicated/similar output when building:
Deduped the output messages.
add-secret command fails:
I think the secrets implementation was too complicated for the current level of maturity of the CLI. Instead I opted to keep things simple and removed the existing secret commands and replaced it with one command create-k8s-secret-from-env which would create a kubernetes secret from a .env file and allow the user to deploy the mcp-server with the secret values loaded into the container using kmcp deploy mcp -f knowledge-assistant/kmcp.yaml --secrets knowledge-assistant/secrets/.env.yaml
generate k8s-secrets commands creates a weird output:
Yeah the original implementation didn't use yaml marshalling I fixed this.
I am not clear on the secrets command -- it talks about environments (there's no way to set/change the environment?); also shows the list of environment variables. Is this still in progress or?
As mentioned above I felt the secrets commands were a bit confusing. Opted to keep things simple for now as mentioned above.
the add-tool command automatically assumes Python - also some of the description in the output are perhaps too much:
I removed a bunch of the cruft, I haven't gotten to it yet but I think the kmcp.yaml also has a lot of unnecessary content that needs to be cleaned up but I might want to do that in a separate PR instead since this one's getting pretty big.
are "API tools" a specific concept that's different from the MCP tool, or is there another reason this is called out explicitly:
AFAIK its just an MCP Tool, @ilackarms maybe you can chime in here to confirm?
.env.example file is created automatically -- we should also create the .env.local file with the same values as the .env.example, since we're referencing that file in the kmcp.yaml
Added a .env.local file that gets generated by default
is there a reason we need python dependencies in the kmcp.yaml file?
Not exactly sure what the original intention was behind this. I'm guessing informational purposes? but I plan on going through this file and removing anything that isn't needed by the controller.
the generated README.md is broken (the ``` sections)
fixed!
There was a problem hiding this comment.
thanks for fixing all these!! I'll let @ilackarms approve from the code side as he probably has more context there. I'll check the UX later on as well and log additional issues if something looks off.
|
|
||
| Examples: | ||
| kmcp secrets create-k8s-secret-from-env .env.local | ||
| kmcp secrets create-k8s-secret-from-env .env.production --name my-app-secrets --namespace production | ||
| kmcp secrets create-k8s-secret-from-env .env.staging --output-dir secrets/ | ||
| kmcp secrets create-k8s-secret-from-env /your-mcp-server/.env --name secret --output-dir your-mcp-server/secrets/`, | ||
| Args: cobra.ExactArgs(1), | ||
| RunE: runCreateK8SecretFromEnv, |
There was a problem hiding this comment.
@ilackarms I removed the other add-secret, list-secret commands I found them to be not as useful given the current level of maturity of the CLI. I replaced the commands with create-k8s-secret-from-env that will take a .env and create a kubernetes secret that can be used alongside the kmcp deploy command ie: kmcp deploy mcp -f knowledge-assistant/kmcp.yaml --secrets knowledge-assistant/secrets/.env.yaml to deploy the mcp-server alongside the secret which will be loaded into the mcp-server container via envFrom
1762e04 to
f9c322b
Compare
* create kubebuilder base + put down api foundation * create foundation for kmcp translator * refactor api, support http server * fix build, regenerate * wire up controller, add api for targetport * fixes, get e2e test working * working e2e test * address pr feedback * bump golint action version * fix golangci config * remove unused files * fix linter, add http path
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
… infrastructure for template refactoring Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
…t from env file Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
…K8sSecretsCmd now that wecangenerate k8 secrets from .env files Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
… secrets cli commands Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
…date e2e tests Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>

kmcpthat allows users to create a mcp project and deploy it to the kubernetes clusterkmcpkmcpbinary to release pipelineDemo script that will create an mcp server with an echo tool deployed to kind which can be connected to using mcp inspector.
Last updated 7/23/25 -
setup-kind-demo.sh.zip