ux-axioms-mcp
v1.0.2
Published
UX Axioms Model Context Protocol Server
Readme
UX Axioms MCP Server
An MCP server that exposes UX Axioms parsed from database/rules/*.md as Resources and Tools. It supports:
- STDIO for Kiro / VS Code MCP clients (npx-style launch)
- Streamable HTTP (SSE) for a simple browser demo
The repo ships CI (lint/build/test) and npm Trusted Publishing (OIDC) to publish securely without classic tokens.
Install & Build
pnpm install # or: npm install
pnpm build # or: npm run buildOutput is ESM in dist/.
Run via npx (MCP stdio)
Add this to your MCP client (Kiro / VS Code) configuration to match other servers like Snyk:
"ux-axioms": {
"command": "npx",
"args": ["-y", "ux-axioms-mcp@latest", "mcp", "-t", "stdio"]
}Alternate form is also supported:
"args": ["-y", "ux-axioms-mcp@latest", "--stdio"]Local, without publishing:
pnpm build
npx ux-axioms-mcp@file:. mcp -t stdio
# or
npx ux-axioms-mcp@file:. --stdioLocal Run (direct)
STDIO
pnpm build node dist/src/index.js --stdioHTTP + SSE (optional API key auth)
# .env or environment # VALID_API_KEYS=key1,key2 pnpm build node dist/src/index.js # -> http://localhost:3000/mcp- Auth header:
X-API-Key: <key>or query:?apiKey=<key> - A minimal demo page is served from
public/
- Auth header:
On boot you’ll see which rules directory is used, e.g.:
Axioms: using rules dir: /…/ux-axioms-mcp/database/rules with 45 file(s)Resources
axioms://list– all axioms as JSONaxioms://search/{keyword}– filter by title/content/tags
Tools
list_axioms({ keyword?: string, limit?: number })- List or filter axioms; keyword matches title/content/tags
get_axiom({ id: string })- Fetch a single axiom by id (file stem)
suggest_axioms({ task?: string, component?: string, persona?: string, keywords?: string[], limit?: number })- Recommends using axiom tags, related_rules, and curated mappings in
database/mappings/*
- Recommends using axiom tags, related_rules, and curated mappings in
recommend_for_task({ task: string, persona?: string })- Curated suggestions via
database/mappings/tasks.json
- Curated suggestions via
prioritize_axioms({ persona: string })- Persona-prioritized ordering via
database/mappings/personas.json
- Persona-prioritized ordering via
analyze_ui({ html: string })- Naive static checks (Fitts’s min size, Hick’s choices, labels, small fonts)
generate_spec({ task: string, context?: string, persona?: string })- Spec section with axiom-driven constraints and acceptance criteria
generate_tests({ framework: 'playwright'|'jest-axe'|'vitest' })- Test scaffolds (hit area checks, a11y shell, timing shell)
link_patterns({ html?: string, code?: string })- Infers tags from patterns and expands to related axioms
Configuration
RULES_DIR– optional absolute or repo-relative path to rules (defaultdatabase/rules)VALID_API_KEYS– optional comma-separated list for HTTP auth
Project Structure
ux-axioms-mcp/
├── src/
│ ├── loader.ts # Markdown → objects
│ ├── index.ts # MCP server: resources + tools + transports
│ └── types.ts # Types
├── scripts/
│ ├── mcp.ts # npx entry (stdio)
│ └── cli.ts # Minimal test client
├── public/ # Minimal web demo (HTTP)
├── database/ # Rules + mapping JSON
├── specs/ # Design/plan/tasks
├── .github/workflows/ # CI + publish (Trusted Publishing)
└── tsconfig.jsonCI/CD (GitHub Actions) & Publishing (npm OIDC)
- CI:
.github/workflows/ci.ymlruns install, lint, build, test - Publish:
.github/workflows/publish.ymlpublishes on tagsv*using npm Trusted Publishing (OIDC)- In npm, configure a Trusted Publisher pointing to this repo and workflow path
- Release steps:
- Bump version in
package.json git tag vX.Y.Z && git push origin vX.Y.Z
- Bump version in
Enriching rule frontmatter
Metadata like category, evidence_level, validation, tags, related_rules, components, patterns, common_violations, fix_strategies is used by tools such as suggest_axioms and link_patterns.
pnpm build
node dist/scripts/enrich-frontmatter.jsThe enrichment augments missing fields but preserves any manually curated values.
Troubleshooting
- No tools/resources in client:
- Ensure you launch via
npx ux-axioms-mcp@latest mcp -t stdio - Look for “UX Axioms MCP Server running on STDIO” in logs
- Ensure you launch via
- Rules directory warnings:
- Verify
RULES_DIRor keep defaultdatabase/rules
- Verify
- Missing dependencies:
pnpm installthenpnpm build
