feat: Add MCP server, SKILL.md for aria-practices#3416
Draft
karanshah229 wants to merge 2 commits into
Draft
Conversation
Member
|
The ARIA Authoring Practices (APG) Task Force just discussed The full IRC log of that discussion<jugglinmike> Topic: PR 3416: Add MCP server<jugglinmike> github: https://github.com//pull/3416 <jugglinmike> Matt_King: I didn't know that you could actually put something into the repo that would enable that repo to be an MCP source. This seems super-cool to me on the surface (if I understand the surface correctly) <jugglinmike> Matt_King: We need some people who have actually done this sort of work to look at this and provide feedback. That wouldn't be me! <jugglinmike> Matt_King: I would love to use this, and I would love it if a lot of people were using this. That would be great <jugglinmike> Matt_King: Has anyone here done any work related to developing MCP sources? <jugglinmike> Matt_King: Hearing none, should we take it to the ARIA working group? <jugglinmike> Matt_King: Just to get a wider audience of people who could review and test this <jugglinmike> Daniel: There's no official stance from the W3C on this sort of thing. I do know that some people in WAI have expressed opinions. I've used tools like this myself, but it's one thing to use them and another thing to promote their use. <jugglinmike> Matt_King: I would assume that the goal is to assist people who are building components--to allow them to instruct their agents to use the guidance from the APG <jugglinmike> Daniel: In that case, then my comments wouldn't apply as much <jugglinmike> Matt_King: One of the problems with pointing an agent at the APG right now is that not all of the content in APG is necessarily relevant to building a specific pattern. My understanding is that this would help agents be smarter by focusing their attention on the relevant information. I could be wrong about that! <jugglinmike> Daniel: I'll take a look at this, and I'll bring it to WAI (just to make sure we're in alignment for this type of change) <jugglinmike> Matt_King: Sounds good <jugglinmike> Matt_King: If we can support something that makes APG more useful to agents, I think that would be awesome. But it may be a bigger lift (e.g. maybe it has an impact on the W3 org), so I'm interested in hearing what you and Remi have to say, Daniel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an MCP (Model Context Protocol) server that exposes WAI-ARIA Authoring Practices (APG) pattern documentation as on-demand resources. AI agents and chatbots can query these resources while helping developers build accessible components. A Cursor skill and test fixtures are included for integration and validation.
Architecture
Data flow
Pattern HTML is never duplicated. The server reads from the existing
content/patterns/tree and parses it on demand.Transport and protocol
apg://pattern/{id}(e.g.apg://pattern/accordion,apg://pattern/dialog-modal).Code Design Decisions
1. Single source of truth
Pattern HTML under
content/patterns/is the only authoritative source. The MCP server parses it at runtime and does not maintain a separate copy. Changes to pattern docs are automatically reflected when the server is used.2. Modular layout under
mcp-server/discovery.mjscontent/patterns/*/*-pattern.html, returns{ id, path, name }parser.mjs#about,#examples,#keyboard_interaction,#roles_states_properties), converts to markdown vianode-html-markdownindex.mjsResourceTemplate, connects stdio transportSeparation makes parsing and discovery easy to test and evolve independently.
3. ESM (
.mjs) for MCP serverThe MCP SDK is ESM-only. Using
.mjslets us import it without changing the repo"type"or adding a build step.4. HTML → markdown
node-html-markdownis used instead of a custom converter. It keeps the parser small and robust while still supporting tables, lists, and other structures needed for pattern content.5. No build step
The server is plain Node.js. There is no transpilation or bundling. Dependencies are installed via the root
package.json; the MCP server uses the repo's existing tooling.6. Minimal changes to existing code
mcp-server/,skill/,src/tests/package.json(script + 3 devDependencies)eslint.config.mjsand.github/workflows/lint-js.ymlfor.mjsNo edits to
content/,scripts/, or existingtest/setup.File Structure
Dependencies
@modelcontextprotocol/sdkzodnode-html-markdownExisting dependencies (
cheerio,glob, etc.) are reused where possible.End-User Usage
Running the MCP server
The server runs over stdio and waits for MCP client connections.
Cursor setup
{ "mcpServers": { "wai-aria-apg": { "command": "node", "args": ["/path/to/aria-practices/mcp-server/index.mjs"] } } }skill/wai-aria-apginto.cursor/skills/so the AI uses APG patterns when working on ARIA components.Test fixtures
src/tests/html-landing/andsrc/tests/react-ts/contain deliberately inaccessible examples for validating the MCP server and Cursor integration.Testing
npm run lint:es(and fullnpm run lint) pass.