-
Notifications
You must be signed in to change notification settings - Fork 3
Add kubernetes layer for the ovnk mcp server #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0df8317
to
8f4c440
Compare
Signed-off-by: arkadeepsen <arsen@redhat.com>
Signed-off-by: arkadeepsen <arsen@redhat.com>
8f4c440
to
4f1e222
Compare
Signed-off-by: arkadeepsen <arsen@redhat.com>
{ | ||
"mcpServers": { | ||
"ovn-kubernetes": { | ||
"command": "/PATH-TO-THE-LOCAL-GIT-REPO/_output/ovnk-mcp-server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe consider npx
command so we don’t need to build and reference _output
directly.
gvk := schema.GroupVersionKind{ | ||
Group: group, | ||
Version: version, | ||
Kind: kind, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which objects we must provide in different tools? for example, I test resource-get
, it hints
MCP error -32602: invalid params: validating "arguments": validating root: required: missing properties: ["group" "kind" "name"]
when I test resource-list
, it hints
MCP error -32602: invalid params: validating "arguments": validating root: required: missing properties: ["version" "kind"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which objects we must provide in different tools? for example, I test
resource-get
, it hintsMCP error -32602: invalid params: validating "arguments": validating root: required: missing properties: ["group" "kind" "name"]
The GetResourceParams
define the fields for the resource-get
tool. The fields which are not marked as omitempty
are required fields.
when I test
resource-list
, it hintsMCP error -32602: invalid params: validating "arguments": validating root: required: missing properties: ["version" "kind"]
The ListResourceParams
gives the details of the fields for the resource-list
tool.
) | ||
|
||
// GetResourceGVK gets a resource by group, version, kind, name and namespace. | ||
func (client *OVNKMCPServerClientSet) GetResourceGVK(group, version, kind, resourceName, namespace string) (*unstructured.Unstructured, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test to get CUDN resource using this tool, the output is
{
"resource": {
"age": "13s",
"data": "",
"name": "l2-network-cudn1"
}
}
should also print the status
of resources?
This PR adds the kubernetes layer of the ovnk mcp server.
Tools exposed:
pod-logs
: Fetches the logs of a container in a pod.resource-get
: Fetches a resource from kube api-server. Group, version and kind is needed from fetching the specific resource.resource-list
: Lists resources from kube api-server. Group, version and kind is needed from listing the resources of this kind.In addition to the above tools, pod exec and node debug is also supported as internal functions. These functions can be used by other layers of the MCP server for running necessary commands.
This PR also sets up the main entrypoint of the mcp server where the individual layers can be added to the main server.