ux-kb
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
UX-KB — UI/UX Designer Agent Knowledge Base
Cloud MCP knowledge base + UI/UX design agent. 73 cited topic docs, 6 workflow stage packs, session-scoped retrieval, citation verification, API keys, rate limits, and usage/gap logging. Built with TypeScript, Prisma, and Postgres.
Live page: https://ux-kb-site.vercel.app
Why UX-KB
Generic AI output looks like a template: default gradients, five-card grids, weak hierarchy, no accessibility, and rules invented on the fly. UX-KB turns UX guidance into a queryable, versioned, citable knowledge base that an agent must read before proposing a design.
Rules are fetched, not memorized. Every proposal cites doc IDs that were actually retrieved in the session.
Stage packs load only the rules relevant to the current workflow stage, with token budgets, instead of dumping the whole catalogue.
Feature routing pulls in extra docs for the specific thing being designed.
Citation verification proves a cited ID was fetched — and flags unfetched, unknown, and deprecated IDs before submission.
Gap reporting records missing topics instead of letting the agent invent rules.
Related MCP server: open-design-system-mcp-starter
What's inside
Surface | Count |
Topic documents | 73 |
Workflow stage packs | 6 ( |
Feature routes | 10 |
MCP tools | 7 |
MCP resources | 3 |
Core unit tests | 35 |
Content release candidate: 2.0.0 (content/release.json).
Architecture
flowchart LR
A[AI Agent] -->|MCP stdio/HTTP| B[MCP Server]
B --> C[Core Services]
C --> D[Content Repository]
D --> E[Markdown content/]
C --> F[KbStore]
F --> G[MemoryStore dev/tests]
F --> H[PrismaStore Postgres]
C --> I[Auth, rate limit, sessions, citations, gaps]MCP is the delivery layer; core owns the logic. REST and admin (Phase 4) reuse the same services.
Agents read only published, immutable releases. Each session pins one KB version.
Project design-system files override the KB on tokens, brand, components, and voice.
Quick start (no database)
cd ux-kb
pnpm install
pnpm lint:kb:strict # 0 errors, 0 warnings across 73 docs
pnpm typecheck # tsc across all packages
pnpm test # 23 core unit tests
pnpm smoke # 7 tools + 3 resources over MCP stdio
pnpm dev:mcp # stdio MCP server
pnpm dev:web # Next.js site + dashboard + /api/mcp (https in dev)Node.js ≥ 20 and pnpm 10 are required. Postgres is optional for local dev.
Connect an agent
Claude Code (stdio)
claude mcp add ux-kb -- node --import tsx \
/absolute/path/to/ux-kb/apps/stdio/src/index.tsOr with the built server (pnpm build first):
claude mcp add ux-kb -- node /absolute/path/to/ux-kb/apps/stdio/dist/index.jsCursor / Claude Desktop
{
"mcpServers": {
"ux-kb": {
"command": "node",
"args": ["--import", "tsx", "/absolute/path/to/ux-kb/apps/stdio/src/index.ts"]
}
}
}Streamable HTTP (with API key)
MCP_DEV_KEY=dev-local-key pnpm dev:mcp:http # http://127.0.0.1:3333/mcpclaude mcp add --transport http ux-kb http://127.0.0.1:3333/mcp \
--header "Authorization: Bearer dev-local-key"Tool reference
Tool | Input | Output | Side effect |
|
|
| creates/resumes session |
|
| gate items + counts | creates gate |
|
| accepted, rejected, weak, remaining | records results |
|
| done, counts, open items | none |
|
| IDs, titles, summaries | none |
|
| stage docs + routed docs | records fetched IDs |
|
| one published doc | records fetched ID |
|
| batch docs | records fetched IDs |
|
| CHECK items (+verify) | none |
|
| unfetched, unknown, deprecated | stores result |
|
| ticket id, similar reports | upserts gap |
|
| ticket, noise score | records report |
|
| failing items + rates | none |
|
| changed docs + checks | none |
Resources: kb://doc/{id}, kb://pack/{stage}, kb://core.
Stages: need_check, research, audit, proposal, critique, implement.
Session workflow
Call
start_sessiononce per task.Call
get_stage_packbefore each stage;get_docfor extra topics.Call
verify_citationsbefore submitting — it compares cited IDs against the session's fetch history.Call
report_gapwhen the KB lacks a topic instead of inventing a rule.
get_stage_pack reports an estimated token count and marks over-budget packs
(characters / 4, not a model-specific tokenizer).
Database (optional, for persisted auth/usage/gaps)
cp .env.example .env # set DATABASE_URL, DIRECT_URL, KEY_HASH_SECRET, AUTH_SECRET
pnpm db:generate
pnpm db:push
pnpm db:seed
pnpm kb:keys create --name laptop --rate-limit 120KB_STORE=db (or a non-empty DATABASE_URL) selects PrismaStore;
KB_STORE=memory forces the in-memory store used by tests and smoke:http.
DIRECT_URL is the non-pooled connection used by migrations; on Prisma Postgres it
is the direct (non-pooled) URL.
The seed is idempotent.
Testing
pnpm lint:kb:strict # 0 errors, 0 warnings across 73 docs
pnpm typecheck # tsc in core, mcp, stdio, web
pnpm test # 46 core unit tests (incl. auth/security)
pnpm smoke # stdio end-to-end
pnpm smoke:http # HTTP auth, pinning, revocation, 429
pnpm --filter @ux-kb/web build # Next.js production buildSee docs/testing.md for the full manual test guide.
Project structure
ux-kb/
content/ Markdown knowledge base (source of truth)
prisma/schema.prisma DB schema (docs, versions, releases, keys, usage, gaps, rate limits)
prisma/seed.ts content/ -> Postgres
packages/core/src/
schemas/ zod front matter, packs, routes, releases
content/ path resolution, parser, repository, token estimate
services/ docs, packs + routing, search, release, auth,
rate limit (in-memory + Postgres), sessions/citations, gaps
store/ KbStore boundary: memory + Prisma implementations
lint/ doc + catalog linter
cli/ lint, info, key/gap commands
packages/mcp/src/ MCP server factory, tools, resources (shared)
apps/stdio/src/ stdio transport (local agents: Claude Code, Cursor)
apps/stdio/scripts/ smoke.ts (stdio), http-smoke.ts (auth/429)
apps/web/ Next.js app (public site, /api/mcp, /dashboard)
app/ App Router pages and route handlers
lib/ db, kb, store, auth, mcp auth helpers
proxy.ts route guard for /dashboardWeb app (Next.js)
The public site, MCP endpoint, and admin dashboard ship as one Next.js app in
apps/web.
pnpm dev:web # https://localhost:3000 (self-signed cert in dev)
pnpm build # builds stdio + webSurfaces:
/— public landing page/api/healthz— health and KB version/api/mcp— Streamable HTTP MCP (Bearer API key or OAuth access token, rate limited in Postgres)/signin— GitHub OAuth; any GitHub user can sign in, allowlisted logins become admins/dashboard— your keys, usage, and releases (requires sign-in)/dashboard/users,/dashboard/gaps— admin only
HTTPS is provided by Vercel in production (HSTS + security headers configured in
next.config.ts). Local dev uses next dev --experimental-https.
Accounts and API keys
Open
/signinand authorize with GitHub. Onlyidandloginare used for identity; the OAuth token is not stored.Create a key at
/dashboard/keys. The plaintext is shown once; the database stores only an HMAC-SHA256 hash.Use it as a Bearer token:
claude mcp add --transport http ux-kb https://ux-kb-site.vercel.app/api/mcp \ --header "Authorization: Bearer <your-key>"
OAuth for MCP connectors
Connectors that cannot send a static header (Claude.ai, ChatGPT, and other MCP
clients) can authorize through OAuth 2.1 instead. The endpoint advertises
RFC 9728 protected-resource metadata in its 401 challenge, so a client
discovers everything from https://<host>/api/mcp alone:
Endpoint | Purpose |
| Resource metadata (RFC 9728) |
| Authorization-server metadata (RFC 8414) |
| Dynamic client registration (RFC 7591, IP limited) |
| GitHub sign-in + consent screen |
|
|
| Token revocation (RFC 7009) |
Authorization requires PKCE (S256), then an explicit Allow from the
signed-in user. Access tokens last one hour; refresh tokens rotate on every use.
Each client/user pair is backed by one hidden OAuth · <client> key, so
sessions, usage history, and per-key quotas stay coherent. Redirect URIs must be
HTTPS, or loopback HTTP for native clients. Rejecting everything else keeps an
open registration endpoint from becoming an open redirect.
Issuer URLs are derived from AUTH_URL, then the request's forwarded host, then
NEXTAUTH_URL. Set AUTH_URL in production if you serve more than one domain.
Gemini (manual client registration)
Gemini's connector does not always complete dynamic registration, so if it asks for a Client ID and Secret, register one manually with Gemini's redirect URI:
curl -X POST https://<host>/oauth/register \\
-H 'Content-Type: application/json' \\
-d '{"client_name":"Gemini","redirect_uris":["https://vertexaisearch.cloud.google.com/oauth-redirect","https://gemini.google.com/oauth-redirect","https://oauth-redirect.googleusercontent.com/r"],"token_endpoint_auth_method":"client_secret_basic"}'Paste the returned client_id and client_secret into Gemini's connection dialog.
The server also accepts the redirect URIs Gemini uses for its relay
(oauth-redirect*.googleusercontent.com), so registration succeeds even if
Gemini sends a redirect URI that was not listed above.
Quotas are applied per key:
Limit | Member | Admin |
Active keys | 3 | 10 |
Requests / minute | 10–120 (default 60) | 10–600 (default 300) |
Requests / day | 10 000 | 100 000 |
Key expiry | 30 / 90 / 365 days | same, plus "never" |
Rotate issues a replacement and revokes the old key in one step. Revocation is immediate. Admins can suspend an account, which blocks new sessions and stops its keys from working.
Security and limitations
Keys are
uxkb_+ 192 random bits, stored only as an HMAC-SHA256 hash, and checked syntactically before any database lookup. Revocation and expiry are enforced on every request./api/mcpisPOST-only, requiresapplication/json, caps bodies at 256 KB and batches at 20, and enforces per-key minute and daily quotas plus a per-IP limit for unauthenticated callers.Dashboard and API responses are
no-store; CSP, HSTS,X-Frame-Options,nosniff, and COOP are set innext.config.ts.Every dashboard query is filtered by key owner; admin pages re-check the role server-side.
The server trusts reviewed Markdown. A bad doc becomes an instruction the agent follows, so review is the security boundary.
Citation verification proves fetch history, not that a source semantically supports a claim.
Rate limiting is a Postgres fixed window. It is abuse control, not billing: a caller can burst across a window boundary.
The concurrency guard is per serverless instance, so it bounds per-instance pressure rather than global throughput.
Usage logs store tool arguments — avoid sending secrets in
feature,context, or query text.Token estimates are approximate (±15% for prose); pack budgets are advisory.
See docs/security-checklist.md (OWASP API Top
10) and docs/auth-checklist.md for the full control
list and known limitations.
Roadmap
Phase 4: admin docs, packs, releases (draft → review → publish)
Phase 5: usage, compliance, and gap observability
Phase 6: agent files, critic, evals, Playwright/axe
Phase 7: CI regression and content expansion from ranked gaps
Contributing
Issues and PRs welcome. Before submitting:
Keep doc changes minimal and justified.
Write docs in your own words — never paste copyrighted source text.
Run
pnpm lint:kb:strict,pnpm typecheck, andpnpm test.
License
Released under the MIT License. Content is a release candidate and may change between versions.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Team docs served to AI agents over MCP - search, Markdown reads, version pinning, read audit.
Read-only canon of design and copy rules for AI agents to audit generated UI, served as resources.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Serves your design system and coding standards to coding agents, so they stop guessing.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to score live URLs against a deterministic design contract, validate DTCG tokens and Lottie animations, audit accessibility, and retrieve design-system contracts, catalogs, and review rubrics.17MIT
- AlicenseNot gradedqualityCmaintenanceProvides a real API for coding agents to look up design system components, props, and tokens, preventing guessed answers.9MIT
- AlicenseAqualityBmaintenanceEnables AI agents to search API documentation, validate endpoints via OpenAPI, and submit feedback that surfaces ranked knowledge gaps from failed or unhelpful queries.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to fetch current, version-accurate library documentation at request time instead of relying on training memory, with search for answering questions and full-fidelity retrieval of pages or specific declarations. Supports bare or module-path library names, version pinning, and disambiguation when names collide.32 npmMIT