Skip to content

Add kernel MCP tools#17

Merged
tssurya merged 1 commit intoovn-kubernetes:mainfrom
arghosh93:kernel-layer
Dec 18, 2025
Merged

Add kernel MCP tools#17
tssurya merged 1 commit intoovn-kubernetes:mainfrom
arghosh93:kernel-layer

Conversation

@arghosh93
Copy link
Contributor

@arghosh93 arghosh93 commented Dec 2, 2025

Implements MCP tools for inspecting kernel level networking configurations:

  • get-conntrack: retrieves connection tracking entries from a Kubernetes node.
  • get-iptables: retrieves iptables/ip6tables rules from a Kubernetes node.
  • get-nft: retrieves nftables configuration from a Kubernetes node.
  • get-ip: executes 'ip' utility commands on a node.

--> ovn-kubernetes - get-ip (MCP)(node: "worker-2.shrocp4upi420ovn.lab.upshift.rdu2.redhat.com", image: "registry.redhat.io/rhel9/support-tools", command: "route show")
⎿ {
"data": "default via 10.0.95.254 dev br-ex proto dhcp src 10.0.93.147 metric 48 \n10.0.88.0/21 dev br-ex proto kernel scope link src 10.0.93.147 me
tric 48 \n10.128.0.0/14 via 10.131.0.1 dev ovn-k8s-mp0 \n10.131.0.0/23 dev ovn-k8s-mp0 proto kernel scope link src 10.131.0.2 \n169.254.0.0/17 dev br
… +3 lines (ctrl+o to expand)

--> ● ovn-kubernetes - get-nft (MCP)(node: "worker-2.shrocp4upi420ovn.lab.upshift.rdu2.redhat.com", image: "registry.redhat.io/rhel9/support-tools", command: "list tables")
⎿ {
"data": "table ip filter\ntable ip mangle\ntable ip6 mangle\ntable ip nat\ntable ip6 nat\ntable ip6 filter\ntable ip raw\ntable ip6 raw\ntable inet
ovn-kubernetes\n"
}

@arghosh93 arghosh93 force-pushed the kernel-layer branch 3 times, most recently from 6ec6936 to fe88d1f Compare December 4, 2025 07:51
Copy link
Contributor

@arkadeepsen arkadeepsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments after first round of review.

@arghosh93 arghosh93 force-pushed the kernel-layer branch 5 times, most recently from 301e6e5 to 7e8a3fe Compare December 9, 2025 13:00
Copy link
Contributor

@pperiyasamy pperiyasamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arghosh93
Copy link
Contributor Author

I rebased on the Main branch after @pperiyasamy's LGTM. There was one merge conflict at cmd/main.go which occurred as Peri's OVS MCP PR merged meanwhile.

Copy link
Contributor

@arkadeepsen arkadeepsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress. I have a few more comments below.

Copy link
Contributor

@arkadeepsen arkadeepsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. Only a few remaining comments.

Comment on lines 146 to 147
- xfrm state show : show Security Association Database.
- xfrm policy show : show Security Policy Database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- xfrm state show : show Security Association Database.
- xfrm policy show : show Security Policy Database.
- xfrm state list : list Security Association Database.
- xfrm policy list : list Security Policy Database.

Comment on lines 41 to 42
// FilterParameters are invalid with -S command
cmd.addIf(in.FilterParameters != "" && in.Command != "-S", strings.Fields(in.FilterParameters)...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// FilterParameters are invalid with -S command
cmd.addIf(in.FilterParameters != "" && in.Command != "-S", strings.Fields(in.FilterParameters)...)
// FilterParameters are invalid with -S/--list-rules command
cmd.addIf(in.FilterParameters != "" && in.Command != "-S" && in.Command != "--list-rules", strings.Fields(in.FilterParameters)...)

Both -S and --list-rules are needed to be checked here.

Implements MCP tools for inspecting kernel level networking
configurations:
- get-conntrack: retrieves connection tracking entries from a Kubernetes node.
- get-iptables: retrieves iptables/ip6tables rules from a Kubernetes node.
- get-nft: retrieves nftables configuration from a Kubernetes node.
- get-ip: executes 'ip' utility commands on a node.

Signed-off-by: Arnab Ghosh <arnabghosh89@gmail.com>
Copy link
Contributor

@arkadeepsen arkadeepsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tssurya tssurya merged commit bb4e39b into ovn-kubernetes:main Dec 18, 2025
3 checks passed
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.

4 participants