Skill Wiki v0.1.0

Docs / extending / domain-mcp

On this page

Domain MCP wrapper

The core MCP server is domain-blind. Most agentic workflows benefit from a domain-specific wrapper that adds tools tailored to the domain. The reference frontend Prime ships exactly such a wrapper.

What a wrapper adds

  • Domain-named tools — e.g. frontend_color_check, frontend_layout_resolve, instead of generic prime_query.
  • Pre-baked tag bundles — the wrapper knows which axes to set on a query without the agent having to.
  • Domain L5 validators — checkers registered in process that domain.yaml can reference.
  • Branding — the wrapper has its own npm package name and version.

Skeleton

// packages/mcp-server-frontend/src/index.ts
import { createCoreServer } from "@skill-wiki/mcp-server-core";

const core = await createCoreServer({ primeDir: process.env.PRIME_DIR });

// Add domain tools.
core.registerTool("frontend_color_check", {
  description: "Check generated CSS for color-token compliance.",
  inputSchema: {
    type: "object",
    properties: {
      css: { type: "string" },
    },
  },
  handler: async (args) => {
    const verdict = await checkColorTokens(args.css);
    return { ok: verdict.ok, fixes: verdict.fixes };
  },
});

// Register domain L5 validators referenced from domain.yaml.
core.registerValidator("color-token", colorTokenValidator);

await core.serve();

Conventions

AspectConvention
Package name@skill-wiki/mcp-server-<domain>
Tool prefix<domain>_<verb> e.g. frontend_color_check
Tools include the core 5Yes — wrap, don't replace.
VersioningSemver; track upstream mcp-server-core.

Distribution

Publish your wrapper to npm under your scope. Consumers wire it in the same way as the core server:

{
  "mcpServers": {
    "frontend-design": {
      "command": "bunx",
      "args": ["@skill-wiki/mcp-server-frontend"],
      "env": {
        "PRIME_DIR": "/abs/path/to/frontend-design/compiled"
      }
    }
  }
}

Reference implementation

See packages/mcp-server-frontend/ in skill-wiki/prime-corpus-frontend. It registers 4 frontend-specific tools on top of the core 5 and ships its own color-token + a11y-audit validators.