Skip to content

Comments

feat(endpoint): support remote MCP server#44

Merged
macrat merged 13 commits intov0.18from
feat/mcp-server
Nov 17, 2025
Merged

feat(endpoint): support remote MCP server#44
macrat merged 13 commits intov0.18from
feat/mcp-server

Conversation

@macrat
Copy link
Owner

@macrat macrat commented Nov 17, 2025

No description provided.

Copy link
Contributor

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 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
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 90.82969% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.61%. Comparing base (dc3011e) to head (2979451).
⚠️ Report is 2 commits behind head on v0.18.

Files with missing lines Patch % Lines
internal/endpoint/mcp.go 91.78% 13 Missing and 5 partials ⚠️
cmd/ayd/server.go 50.00% 2 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

macrat and others added 3 commits November 17, 2025 15:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

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

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.

Copy link
Contributor

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

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.

@macrat macrat merged commit b9a313a into v0.18 Nov 17, 2025
11 checks passed
@macrat macrat deleted the feat/mcp-server branch November 17, 2025 09:07
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.

1 participant