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)
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- tooling
Direzione di ricerca
I due URL vengono costruiti in packages/mcp/src/server.ts, nel handler get_component_examples (intorno a L256) e nel handler get_component_accessibility_guidelines (intorno a L390), e usano entrambi match.id. Confrontali con l'handler usage-guidelines, che usa già match.slug. Avvia il server MCP e chiama entrambi i tool con name TextInput. È completato quando entrambi restituiscono la pagina di TextInput invece della home page, e Button continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
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):
- L256
get_component_examples:new URL(`/product/components/${match.id}`, ...) - L390
get_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/[email protected]and connect an MCP client. - Call
get_component_accessibility_guidelineswith{"name": "TextInput"}. - The text starts with the Primer home page ("The design system for GitHub") instead of the TextInput accessibility page.
- Call
get_component_exampleswith{"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.
Browser
N/A (MCP server on Node.js)
- Lingua principale
- TypeScript
- Stelle
- 3.9k
- Fork
- 705
- Merge medio
- 3g 18h
- PR unite (30g)
- 47
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di primer/react
-
PageHeader.Title does not seem to accept id propForse già presa @TylerJDev l’ha presa 8 giorni fa. Apertacomponent: PageHeader react staff
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
primer/react#8474 · 1 commento · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
The padding prop seems to have no effect with PageLayout.SidebarForse già presa @minwookshin l’ha presa 19 giorni fa. Apertacomponent: PageLayout react staff
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
primer/react#8470 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
bug component: Spinner react
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
primer/react#8423 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Low contrast in SelectApertawaiting for author response
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
primer/react#8172 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Checkbox: replace useLayoutEffect with ref callback for indeterminate propForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertacomponent: Checkbox react
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di primer/react
Issue simili
-
engine-rs P3 review-deferral wasm
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
maniator/verticopolis#1154 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
telerik/kendo-react#3861 ·
I maintainer di solito rispondono entro 1 giorno
-
[bug]: use-mobile.ts uses pixel logic, causing UI state de-sync with Tailwind CSS rem breakpointsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
task
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100