Add get-code-ref-statistics MCP tool for Code References API#81
Open
akashanand708 wants to merge 1 commit into
Open
Add get-code-ref-statistics MCP tool for Code References API#81akashanand708 wants to merge 1 commit into
akashanand708 wants to merge 1 commit into
Conversation
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.
Related issues
Link any issue tracking this feature (e.g., a ticket requesting Code References API support in the MCP server).
Describe the solution you've provided
Added a new
get-code-ref-statisticsMCP tool that exposes the LaunchDarkly Code References statistics API (GET /api/v2/code-refs/statistics/{projectKey}). The tool returns the number of repositories and code references for each feature flag in a project, with an optionalflagKeyfilter to scope results to a single flag.New files added:
src/funcs/codeReferencesGetStatistics.ts— core API call implementationsrc/mcp-server/tools/codeReferencesGetStatistics.ts— MCP tool definition with description and scopesrc/models/components/coderefstatisticsrep.ts— Zod schemas forStatisticRepandStatisticCollectionRepresponse typessrc/models/operations/getcoderefstatistics.ts— request schema and serialization helpersModified:
src/mcp-server/server.ts— registered the new toolsrc/models/components/index.tsandsrc/models/operations/index.ts— exported new typesDescribe alternatives you've considered
No meaningful alternatives — this is a straightforward addition following the existing tool pattern already used by
codeReferencesListRepositoriesand other tools in the server.Additional context
The tool is particularly useful for flag cleanup workflows: before archiving or removing a flag, consumers can call this tool to verify the flag has zero remaining code references across all repositories.