Add batch component documentation MCP tool#8150
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 8d22cbf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new bounded bulk MCP tool to the Primer MCP server so agents can retrieve documentation for multiple @primer/react components in a single call, reducing the number of MCP round-trips while keeping per-component results independent.
Changes:
- Register a new
get_component_batchMCP tool that accepts 2–10 component names, deduplicates case-insensitively, and fetches docs concurrently with per-request timeouts. - Add a changeset to release
@primer/mcpas a minor version with the new tool.
Show a summary per file
| File | Description |
|---|---|
| packages/mcp/src/server.ts | Adds the get_component_batch tool implementation, including name deduplication, parallel fetch, and in-band partial error results. |
| .changeset/tidy-tools-fetch.md | Declares a minor bump for @primer/mcp to ship the new batch tool. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Low
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
joshblack
approved these changes
Jul 13, 2026
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.
Closes #
Agents currently need one MCP call per Primer React component when retrieving documentation. This adds a bounded bulk API that accepts 2 to 10 names and fetches their primer.style documentation concurrently in one server call.
The tool deduplicates names case-insensitively, preserves one content block per component, applies an independent 10 second timeout to each request, and reports missing components or fetch failures in-band so partial results remain useful.
The latency benefit over runtimes that already dispatch singular tool calls concurrently is marginal. In a five-component stdio MCP benchmark, median latency was 876 ms for sequential singular calls, 182 ms for parallel singular calls, and 179 ms for the batch call. The concrete benefit is fewer agent-visible MCP calls and consistent bounded partial-result behavior, not faster network completion than parallel singular calls.
Changelog
New
get_component_batchfor retrieving documentation for multiple Primer React components in one MCP call.Changed
N/A
Removed
N/A
Rollout strategy
Testing & Reviewing
Added an MCP package test project with five focused tests covering input bounds, exact and case-insensitive deduplication, parallel request startup, partial not-found and fetch-error results, timeout behavior, and timer cleanup. The behavior was also verified through the built stdio MCP server. The full repository build, 152 test files, type checks, lint checks, CSS lint checks, and formatting checks pass.