Skip to content

Remove legacy documentation fallback for mcp get_component tool#7710

Open
adierkens wants to merge 2 commits intomainfrom
adierkens/mcp-docs
Open

Remove legacy documentation fallback for mcp get_component tool#7710
adierkens wants to merge 2 commits intomainfrom
adierkens/mcp-docs

Conversation

@adierkens
Copy link
Copy Markdown
Contributor

Changelog

Changed

  • Updates the mcp get_component tool to remove the fallback to the normal docs site.

Rollout strategy

  • Patch release

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: f160fa8

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 Patch

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

@adierkens adierkens marked this pull request as ready for review March 28, 2026 02:23
@adierkens adierkens requested a review from a team as a code owner March 28, 2026 02:23
Copy link
Copy Markdown
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

Removes the legacy HTML-docs scraping fallback from the @primer/mcp get_component tool so it only serves llms.txt-based component documentation from primer.style, and otherwise returns an error.

Changes:

  • Update get_component to fetch llms.txt only and drop the “regular documentation” fallback.
  • Add a changeset for a patch release of @primer/mcp.
  • Update package-lock.json workspace/version references for @primer/react (38.16.0 → 38.17.0).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/mcp/src/server.ts Removes HTML fallback behavior for get_component and returns an error when llms.txt cannot be served.
package-lock.json Updates lockfile entries reflecting @primer/react version 38.17.0.
.changeset/swift-ads-matter.md Adds patch changeset documenting removal of the legacy docs fallback.

Comment on lines 154 to +157
return {
content: [
{
type: 'text',
text: `Here is the documentation for the \`${name}\` component from the @primer/react package:
${text}`,
},
],
isError: true,
errorMessage: `There was an error fetching documentation for ${name}. Ensure the component exists.`,
content: [],
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The final error message is misleading now that the component is already validated (match exists). This path can also happen when llms.txt is simply missing (e.g. 404) rather than a fetch/processing error, so “Ensure the component exists” and “error fetching documentation” are inaccurate. Consider returning a message that explicitly states that llms.txt documentation is unavailable for this component (and optionally include llmsResponse.status/statusText or treat 404 separately) so tool consumers understand what failed.

Copilot uses AI. Check for mistakes.
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.

2 participants