Shubhamsaboo/awesome-llm-apps/generative_ui_agents/ai-mcp-app-builder/apps/mcp-use-server/.agent/skills/mcp-apps-builder/SKILL.md
mcp-apps-builder
**MANDATORY for ALL MCP server work** - mcp-use framework best practices and patterns. **READ THIS FIRST** before any MCP server work, including: - Creating new MCP servers - Modifying existing MCP servers (adding/updating tools, resources, prompts, widgets) - Debugging MCP server issues or errors - Reviewing MCP server code for quality, security, or performance - Answering questions about MCP development or mcp-use patterns - Making ANY changes to server.tool(), server.resource(), server.prompt
- Source repository stars
- 130,408
- Declared platforms
- 0
- Static risk flags
- 3
- Last source update
- 2026-08-03
- Source checked
- 2026-08-04
Decision brief
What it does—and where it fits
This file provides a NAVIGATION GUIDE ONLY. Before implementing any MCP server features, you MUST:
Not for
- Tool Definition
- Widget Development
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/Shubhamsaboo/awesome-llm-apps --skill "generative_ui_agents/ai-mcp-app-builder/apps/mcp-use-server/.agent/skills/mcp-apps-builder"Inspect the Agent Skill "mcp-apps-builder" from https://github.com/Shubhamsaboo/awesome-llm-apps/blob/779e9f9bcf87fa8cd95870a438b70b84e47d3173/generative_ui_agents/ai-mcp-app-builder/apps/mcp-use-server/.agent/skills/mcp-apps-builder/SKILL.md at commit 779e9f9bcf87fa8cd95870a438b70b84e47d3173. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
MCP Server Best Practices
Comprehensive guide for building production-ready MCP servers with tools, resources, prompts, and widgets using mcp-use.
concepts.md - MCP primitives (Tool, Resource, Prompt, Widget) and when to use eacharchitecture.md - Server structure (Hono-based), middleware system, server.use() vs server.appquickstart.md - Scaffolding, setup, and first tool example - 02
⚠️ FIRST: New Project or Existing Project?
Before doing anything else, determine whether you are inside an existing mcp-use project.
Before doing anything else, determine whether you are inside an existing mcp-use project.Detection: Check the workspace for a package.json that lists "mcp-use" as a dependency, OR any .ts file that imports from "mcp-use/server".NEVER manually create MCPServer boilerplate, package.json, or project structure by hand. The CLI sets up TypeScript config, dev scripts, inspector integration, hot reload, and widget compilation that are difficult to re… - 03
Scaffolding a New Project
For full scaffolding details and CLI flags, see quickstart.md.
For full scaffolding details and CLI flags, see quickstart.md. - 04
Quick Navigation
Choose your path based on what you're building:
concepts.md - MCP primitives (Tool, Resource, Prompt, Widget) and when to use eacharchitecture.md - Server structure (Hono-based), middleware system, server.use() vs server.appquickstart.md - Scaffolding, setup, and first tool example - 05
🚀 Foundations
When: ALWAYS read these first when starting MCP work in a new conversation. Reference later for architecture/concept clarification.
concepts.md - MCP primitives (Tool, Resource, Prompt, Widget) and when to use eacharchitecture.md - Server structure (Hono-based), middleware system, server.use() vs server.appquickstart.md - Scaffolding, setup, and first tool example
Permission review
Static risk signals and limitations
Reads files
The documentation asks the agent to read local files, directories, or repositories.
**ALWAYS read the specific reference file(s)** for the features you're implementingWrites files
The documentation asks the agent to create, modify, or delete local files.
└─ Ask the user where to create it, then scaffold in that directory.Runs scripts
The documentation asks the agent to run terminal commands or scripts.
npx create-mcp-use-app my-serverRuns scripts
The documentation asks the agent to run terminal commands or scripts.
npm run devReads files
The documentation asks the agent to read local files, directories, or repositories.
*When:** Implementing MCP features (actions, data, templates). Read the specific file for the primitive you're building.Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 85/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 130,408 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- Shubhamsaboo/awesome-llm-apps
- Skill path
- generative_ui_agents/ai-mcp-app-builder/apps/mcp-use-server/.agent/skills/mcp-apps-builder/SKILL.md
- Commit
- 779e9f9bcf87fa8cd95870a438b70b84e47d3173
- License
- Apache-2.0
- Collected
- 2026-08-04
- Default branch
- main
View the original SKILL.md
IMPORTANT: How to Use This Skill
This file provides a NAVIGATION GUIDE ONLY. Before implementing any MCP server features, you MUST:
- Read this overview to understand which reference files are relevant
- ALWAYS read the specific reference file(s) for the features you're implementing
- Apply the detailed patterns from those files to your implementation
Do NOT rely solely on the quick reference examples in this file - they are minimal examples only. The reference files contain critical best practices, security considerations, and advanced patterns.
MCP Server Best Practices
Comprehensive guide for building production-ready MCP servers with tools, resources, prompts, and widgets using mcp-use.
⚠️ FIRST: New Project or Existing Project?
Before doing anything else, determine whether you are inside an existing mcp-use project.
Detection: Check the workspace for a package.json that lists "mcp-use" as a dependency, OR any .ts file that imports from "mcp-use/server".
├─ mcp-use project FOUND → Do NOT scaffold. You are already in a project.
│ └─ Skip to "Quick Navigation" below to add features.
│
├─ NO mcp-use project (empty dir, unrelated project, or greenfield)
│ └─ Scaffold first with npx create-mcp-use-app, then add features.
│ See "Scaffolding a New Project" below.
│
└─ Inside an UNRELATED project (e.g. Next.js app) and user wants an MCP server
└─ Ask the user where to create it, then scaffold in that directory.
Do NOT scaffold inside an existing unrelated project root.
NEVER manually create MCPServer boilerplate, package.json, or project structure by hand. The CLI sets up TypeScript config, dev scripts, inspector integration, hot reload, and widget compilation that are difficult to replicate manually.
Scaffolding a New Project
npx create-mcp-use-app my-server
cd my-server
npm run dev
For full scaffolding details and CLI flags, see quickstart.md.
Quick Navigation
Choose your path based on what you're building:
🚀 Foundations
When: ALWAYS read these first when starting MCP work in a new conversation. Reference later for architecture/concept clarification.
- concepts.md - MCP primitives (Tool, Resource, Prompt, Widget) and when to use each
- architecture.md - Server structure (Hono-based), middleware system, server.use() vs server.app
- quickstart.md - Scaffolding, setup, and first tool example
- deployment.md - Deploying to Manufact Cloud, self-hosting, Docker, managing deployments
Load these before diving into tools/resources/widgets sections.
🔐 Adding Authentication?
When: Protecting your server with OAuth (WorkOS, Supabase, or custom)
-
- When: First time adding auth, understanding
ctx.auth, or choosing a provider - Covers:
oauthconfig, user context shape, provider comparison, common mistakes
- When: First time adding auth, understanding
-
- When: Using WorkOS AuthKit for authentication
- Covers: Setup, env vars, DCR vs pre-registered, roles/permissions, WorkOS API calls
-
- When: Using Supabase for authentication
- Covers: Setup, env vars, HS256 vs ES256, RLS-aware API calls
-
- When: Using any other identity provider (GitHub, Okta, Azure AD, Google, etc.)
- Covers: Custom verification, user info extraction, provider examples
🔧 Building Server Backend (No UI)?
When: Implementing MCP features (actions, data, templates). Read the specific file for the primitive you're building.
-
- When: Creating backend actions the AI can call (send-email, fetch-data, create-user)
- Covers: Tool definition, schemas, annotations, context, error handling
-
- When: Exposing read-only data clients can fetch (config, user profiles, documentation)
- Covers: Static resources, dynamic resources, parameterized resource templates, URI completion
-
- When: Creating reusable message templates for AI interactions (code-review, summarize)
- Covers: Prompt definition, parameterization, argument completion, prompt best practices
-
- When: Formatting responses from tools/resources (text, JSON, markdown, images, errors)
- Covers:
text(),object(),markdown(),image(),error(),mix()
🎨 Building Visual Widgets (Interactive UI)?
When: Creating React-based visual interfaces for browsing, comparing, or selecting data
-
- When: Creating your first widget or adding UI to an existing tool
- Covers: Widget setup,
useWidget()hook,isPendingchecks, props handling
-
- When: Managing UI state (selections, filters, tabs) within widgets
- Covers:
useState,setState, state persistence, when to use tool vs widget state
-
- When: Adding buttons, forms, or calling tools from within widgets
- Covers:
useCallTool(), form handling, action buttons, optimistic updates
-
- When: Styling widgets to support themes, responsive layouts, or accessibility
- Covers:
useWidgetTheme(), light/dark mode,autoSize, layout patterns, CSS best practices
-
- When: Building complex widgets with async data, error boundaries, or performance optimizations
- Covers: Loading states, error handling, memoization, code splitting
📚 Need Complete Examples?
When: You want to see full implementations of common use cases
- common-patterns.md
- End-to-end examples: weather app, todo list, recipe browser
- Shows: Server code + widget code + best practices in context
Decision Tree
What do you need?
├─ New project from scratch
│ └─> quickstart.md (scaffolding + setup)
│
├─ OAuth / user authentication
│ └─> authentication/overview.md → provider-specific guide
│
├─ Simple backend action (no UI)
│ └─> Use Tool: server/tools.md
│
├─ Read-only data for clients
│ └─> Use Resource: server/resources.md
│
├─ Reusable prompt template
│ └─> Use Prompt: server/prompts.md
│
├─ Visual/interactive UI
│ └─> Use Widget: widgets/basics.md
│
└─ Deploy to production
└─> deployment.md (cloud deploy, self-hosting, Docker)
Core Principles
- Tools for actions - Backend operations with input/output
- Resources for data - Read-only data clients can fetch
- Prompts for templates - Reusable message templates
- Widgets for UI - Visual interfaces when helpful
- Mock data first - Prototype quickly, connect APIs later
❌ Common Mistakes
Avoid these anti-patterns found in production MCP servers:
Tool Definition
- ❌ Returning raw objects instead of using response helpers
- ✅ Use
text(),object(),widget(),error()helpers
- ✅ Use
- ❌ Skipping Zod schema
.describe()on every field- ✅ Add descriptions to all schema fields for better AI understanding
- ❌ No input validation or sanitization
- ✅ Validate inputs with Zod, sanitize user-provided data
- ❌ Throwing errors instead of returning
error()helper- ✅ Use
error("message")for graceful error responses
- ✅ Use
Widget Development
- ❌ Accessing
propswithout checkingisPending- ✅ Always check
if (isPending) return <Loading/>
- ✅ Always check
- ❌ Widget handles server state (filters, selections)
- ✅ Widgets manage their own UI state with
useState
- ✅ Widgets manage their own UI state with
- ❌ Missing
McpUseProviderwrapper orautoSize- ✅ Wrap root component:
<McpUseProvider autoSize>
- ✅ Wrap root component:
- ❌ Inline styles without theme awareness
- ✅ Use
useWidgetTheme()for light/dark mode support
- ✅ Use
Security & Production
- ❌ Hardcoded API keys or secrets in code
- ✅ Use
process.env.API_KEY, document in.env.example
- ✅ Use
- ❌ No error handling in tool handlers
- ✅ Wrap in try/catch, return
error()on failure
- ✅ Wrap in try/catch, return
- ❌ Expensive operations without caching
- ✅ Cache API calls, computations with TTL
- ❌ Missing CORS configuration
- ✅ Configure CORS for production deployments
🔒 Golden Rules
Opinionated architectural guidelines:
1. One Tool = One Capability
Split broad actions into focused tools:
- ❌
manage-users(too vague) - ✅
create-user,delete-user,list-users
2. Return Complete Data Upfront
Tool calls are expensive. Avoid lazy-loading:
- ❌
list-products+get-product-details(2 calls) - ✅
list-productsreturns full data including details
3. Widgets Own Their State
UI state lives in the widget, not in separate tools:
- ❌
select-itemtool,set-filtertool - ✅ Widget manages with
useStateorsetState
4. exposeAsTool Defaults to false
Widgets are registered as resources only by default. Use a custom tool (recommended) or set exposeAsTool: true to expose a widget to the model:
// ✅ ALL 4 STEPS REQUIRED for proper type inference:
// Step 1: Define schema separately
const propsSchema = z.object({
title: z.string(),
items: z.array(z.string()),
});
// Step 2: Reference schema variable in metadata
export const widgetMetadata: WidgetMetadata = {
description: "...",
props: propsSchema, // ← NOT inline z.object()
exposeAsTool: false,
};
// Step 3: Infer Props type from schema variable
type Props = z.infer<typeof propsSchema>;
// Step 4: Use typed Props with useWidget
export default function MyWidget() {
const { props, isPending } = useWidget<Props>(); // ← Add <Props>
// ...
}
⚠️ Common mistake: Only doing steps 1-2 but skipping 3-4 (loses type safety)
5. Validate at Boundaries Only
- Trust internal code and framework guarantees
- Validate user input, external API responses
- Don't add error handling for scenarios that can't happen
6. Prefer Widgets for Browsing/Comparing
When in doubt, add a widget. Visual UI improves:
- Browsing multiple items
- Comparing data side-by-side
- Interactive selection workflows
Quick Reference
Minimal Server
import { MCPServer, text } from "mcp-use/server";
import { z } from "zod";
const server = new MCPServer({
name: "my-server",
title: "My Server",
version: "1.0.0",
});
server.tool(
{
name: "greet",
description: "Greet a user",
schema: z.object({ name: z.string().describe("User's name") }),
},
async ({ name }) => text("Hello " + name + "!"),
);
server.listen();
Response Helpers
| Helper | Use When | Example |
|---|---|---|
text() | Simple string response | text("Success!") |
object() | Structured data | object({ status: "ok" }) |
markdown() | Formatted text | markdown("# Title\nContent") |
widget() | Visual UI | widget({ props: {...}, output: text(...) }) |
mix() | Multiple contents | mix(text("Hi"), image(url)) |
error() | Error responses | error("Failed to fetch data") |
resource() | Embed resource refs | resource("docs://guide", "text/markdown") |
Alternatives
Compare before choosing
coreyhaines31/marketingskills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
JasonColapietro/suede-creator-skills
suede-ab-testing
Suede-owned experimentation discipline for hypotheses, sample sizing, test duration, significance, and repeatable experiment programs. Use when comparing variants, deciding whether a result is reliable, or building an experiment backlog and cadence. NOT FOR: analytics instrumentation (use suede-analytics), post-click conversion diagnosis (use suede-site-alchemy), or writing the variant copy itself (use suede-copy).
narrative-io/narrative-skills-marketplace
design-analysis
Translate a fuzzy analytical question into a rigorous investigation plan. Interrogates the ask, grounds the plan in the available data dictionary, applies analytical best practices, and produces a structured brief of query specifications for a downstream query-writing skill. Plans, does not write SQL. Use when: "why did X drop", "is there a relationship between A and B", "who are our highest-value customers", "what's driving the change in Y", "investigate this trend", "design an analysis for", "
event4u-app/agent-config
existing-ui-audit
Use BEFORE writing or editing any non-trivial UI — inventories components, design tokens, shadcn primitives, and reusable patterns into state.ui_audit. Hard gate for the ui directive set.