Resolve library dependency pings/metrics/tags in MCP server#2325
Merged
Resolve library dependency pings/metrics/tags in MCP server#2325
Conversation
The MCP server previously only queried an app's own probeinfo endpoints, missing metrics and pings defined by library dependencies (e.g. baseline ping from glean-core). Add dependency resolution that fetches library-variants mappings, resolves each app's dependencies to v1 API names, and merges library data with app data (app takes precedence). Also cache app-listings and library-variants for performance, and add comprehensive tests for dependency resolution edge cases.
4f69c37 to
dd8de97
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements library dependency resolution for the MCP (Model Context Protocol) server to include metrics, pings, and tags from library dependencies like glean-core. Previously, the MCP server only queried an app's own probeinfo endpoints, missing data defined by library dependencies.
Changes:
- Added dependency resolution that fetches library-variant mappings, resolves app dependencies to v1 API names, and merges library data with app data (with app data taking precedence)
- Implemented caching for library variants and app listings to optimize performance
- Added comprehensive test coverage for dependency resolution scenarios including edge cases
- Simplified virtual environment setup in netlify.toml build configuration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .netlify/mcp.js | Adds library dependency resolution system with caching, new helper functions to fetch and merge library data with app data, and cache clearing in initialize method |
| tests/mcp.test.js | Adds comprehensive test suite for library dependency resolution covering various scenarios including multiple dependencies, empty dependencies, unresolvable dependencies, precedence rules, and error handling |
| netlify.toml | Simplifies Python virtual environment setup by using python3 -m venv and pip3 directly instead of the more complex wget-based pip installation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This should fix the issue reported in https://mozilla.slack.com/archives/C07MNJ1Q3DW/p1770997453481839?thread_ts=1770294328.866299&cid=C07MNJ1Q3DW
The MCP server previously only queried an app's own probeinfo endpoints, missing metrics and pings defined by library dependencies (e.g. baseline ping from glean-core). This adds dependency resolution that fetches library-variants mappings, resolves each app's dependencies to v1 API names, and merges library data with app data.