magentaa11y-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/data/content.json +1357 -0
- package/package.json +45 -0
- package/src/helpers.js +274 -0
- package/src/index.js +63 -0
- package/src/tools.js +684 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Watkins
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# MagentaA11y MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server providing accessibility criteria from [MagentaA11y](https://www.magentaa11y.com/). Works locally (stdio) and remotely (Netlify Functions).
|
|
4
|
+
|
|
5
|
+
## Example Prompts:
|
|
6
|
+
- Get me the accessibility criteria for the Web Button component in Gherkin format.
|
|
7
|
+
- Get me a list of all the native components.
|
|
8
|
+
- Get me the Tooltip AC for Web - Condensed in markdown format.
|
|
9
|
+
|
|
10
|
+
## Tools
|
|
11
|
+
|
|
12
|
+
All tools are read-only, non-destructive, and idempotent. They include OpenAI Apps SDK annotations for enhanced integration.
|
|
13
|
+
|
|
14
|
+
| Tool | Description |
|
|
15
|
+
|------|-------------|
|
|
16
|
+
| `list_web_components` | List web accessibility components |
|
|
17
|
+
| `get_web_component` | Get detailed criteria for a web component |
|
|
18
|
+
| `search_web_criteria` | Search web criteria by keyword |
|
|
19
|
+
| `list_native_components` | List native iOS/Android components |
|
|
20
|
+
| `get_native_component` | Get detailed criteria for a native component |
|
|
21
|
+
| `search_native_criteria` | Search native criteria by keyword |
|
|
22
|
+
| `get_component_gherkin` | Get Gherkin-style acceptance criteria |
|
|
23
|
+
| `get_component_condensed` | Get condensed acceptance criteria |
|
|
24
|
+
| `get_component_developer_notes` | Get developer implementation notes |
|
|
25
|
+
| `get_component_native_notes` | Get iOS or Android specific notes |
|
|
26
|
+
| `list_component_formats` | List available formats for a component |
|
|
27
|
+
|
|
28
|
+
### OpenAI Marketplace Tool Annotations
|
|
29
|
+
|
|
30
|
+
Each tool includes these annotations (OpenAI Apps SDK compatible):
|
|
31
|
+
- `readOnlyHint: true` - Tools only read data, never modify
|
|
32
|
+
- `destructiveHint: false` - No destructive operations
|
|
33
|
+
- `idempotentHint: true` - Same input always produces same output
|
|
34
|
+
- `openWorldHint: false` - Operates on curated MagentaA11y dataset
|
|
35
|
+
|
|
36
|
+
## Development Setup
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone --recurse-submodules https://github.com/joe-watkins/magentaa11y-mcp.git
|
|
40
|
+
cd magentaa11y-mcp
|
|
41
|
+
npm install
|
|
42
|
+
npm run update-content
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Updating Content
|
|
46
|
+
|
|
47
|
+
The accessibility criteria comes from the [magentaA11y](https://github.com/tmobile/magentaA11y) submodule. To update:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm run update-content
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This pulls the latest from magentaA11y, builds it, and copies the generated `content.json` to `/data`.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
### Local Development
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"mcpServers": {
|
|
62
|
+
"magentaa11y": {
|
|
63
|
+
"command": "node",
|
|
64
|
+
"args": ["/path/to/src/index.js"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Remote (Netlify)
|
|
71
|
+
Clone this project, build it, and deploy to Netlify. Then use the following configuration:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"magentaa11y": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["mcp-remote@next", "https://your-site.netlify.app/mcp"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Project Structure
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
src/
|
|
88
|
+
index.js # MCP server (stdio transport)
|
|
89
|
+
tools.js # Tool definitions and handlers
|
|
90
|
+
helpers.js # Data loading and search utilities
|
|
91
|
+
data/
|
|
92
|
+
content.json # MagentaA11y accessibility criteria
|
|
93
|
+
netlify/
|
|
94
|
+
functions/api.js # Netlify Function (SSE transport)
|
|
95
|
+
scripts/
|
|
96
|
+
update-content.js # Build script for updating content
|
|
97
|
+
```
|