unicorn-mcp
v3.2.0
Published
MCP expert for the Fast Unicorn template: Next.js App Router, tRPC (use* routers), services, and HTTP API routes
Maintainers
Readme
unicorn-mcp
Model Context Protocol (MCP) server for the Fast Unicorn template (Next.js App Router, tRPC, Prisma, NextAuth, Stripe, next-intl, etc.).
The package is published on npm as unicorn-mcp. You do not add it as a dependency of the Next.js project: you register it in Cursor (or another MCP-capable IDE) so the client runs it with npx. Communication is over stdio (JSON-RPC per MCP).
Connect from Cursor / your IDE
- Open MCP settings (for example Settings → MCP or the
mcp.jsonyour Cursor uses). - Add
unicorn-mcpinside themcpServersobject. The key ("unicorn-mcp") is only a display name; you can change it.
Example: mcpServers (Windows)
Using cmd often makes npx resolve correctly (same pattern as other MCPs published on npm):
{
"mcpServers": {
"unicorn-mcp": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"unicorn-mcp@latest"
],
"env": {
"FAST_UNICORN_ROOT": "C:/absolute/path/to/your/fast-unicorn-project"
}
}
}
}Example: mcpServers (macOS / Linux)
{
"mcpServers": {
"unicorn-mcp": {
"command": "npx",
"args": ["-y", "unicorn-mcp@latest"],
"env": {
"FAST_UNICORN_ROOT": "/absolute/path/to/your/fast-unicorn-project"
}
}
}
}Important: set FAST_UNICORN_ROOT (or TEMPLATE_ROOT) to the absolute path to your Fast Unicorn app root on disk. Otherwise the server falls back to relative paths that rarely match your repo from an IDE.
Notes
- Node.js ≥ 18 (for
npx). - Optional web search:
BRAVE_API_KEYin the sameenvblock if you want Brave Search; otherwise DuckDuckGo is used (rate limits may apply; retries are already built into the server).
How it works (v3)
- Startup: the IDE runs
npx -y unicorn-mcp@latest, which starts the Node process and anMcpServeroverStdioServerTransport. - Registration: the server exposes 4 tools (
guide,ui,explore,research), Markdown resources (fast-unicorn://…), and predefined prompts. - Your template on disk: tools that read the repo resolve the root with
FAST_UNICORN_ROOT/TEMPLATE_ROOT(recommended) or an unreliable relative fallback without those variables. - Cache: some context (file tree, guides by area, research) is kept in memory for a few minutes for speed (
src/lib/cache.ts).
The four tools
| Tool | Purpose |
|------|---------|
| guide | Fast Unicorn knowledge base: returns internal docs, typical paths, patterns, and step-by-step guides. Use topic = area (auth, payments, i18n, email, database, trpc, server-api, deployment, general) or a specific guide id (e.g. new-trpc-router). Without topic, lists everything available. |
| ui | UI guide in a shadcn-like style: themes, forms, composition, icons, choosing components. Optional topic: styling, theming, forms, composition, icons, components. Without topic, returns all sections. |
| explore | Explores the project at FAST_UNICORN_ROOT: without query, directory tree; with query, text search in files. Useful params: path, depth, scope (src, config, messages, prisma, all). |
| research | Product/market research. type: market, competitors, roadmap (use web search + analysis template) or stack (local suggestions without web, from text requirements). |
MCP resources
Markdown under context/ is published as fast-unicorn://<slug> URIs (for example fast-unicorn://server-api). They let the assistant cite long documentation without repeating it on every call.
Built-in prompts
| Prompt | Use |
|--------|-----|
| init_project | Full flow: research → competitors → roadmap → architecture → kickoff document. |
| build_feature | Implement a feature following conventions (asks for guide + ui + explore in order). |
| debug_context | Debug an issue (area + symptoms). |
| generate_prd | PRD with market context via research. |
Example usage (for client guidance)
Typical goal: “I want to add a protected tRPC mutation that saves data with Prisma and shows the result on the dashboard.”
Recommended flow in the IDE chat
Architecture and API context
Ask the assistant to useguidewithtopic: "server-api"(or"trpc"if you prefer router/client focus).If screens are involved
Have it calluiwithtopic: "forms"ortopic: "composition"depending on what you are building.Align with existing code
Useexplorewith aquery(e.g. a router name orprotectedProcedure) to see where similar logic already lives.Implement
The assistant applies template patterns (use*routers, registration inroot.ts,protectedProcedure,src/server/serviceswhen needed).
Minimal natural-language “what to ask” example
You can copy and adapt this in Cursor (with MCP already connected):
Use the Fast Unicorn MCP in this order:
guidewith topicpaymentsto see how Stripe and webhooks are set up.explorewith querywebhookand scopesrcto locate the handler.- Propose only the minimal change to add a new webhook event and update Prisma.
Another example (product only, no repo changes):
Use
researchwith idea “booking app for hair salons in Mexico”, typemarket, then typeroadmap; summarize as a 3-phase plan.
Example parameters (quick reference)
{ "topic": "auth" }{ "topic": "styling" }{ "query": "useStripe", "scope": "src" }{ "idea": "Invoicing SaaS for freelancers, Spain", "type": "competitors" }{ "path": "src", "depth": 3 }Environment variables
| Variable | Purpose |
|----------|---------|
| FAST_UNICORN_ROOT / TEMPLATE_ROOT | Absolute path to the Fast Unicorn project root (recommended with IDE + npx). |
| BRAVE_API_KEY | Brave Search for research with web search (optional; without it DuckDuckGo is used). |
Developing this repository
| Command | Description |
|---------|-------------|
| npm install | Install dependencies. |
| npm run dev | Run with tsx watch. |
| npm run build | Compile to dist/. |
| npm start | Run node dist/index.js (stdio). |
| npm run typecheck | Type checking only. |
Code layout
src/
index.ts # Register tools, resources, prompts
lib/ # cache, web search, template root resolution
tools/
guide.ts # guide tool
ui.ts # ui tool
explore.ts # explore tool
research.ts # research tool
context/ # legacy internal implementations (used by guide)
research/ # research helpers (legacy / modular)
resources/
template_docs.ts # Markdown resource registration
prompts/
index.ts
context/ # Packaged Markdown (architecture, auth-guide, …)License
MIT (see package.json).
