Skip to content

Add batch component documentation MCP tool#8150

Merged
lukasoppermann merged 4 commits into
mainfrom
lukasoppermann-add-component-batch-tool
Jul 13, 2026
Merged

Add batch component documentation MCP tool#8150
lukasoppermann merged 4 commits into
mainfrom
lukasoppermann-add-component-batch-tool

Conversation

@lukasoppermann

@lukasoppermann lukasoppermann commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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

  • Add get_component_batch for retrieving documentation for multiple Primer React components in one MCP call.

Changed

N/A

Removed

N/A

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

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.

lukasoppermann and others added 2 commits July 13, 2026 12:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 13, 2026 10:56
@lukasoppermann lukasoppermann requested a review from a team as a code owner July 13, 2026 10:56
@lukasoppermann lukasoppermann requested a review from TylerJDev July 13, 2026 10:56
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8d22cbf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/mcp Minor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_batch MCP tool that accepts 2–10 component names, deduplicates case-insensitively, and fetches docs concurrently with per-request timeouts.
  • Add a changeset to release @primer/mcp as 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

Comment thread packages/mcp/src/server.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@joshblack joshblack added the integration-tests: skipped manually Changes in this PR do not require an integration test label Jul 13, 2026
@lukasoppermann lukasoppermann added this pull request to the merge queue Jul 13, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 13, 2026
@lukasoppermann lukasoppermann added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit c261f95 Jul 13, 2026
61 checks passed
@lukasoppermann lukasoppermann deleted the lukasoppermann-add-component-batch-tool branch July 13, 2026 19:26
@primer primer Bot mentioned this pull request Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants