MCP
An MCP server that gives AI agents Signet's docs, exports, components, themes and checks.
betaOn npm, API may still change
npx @dapplelight/signet-mcpEverything it answers comes from an index built from the repo when the package is built, and it ships inside the package. It makes no network calls. Runs on Node 20+ or Bun.
Quick start
claude mcp add signet -- bunx @dapplelight/signet-mcpFirst use
Add the server with the Claude Code or Cursor tab above, open your app, and ask:
Add a pricing page with monthly and yearly plans. Use Signet.The agent calls four tools. Outputs are trimmed.
{ "query": "pricing plans", "limit": 3 }
→ { "hits": [
{ "kind": "export", "title": "Pricing (function)", "ref": "@dapplelight/signet-ui/blocks/pricing" },
{ "kind": "doc", "title": "@dapplelight/signet-db › Pricing experiments", "ref": "signet://docs/db#pricing-experiments" }
] }{ "description": "a pricing page with monthly and yearly plans", "target": "web" }
→ { "recipe": "add-plans",
"blocks": [{ "name": "pricing", "command": "npx @dapplelight/signet-cli add block pricing" }],
"files": [{ "path": "src/routes/pricing.tsx" }, { "path": "src/components/signet/blocks/pricing/index.tsx" }] }{ "need": "segmented pill choice: monthly or yearly", "limit": 1 }
→ { "matches": [
{ "name": "pill-group", "importPath": "@dapplelight/signet-ui/components/pill-group", "parts": ["PillGroup", "PillOption"] }
] }{ "path": "." }
→ { "ok": true, "errors": 0, "warnings": 0, "findings": [] }Result: src/routes/pricing.tsx renders the pricing block with a monthly/yearly PillGroup, and check_app passes.
Tools
All read-only.
| Tool | What it returns |
|---|---|
search_docs(query, limit?) | Doc sections, exports, components and recipes that match, with refs to follow. Start here. |
read_doc(name, section?) | A doc, whole or one section. |
list_exports(package?) | Every import path, its summary and symbol names. |
get_export(path, symbol) | The symbol's signature, JSDoc, source file and every path that exports it. |
list_components() | Each signet-ui component, its import path and exports. |
get_component(name) | Props, cva variants and defaults, a usage example, contract variables it reads. |
compose_component(need, limit?) | Closest components and behaviors for a need in words, with parts and an example. |
plan_page({ description, target? }) | Blocks, components, server modules, recipe, data and files to create for a page described in words. |
list_themes() / get_theme(name, include_css?) | Shipped themes, how to import one, the CSS to copy. |
list_tokens(kind?) | The theme contract: 78 required and 16 optional variables. |
check_theme(css) | Findings against the contract: missing variables, optional slots, WCAG contrast. |
build_theme({ brand, base?, mode?, density?, format? }) | A full theme from one brand colour; format is css, tokens or figma. |
scaffold_app({ name, template, theme }) | The exact create-signet-app command, files it will create, next steps. |
scaffold_files({ name, template, theme }) | Every file the scaffolder would write, with contents, for an agent without a shell. |
check_app({ files }) or check_app({ path }) | Convention findings with fixes. path reads local disk and is offered by the stdio bin only. |
recipe(task) | Install line, the doc sections that do the job, and how to verify. |
migration(from, to?, package?) | Changelog entries in the range, breaking bullets pulled out, current versions. |
recipe tasks: add-auth, add-rate-limit, add-csrf, add-error-envelope, add-env, add-api-client, add-web-push, add-ai-extraction, add-analytics, add-portability-adapters, add-db, add-mcp-tools, mcp-by-default, add-oauth, add-logging, add-theme.
Plan a page
plan_page turns a page described in words into a file plan: the block to add, the components and server modules it uses, the matching recipe, the data it needs and the files to create. It makes no LLM call and gives the same answer every time. target is web (the default), api or full. See Build a page with an agent for the whole flow.
{ "description": "an analytics dashboard with a visitors chart", "target": "web" }{
"target": "web",
"recipe": "add-analytics",
"blocks": [
{
"name": "analytics-dashboard",
"why": "Analytics overview page: range picker, stat row, area chart and a recent-activity table, ...",
"command": "npx @dapplelight/signet-cli add block analytics-dashboard" // not on npm yet: run it from source
}
],
"components": [{ "name": "card", "importPath": "@dapplelight/signet-ui/components/card" }],
"modules": [],
"data": ["stats: label, value, meta and tone for each metric"],
"files": [
{ "path": "src/routes/analytics-dashboard.tsx", "purpose": "Page route that renders the block with sample data" }
],
"next": ["get_component({ name: \"badge\" })", "recipe({ task: \"add-analytics\" })", "check_app"]
}Every key is always present. When nothing matches, the arrays are empty and hint points to compose_component and search_docs.
Resources and prompts
Every doc is a resource at signet://docs/<name>: signet, api, conventions, migration, changelog, contributing, publishing, repo-guide, contract, analytics, and one per package README.
| Prompt | Arguments |
|---|---|
build-signet-app | idea, template |
review-against-signet | target |
add-signet-feature | feature, app |
Host it over HTTP
On any fetch host (Workers, Bun, Deno):
import { signetMcpFetch } from "@dapplelight/signet-mcp"
export default { fetch: signetMcpFetch() }Or as a route on a Hono app:
import { signetMcpOptions } from "@dapplelight/signet-mcp"
import { mountMcp } from "@dapplelight/signet-server/mcp/hono"
import { Hono } from "hono"
const app = new Hono()
mountMcp(app, "/mcp", signetMcpOptions())signetMcpOptions({ tools, resources, prompts }) adds your own beside Signet's. A hosted server offers check_app with files only.
Your database, as tools
Pass a signet-db instance and the tables an agent may reach (each needs a userId column). The server adds <table>_list, <table>_get and <table>_search.
import { agentTools } from "@dapplelight/signet-db/agent"
import { signetMcpOptions } from "@dapplelight/signet-mcp"
import { mountMcp } from "@dapplelight/signet-server/mcp/hono"
import { requireToken } from "@dapplelight/signet-server/oauth-rs/hono"
import { app } from "./app"
import { db } from "./db"
import { resourceMetadataUrl, verifier } from "./oauth"
import { notes, orders } from "./schema"
mountMcp(app, "/mcp", {
...signetMcpOptions({ db: { db, agentTools, tables: [orders, notes] } }),
middleware: [requireToken({ verifier, resourceMetadataUrl })],
})| Option | Default | |
|---|---|---|
allowWrites | false | Adds <table>_insert and <table>_update, which take dryRun: true. |
maxRows | 100 | Rows per call. |
userId | token sub | (caller) => ... to pick another. With no identity there are no db tools. |
scopes | none | { read: [...], write: [...] }. Without it any caller with a verified sub runs every db tool. Name read always, and write when allowWrites is true. |
Tools are built per request, so each user sees only their own rows. Use mountMcp or resolveMcpServer, not signetMcpFetch, with a database.