Skip to content

feat: add mcp server#119

Merged
MacroPower merged 23 commits intomainfrom
feat/mcp
Aug 24, 2025
Merged

feat: add mcp server#119
MacroPower merged 23 commits intomainfrom
feat/mcp

Conversation

@MacroPower
Copy link
Copy Markdown
Owner

@MacroPower MacroPower commented Aug 21, 2025

See docs/mcp.md for details.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 72.32704% with 220 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.20%. Comparing base (c67e0b5) to head (bab45a3).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
pkg/mcp/server.go 70.61% 58 Missing and 9 partials ⚠️
pkg/command/runner.go 69.84% 52 Missing and 5 partials ⚠️
pkg/ui/ui.go 0.00% 36 Missing ⚠️
pkg/log/log.go 7.14% 13 Missing ⚠️
pkg/mcp/tool_get_resource.go 90.08% 7 Missing and 5 partials ⚠️
pkg/ui/menu/menu.go 0.00% 12 Missing ⚠️
pkg/command/command.go 78.37% 8 Missing ⚠️
pkg/kube/object.go 0.00% 7 Missing ⚠️
pkg/command/static.go 77.27% 5 Missing ⚠️
pkg/mcp/mcp.go 90.62% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   46.73%   49.20%   +2.46%     
==========================================
  Files          53       58       +5     
  Lines        7012     7650     +638     
==========================================
+ Hits         3277     3764     +487     
- Misses       3606     3739     +133     
- Partials      129      147      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MacroPower MacroPower requested a review from Copilot August 24, 2025 17:50
@MacroPower MacroPower marked this pull request as ready for review August 24, 2025 17:50

This comment was marked as outdated.

@MacroPower MacroPower requested a review from Copilot August 24, 2025 19:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive MCP (Model Context Protocol) server implementation to kat, enabling AI agents to programmatically interact with Kubernetes manifests through structured APIs.

  • Adds MCP server with list_resources and get_resource tools for AI interaction
  • Implements distributed tracing support with OpenTelemetry for debugging and observability
  • Refactors command execution to use context-aware patterns throughout the codebase

Reviewed Changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/mcp/*.go New MCP server implementation with tools for listing and retrieving Kubernetes resources
pkg/ui/ui.go Updates UI event handling to support new MCP events and context-aware command execution
pkg/command/*.go Refactors command runner to use context and adds new event types for MCP integration
pkg/log/log.go Adds context-aware logging with trace ID support for distributed tracing
internal/cli/run.go Integrates MCP server startup and OpenTelemetry tracing configuration
docs/mcp.md Documentation for MCP server usage and security considerations
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MacroPower MacroPower force-pushed the feat/mcp branch 5 times, most recently from c5c088f to 4798f28 Compare August 24, 2025 20:07
@MacroPower MacroPower merged commit 6bbf781 into main Aug 24, 2025
5 checks passed
@MacroPower MacroPower deleted the feat/mcp branch August 24, 2025 21:16
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