Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a remote MCP (Model Context Protocol) server endpoint to enable AI tools like Claude or ChatGPT to analyze Ayd's monitoring status and logs. It also refactors version/commit variables into a separate meta package for better organization.
Key Changes:
- Implements MCP server endpoint with three tools: list_targets, query_status, and query_logs
- Refactors version and commit variables from main package to internal/meta package
- Adds comprehensive test coverage for MCP functionality with jq query filtering
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/meta/version.go | New package for version metadata (Version and Commit variables) |
| internal/endpoint/mcp.go | Core MCP server implementation with jq-based query filtering |
| internal/endpoint/mcp_test.go | Comprehensive test suite for MCP endpoints |
| internal/endpoint/endpoint.go | Registers new /mcp endpoint |
| cmd/ayd/server.go | Updates version references and adds graceful shutdown timeout |
| cmd/ayd/main.go | Updates version references to use meta package |
| README.md | Documents new MCP server endpoint and usage |
| Makefile | Updates ldflags to reference new meta package location |
| Dockerfile | Updates ldflags to reference new meta package location |
| .goreleaser.yml | Updates ldflags to reference new meta package location |
| go.mod | Adds dependencies for gojq and MCP SDK |
| go.sum | Updates dependency checksums |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix type assertion errors in MCP tests after MCPOutput.Result was changed to any type in mcp.go. The tests were failing with build errors: - cannot use output.Result as []any value: need type assertion - invalid argument: output.Result for built-in len - cannot index output.Result Changes: - Add google/go-cmp for precise value comparison - Replace all CheckResults functions with explicit WantResult values - Handle both single value and array results from jq queries - Simplify TestRecordToMapFields using cmp.Diff This makes tests more maintainable by eliminating custom verification logic and using declarative expected values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.18 #44 +/- ##
==========================================
+ Coverage 88.47% 88.61% +0.13%
==========================================
Files 74 75 +1
Lines 5337 5559 +222
==========================================
+ Hits 4722 4926 +204
- Misses 476 489 +13
- Partials 139 144 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.