Skip to content

Conversation

arkadeepsen
Copy link

@arkadeepsen arkadeepsen commented Sep 17, 2025

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.

@arkadeepsen arkadeepsen force-pushed the k8s-layer branch 19 times, most recently from 0df8317 to 8f4c440 Compare September 19, 2025 09:48
Signed-off-by: arkadeepsen <arsen@redhat.com>
Signed-off-by: arkadeepsen <arsen@redhat.com>
Signed-off-by: arkadeepsen <arsen@redhat.com>
@arkadeepsen arkadeepsen changed the title Add kubernetes mcp server for ovnk debugging Add kubernetes layer for the ovnk mcp server Sep 19, 2025
{
"mcpServers": {
"ovn-kubernetes": {
"command": "/PATH-TO-THE-LOCAL-GIT-REPO/_output/ovnk-mcp-server",
Copy link

@Meina-rh Meina-rh Sep 22, 2025

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.

Comment on lines +13 to +17
gvk := schema.GroupVersionKind{
Group: group,
Version: version,
Kind: kind,
}

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"]

Copy link
Author

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"]

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 hints

MCP 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) {

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants