Remove legacy documentation fallback for mcp get_component tool#7710
Remove legacy documentation fallback for mcp get_component tool#7710
get_component tool#7710Conversation
🦋 Changeset detectedLatest commit: f160fa8 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 |
There was a problem hiding this comment.
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_componentto fetchllms.txtonly and drop the “regular documentation” fallback. - Add a changeset for a patch release of
@primer/mcp. - Update
package-lock.jsonworkspace/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. |
| 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: [], |
There was a problem hiding this comment.
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.
Changelog
Changed
mcpget_componenttool to remove the fallback to the normal docs site.Rollout strategy