You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP: get_component_examples and get_component_accessibility_guidelines still use the component id instead of the slug (home page returned for multi-word components) #8561
get_component_examples and get_component_accessibility_guidelines build the primer.style URL from the component id (for example text_input) instead of its slug (text-input). For multi-word components the wrong path does not 404: primer.style answers HTTP 200 with the home page, so both tools return the home page as if it were the component's examples or accessibility guidance.
#8530 fixed the same problem for get_component_usage_guidelines; these two calls were not changed. On main (e236683):
L256get_component_examples: new URL(`/product/components/${match.id}`, ...)
L390get_component_accessibility_guidelines: new URL(`/product/components/${match.id}/accessibility`, ...)
get_component (L141) and the usage tool after #8530 (L317) already use match.slug.
In @primer/react/generated/components.json, 43 of 80 component ids contain an underscore (action_list, icon_button, text_input, ...), so these two tools fail for about half of the components.
Suggested fix: use match.slug in both places. Because a wrong path returns 200, a guard on the response (for example, checking that the fetched page title names the component) would also catch future id/slug mismatches.
Steps to reproduce
Run npx @primer/mcp@1.1.0 and connect an MCP client.
Call get_component_accessibility_guidelines with {"name": "TextInput"}.
The text starts with the Primer home page ("The design system for GitHub") instead of the TextInput accessibility page.
Call get_component_examples with {"name": "TextInput"}: same result.
{"name": "Button"} works, because its id and slug are the same.
Direct check: https://primer.style/product/components/text_input/accessibility returns <title>Primer</title>, while https://primer.style/product/components/text-input/accessibility/ returns <title>Accessibility - TextInput | Primer</title>.
Version
@primer/mcp 1.1.0 from npm (it also still has the usage-guidelines bug fixed in #8530, so a release would help). Source checked against main at e236683 on 2026-10-16.
I'm interested in investigating why get_component_examples and get_component_accessibility_guidelines use component IDs instead of slugs for multi-word component names. I'd like to trace the issue, implement a fix, and add tests to prevent regressions.
Could you please assign this issue to me? I'm happy to submit a PR once the fix is ready. Thank you!
Activity
Pranay623 commentedon Oct 16, 2026
@iamamy26 can you please assign this issue to me
bindu-yogesh commentedon Oct 17, 2026
Hi, I'd like to work on this issue.
I'm interested in investigating why
get_component_examplesandget_component_accessibility_guidelinesuse component IDs instead of slugs for multi-word component names. I'd like to trace the issue, implement a fix, and add tests to prevent regressions.Could you please assign this issue to me? I'm happy to submit a PR once the fix is ready. Thank you!
siddharthkp commentedon Oct 19, 2026
@Pranay623 Because you asked first, feel free to go for it!