Merged
Conversation
- Implements a function to fetch pod logs with configurable options, including tail line limits, timestamps, and stream size constraints. - Adds helper `splitLogLines` function to process log content into lines.
- Implements a function to fetch pod logs with configurable options, such as container, timestamps, tail lines, and more.
- Introduces `GetPodLogs`, enabling retrieval of pod logs with configurable options. - Adds `PodLogsOptions` and `PodLogsResponse` types for log retrieval parameters and responses.
- Adds `GetPodLogsInput` type for customizable log retrieval parameters. - Registers `get_pod_logs` as an MCP tool for debugging Kubernetes services. - Implements `handleGetPodLogs` to fetch logs via Kubernetes discovery.
- Introduce `GetPodLogs` mock methods in test files for Kubernetes discovery. - Add unit tests for `handleGetPodLogs` to verify functionality with various scenarios.
- Introduces `ListPods`, `GetPod`, and `GetEndpoints` for Kubernetes resource discovery. - Implements `GetEvents` to fetch Kubernetes events with customizable options. - Adds helper functions for pod conversion and formatting.
- Implements `ListPods`, `GetPod`, `GetEvents`, and `GetEndpoints` methods for pod, event, and endpoint discovery. - Registers `list_pods`, `get_pod`, `get_events`, and `get_endpoints` MCP tools to provide detailed resource and event diagnostics for Kubernetes namespaces. - Adds supporting types like `ListPodsOptions`, `GetEventsOptions`, `K8sPod`, and `K8sEndpoints` for better resource representation and filtering.
- Adds `ListPods`, `GetPod`, `GetEvents`, and `GetEndpoints` mocks to support KubernetesDiscovery testing. - Updates test files to include mock resource discovery for enhanced coverage.
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (24.42%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #350 +/- ##
==========================================
- Coverage 63.79% 61.85% -1.95%
==========================================
Files 69 69
Lines 10936 11583 +647
==========================================
+ Hits 6977 7165 +188
- Misses 3681 4124 +443
- Partials 278 294 +16
🚀 New features to boost your workflow:
|
- Add tests for handleListPods, handleGetPod, handleGetEvents, handleGetEndpoints - Add tests for handleListContexts, handleGetAnalysis, handleGetQuickStatus, handleGetHistory - Add tests for splitLogLines and formatDuration helper functions - Add tests for KubernetesDiscoveryAdapter pod/event/endpoint methods with nil manager This improves patch coverage from 59.8% to 65.2% for fwdmcp package. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update .fossa.yml to use the correct v3 format: - Use 'targets: only:' instead of 'analyze: types:' - Specify 'type: go' to analyze only Go modules - This should exclude Python/pip documentation dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expands MCP server capabilities with comprehensive Kubernetes read operations for debugging and discovery.
Description
This PR addresses a significant gap in the MCP server: the inability to inspect Kubernetes resources beyond forwarded services. Previously, users could not list pods, check pod status, view events, or debug startup failures through the MCP interface.
New MCP Tools (5 tools)
get_pod_logslist_podsget_podget_eventsget_endpointsComplete MCP Tool Inventory (29 tools)
Forwarding Management (7):
add_namespace,remove_namespace,add_service,remove_servicereconnect_service,reconnect_all_errors,sync_serviceService Discovery (7):
list_services,get_service,find_serviceslist_k8s_namespaces,list_k8s_services,list_contextsget_connection_info,list_hostnamesPod Operations (5) - NEW:
list_pods,get_pod,get_pod_logs,get_events,get_endpointsMonitoring & Diagnostics (10):
get_health,get_quick_status,get_metrics,get_http_trafficget_analysis,diagnose_errors,get_logs,get_historyUse Case Examples
Now Claude Desktop (or any MCP client) can:
Debug a failing service:
list_podswith service_name filterget_podfor detailed statusget_eventsfor scheduling/pulling/startup eventsInvestigate pod issues:
get_pod_logsget_pod_logswith previous=trueget_podwith container detailsVerify service routing:
get_endpointsshows ready vs not-ready addressesType of Change
Testing
go test ./...locallygo test -race ./...locallygolangci-lint run ./...with 0 issuesChecklist
Files Changed
New Types Added
ListPodsOptions,K8sPod,K8sPodDetailK8sContainerInfo,K8sContainerPort,K8sResourceRequire,K8sPodConditionGetEventsOptions,K8sEventK8sEndpoints,K8sEndpointSubset,K8sEndpointAddress,K8sEndpointPort