[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76A4NSDEBHTGEYN7WZ8TBMA":3,"skill-same:01M76A4NSDEBHTGEYN7WZ8TBMA":124},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M76A4NSDEBHTGEYN7WZ8TBMA","mcp-apps-builder",null,"**MANDATORY for ALL MCP server work** - mcp-use framework best practices and patterns.\n\n**READ THIS FIRST** before any MCP server work, including:\n- Creating new MCP servers\n- Modifying existing MCP servers (adding\u002Fupdating tools, resources, prompts, widgets)\n- Debugging MCP server issues or errors\n- Reviewing MCP server code for quality, security, or performance\n- Answering questions about MCP development or mcp-use patterns\n- Making ANY changes to server.tool(), server.resource(), server.prompt(), or widgets\n\nThis skill contains critical architecture decisions, security patterns, and common pitfalls.\nAlways consult the relevant reference files BEFORE implementing MCP features.","damianlevy1987-prog\u002Fpi-test","damianlevy1987-prog","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235310173?v=4","01M72VDA66B34NNC50D8P88PFD","damianlevy1987","01M72VDA6TY3QWGWXS0QWJA31W",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: mcp-apps-builder\ndescription: |\n  **MANDATORY for ALL MCP server work** - mcp-use framework best practices and patterns.\n\n  **READ THIS FIRST** before any MCP server work, including:\n  - Creating new MCP servers\n  - Modifying existing MCP servers (adding\u002Fupdating tools, resources, prompts, widgets)\n  - Debugging MCP server issues or errors\n  - Reviewing MCP server code for quality, security, or performance\n  - Answering questions about MCP development or mcp-use patterns\n  - Making ANY changes to server.tool(), server.resource(), server.prompt(), or widgets\n\n  This skill contains critical architecture decisions, security patterns, and common pitfalls.\n  Always consult the relevant reference files BEFORE implementing MCP features.\n---\n\n# IMPORTANT: How to Use This Skill\n\nThis file provides a NAVIGATION GUIDE ONLY. Before implementing any MCP server features, you MUST:\n\n1. Read this overview to understand which reference files are relevant\n2. **ALWAYS read the specific reference file(s)** for the features you're implementing\n3. Apply the detailed patterns from those files to your implementation\n\n**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.\n\n---\n\n# MCP Server Best Practices\n\nComprehensive guide for building production-ready MCP servers with tools, resources, prompts, and widgets using mcp-use.\n\n## ⚠️ FIRST: New Project or Existing Project?\n\n**Before doing anything else, determine whether you are inside an existing mcp-use project.**\n\n**Detection:** Check the workspace for a `package.json` that lists `\"mcp-use\"` as a dependency, OR any `.ts` file that imports from `\"mcp-use\u002Fserver\"`.\n\n```\n├─ mcp-use project FOUND → Do NOT scaffold. You are already in a project.\n│  └─ Skip to \"Quick Navigation\" below to add features.\n│\n├─ NO mcp-use project (empty dir, unrelated project, or greenfield)\n│  └─ Scaffold first with npx create-mcp-use-app, then add features.\n│     See \"Scaffolding a New Project\" below.\n│\n└─ Inside an UNRELATED project (e.g. Next.js app) and user wants an MCP server\n   └─ Ask the user where to create it, then scaffold in that directory.\n      Do NOT scaffold inside an existing unrelated project root.\n```\n\n**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.\n\n---\n\n### Scaffolding a New Project\n\n```bash\nnpx create-mcp-use-app my-server\ncd my-server\nnpm run dev\n```\n\nFor full scaffolding details and CLI flags, see **[quickstart.md](references\u002Ffoundations\u002Fquickstart.md)**.\n\n---\n\n## Quick Navigation\n\n**Choose your path based on what you're building:**\n\n### 🚀 Foundations\n\n**When:** ALWAYS read these first when starting MCP work in a new conversation. Reference later for architecture\u002Fconcept clarification.\n\n1. **[concepts.md](references\u002Ffoundations\u002Fconcepts.md)** - MCP primitives (Tool, Resource, Prompt, Widget) and when to use each\n2. **[architecture.md](references\u002Ffoundations\u002Farchitecture.md)** - Server structure (Hono-based), middleware system, server.use() vs server.app\n3. **[quickstart.md](references\u002Ffoundations\u002Fquickstart.md)** - Scaffolding, setup, and first tool example\n4. **[deployment.md](references\u002Ffoundations\u002Fdeployment.md)** - Deploying to Manufact Cloud, self-hosting, Docker, managing deployments\n\nLoad these before diving into tools\u002Fresources\u002Fwidgets sections.\n\n---\n\n### 🔐 Adding Authentication?\n\n**When:** Protecting your server with OAuth (WorkOS, Supabase, or custom)\n\n- **[overview.md](references\u002Fauthentication\u002Foverview.md)**\n  - When: First time adding auth, understanding `ctx.auth`, or choosing a provider\n  - Covers: `oauth` config, user context shape, provider comparison, common mistakes\n\n- **[workos.md](references\u002Fauthentication\u002Fworkos.md)**\n  - When: Using WorkOS AuthKit for authentication\n  - Covers: Setup, env vars, DCR vs pre-registered, roles\u002Fpermissions, WorkOS API calls\n\n- **[supabase.md](references\u002Fauthentication\u002Fsupabase.md)**\n  - When: Using Supabase for authentication\n  - Covers: Setup, env vars, HS256 vs ES256, RLS-aware API calls\n\n- **[custom.md](references\u002Fauthentication\u002Fcustom.md)**\n  - When: Using any other identity provider (GitHub, Okta, Azure AD, Google, etc.)\n  - Covers: Custom verification, user info extraction, provider examples\n\n---\n\n### 🔧 Building Server Backend (No UI)?\n\n**When:** Implementing MCP features (actions, data, templates). Read the specific file for the primitive you're building.\n\n- **[tools.md](references\u002Fserver\u002Ftools.md)**\n  - When: Creating backend actions the AI can call (send-email, fetch-data, create-user)\n  - Covers: Tool definition, schemas, annotations, context, error handling\n\n- **[resources.md](references\u002Fserver\u002Fresources.md)**\n  - When: Exposing read-only data clients can fetch (config, user profiles, documentation)\n  - Covers: Static resources, dynamic resources, parameterized resource templates, URI completion\n\n- **[prompts.md](references\u002Fserver\u002Fprompts.md)**\n  - When: Creating reusable message templates for AI interactions (code-review, summarize)\n  - Covers: Prompt definition, parameterization, argument completion, prompt best practices\n\n- **[response-helpers.md](references\u002Fserver\u002Fresponse-helpers.md)**\n  - When: Formatting responses from tools\u002Fresources (text, JSON, markdown, images, errors)\n  - Covers: `text()`, `object()`, `markdown()`, `image()`, `error()`, `mix()`\n\n---\n\n### 🎨 Building Visual Widgets (Interactive UI)?\n\n**When:** Creating React-based visual interfaces for browsing, comparing, or selecting data\n\n- **[basics.md](references\u002Fwidgets\u002Fbasics.md)**\n  - When: Creating your first widget or adding UI to an existing tool\n  - Covers: Widget setup, `useWidget()` hook, `isPending` checks, props handling\n\n- **[state.md](references\u002Fwidgets\u002Fstate.md)**\n  - When: Managing UI state (selections, filters, tabs) within widgets\n  - Covers: `useState`, `setState`, state persistence, when to use tool vs widget state\n\n- **[interactivity.md](references\u002Fwidgets\u002Finteractivity.md)**\n  - When: Adding buttons, forms, or calling tools from within widgets\n  - Covers: `useCallTool()`, form handling, action buttons, optimistic updates\n\n- **[ui-guidelines.md](references\u002Fwidgets\u002Fui-guidelines.md)**\n  - When: Styling widgets to support themes, responsive layouts, or accessibility\n  - Covers: `useWidgetTheme()`, light\u002Fdark mode, `autoSize`, layout patterns, CSS best practices\n\n- **[advanced.md](references\u002Fwidgets\u002Fadvanced.md)**\n  - When: Building complex widgets with async data, error boundaries, or performance optimizations\n  - Covers: Loading states, error handling, memoization, code splitting\n\n---\n\n### 📚 Need Complete Examples?\n\n**When:** You want to see full implementations of common use cases\n\n- **[common-patterns.md](references\u002Fpatterns\u002Fcommon-patterns.md)**\n  - End-to-end examples: weather app, todo list, recipe browser\n  - Shows: Server code + widget code + best practices in context\n\n---\n\n## Decision Tree\n\n```\nWhat do you need?\n\n├─ New project from scratch\n│  └─> quickstart.md (scaffolding + setup)\n│\n├─ OAuth \u002F user authentication\n│  └─> authentication\u002Foverview.md → provider-specific guide\n│\n├─ Simple backend action (no UI)\n│  └─> Use Tool: server\u002Ftools.md\n│\n├─ Read-only data for clients\n│  └─> Use Resource: server\u002Fresources.md\n│\n├─ Reusable prompt template\n│  └─> Use Prompt: server\u002Fprompts.md\n│\n├─ Visual\u002Finteractive UI\n│  └─> Use Widget: widgets\u002Fbasics.md\n│\n└─ Deploy to production\n   └─> deployment.md (cloud deploy, self-hosting, Docker)\n```\n\n---\n\n## Core Principles\n\n1. **Tools for actions** - Backend operations with input\u002Foutput\n2. **Resources for data** - Read-only data clients can fetch\n3. **Prompts for templates** - Reusable message templates\n4. **Widgets for UI** - Visual interfaces when helpful\n5. **Mock data first** - Prototype quickly, connect APIs later\n\n---\n\n## ❌ Common Mistakes\n\nAvoid these anti-patterns found in production MCP servers:\n\n### Tool Definition\n\n- ❌ Returning raw objects instead of using response helpers\n  - ✅ Use `text()`, `object()`, `widget()`, `error()` helpers\n- ❌ Skipping Zod schema `.describe()` on every field\n  - ✅ Add descriptions to all schema fields for better AI understanding\n- ❌ No input validation or sanitization\n  - ✅ Validate inputs with Zod, sanitize user-provided data\n- ❌ Throwing errors instead of returning `error()` helper\n  - ✅ Use `error(\"message\")` for graceful error responses\n\n### Widget Development\n\n- ❌ Accessing `props` without checking `isPending`\n  - ✅ Always check `if (isPending) return \u003CLoading\u002F>`\n- ❌ Widget handles server state (filters, selections)\n  - ✅ Widgets manage their own UI state with `useState`\n- ❌ Missing `McpUseProvider` wrapper or `autoSize`\n  - ✅ Wrap root component: `\u003CMcpUseProvider autoSize>`\n- ❌ Inline styles without theme awareness\n  - ✅ Use `useWidgetTheme()` for light\u002Fdark mode support\n\n### Security & Production\n\n- ❌ Hardcoded API keys or secrets in code\n  - ✅ Use `process.env.API_KEY`, document in `.env.example`\n- ❌ No error handling in tool handlers\n  - ✅ Wrap in try\u002Fcatch, return `error()` on failure\n- ❌ Expensive operations without caching\n  - ✅ Cache API calls, computations with TTL\n- ❌ Missing CORS configuration\n  - ✅ Configure CORS for production deployments\n\n---\n\n## 🔒 Golden Rules\n\n**Opinionated architectural guidelines:**\n\n### 1. One Tool = One Capability\n\nSplit broad actions into focused tools:\n\n- ❌ `manage-users` (too vague)\n- ✅ `create-user`, `delete-user`, `list-users`\n\n### 2. Return Complete Data Upfront\n\nTool calls are expensive. Avoid lazy-loading:\n\n- ❌ `list-products` + `get-product-details` (2 calls)\n- ✅ `list-products` returns full data including details\n\n### 3. Widgets Own Their State\n\nUI state lives in the widget, not in separate tools:\n\n- ❌ `select-item` tool, `set-filter` tool\n- ✅ Widget manages with `useState` or `setState`\n\n### 4. `exposeAsTool` Defaults to `false`\n\nWidgets are registered as resources only by default. Use a custom tool (recommended) or set `exposeAsTool: true` to expose a widget to the model:\n\n```typescript\n\u002F\u002F ✅ ALL 4 STEPS REQUIRED for proper type inference:\n\n\u002F\u002F Step 1: Define schema separately\nconst propsSchema = z.object({\n  title: z.string(),\n  items: z.array(z.string()),\n});\n\n\u002F\u002F Step 2: Reference schema variable in metadata\nexport const widgetMetadata: WidgetMetadata = {\n  description: \"...\",\n  props: propsSchema, \u002F\u002F ← NOT inline z.object()\n  exposeAsTool: false,\n};\n\n\u002F\u002F Step 3: Infer Props type from schema variable\ntype Props = z.infer\u003Ctypeof propsSchema>;\n\n\u002F\u002F Step 4: Use typed Props with useWidget\nexport default function MyWidget() {\n  const { props, isPending } = useWidget\u003CProps>(); \u002F\u002F ← Add \u003CProps>\n  \u002F\u002F ...\n}\n```\n\n⚠️ **Common mistake:** Only doing steps 1-2 but skipping 3-4 (loses type safety)\n\n### 5. Validate at Boundaries Only\n\n- Trust internal code and framework guarantees\n- Validate user input, external API responses\n- Don't add error handling for scenarios that can't happen\n\n### 6. Prefer Widgets for Browsing\u002FComparing\n\nWhen in doubt, add a widget. Visual UI improves:\n\n- Browsing multiple items\n- Comparing data side-by-side\n- Interactive selection workflows\n\n---\n\n## Quick Reference\n\n### Minimal Server\n\n```typescript\nimport { MCPServer, text } from \"mcp-use\u002Fserver\";\nimport { z } from \"zod\";\n\nconst server = new MCPServer({\n  name: \"my-server\",\n  title: \"My Server\",\n  version: \"1.0.0\",\n});\n\nserver.tool(\n  {\n    name: \"greet\",\n    description: \"Greet a user\",\n    schema: z.object({ name: z.string().describe(\"User's name\") }),\n  },\n  async ({ name }) => text(\"Hello \" + name + \"!\"),\n);\n\nserver.listen();\n```\n\n---\n\n## Response Helpers\n\n| Helper       | Use When               | Example                                       |\n| ------------ | ---------------------- | --------------------------------------------- |\n| `text()`     | Simple string response | `text(\"Success!\")`                            |\n| `object()`   | Structured data        | `object({ status: \"ok\" })`                    |\n| `markdown()` | Formatted text         | `markdown(\"# Title\\nContent\")`                |\n| `widget()`   | Visual UI              | `widget({ props: {...}, output: text(...) })` |\n| `mix()`      | Multiple contents      | `mix(text(\"Hi\"), image(url))`                 |\n| `error()`    | Error responses        | `error(\"Failed to fetch data\")`               |\n| `resource()` | Embed resource refs    | `resource(\"docs:\u002F\u002Fguide\", \"text\u002Fmarkdown\")`   |\n","# IMPORTANT: How to Use This Skill\n\nThis file provides a NAVIGATION GUIDE ONLY. Before implementing any MCP server features, you MUST:\n\n1. Read this overview to understand which reference files are relevant\n2. **ALWAYS read the specific reference file(s)** for the features you're implementing\n3. Apply the detailed patterns from those files to your implementation\n\n**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.\n\n---\n\n# MCP Server Best Practices\n\nComprehensive guide for building production-ready MCP servers with tools, resources, prompts, and widgets using mcp-use.\n\n## ⚠️ FIRST: New Project or Existing Project?\n\n**Before doing anything else, determine whether you are inside an existing mcp-use project.**\n\n**Detection:** Check the workspace for a `package.json` that lists `\"mcp-use\"` as a dependency, OR any `.ts` file that imports from `\"mcp-use\u002Fserver\"`.\n\n```\n├─ mcp-use project FOUND → Do NOT scaffold. You are already in a project.\n│  └─ Skip to \"Quick Navigation\" below to add features.\n│\n├─ NO mcp-use project (empty dir, unrelated project, or greenfield)\n│  └─ Scaffold first with npx create-mcp-use-app, then add features.\n│     See \"Scaffolding a New Project\" below.\n│\n└─ Inside an UNRELATED project (e.g. Next.js app) and user wants an MCP server\n   └─ Ask the user where to create it, then scaffold in that directory.\n      Do NOT scaffold inside an existing unrelated project root.\n```\n\n**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.\n\n---\n\n### Scaffolding a New Project\n\n```bash\nnpx create-mcp-use-app my-server\ncd my-server\nnpm run dev\n```\n\nFor full scaffolding details and CLI flags, see **[quickstart.md](references\u002Ffoundations\u002Fquickstart.md)**.\n\n---\n\n## Quick Navigation\n\n**Choose your path based on what you're building:**\n\n### 🚀 Foundations\n\n**When:** ALWAYS read these first when starting MCP work in a new conversation. Reference later for architecture\u002Fconcept clarification.\n\n1. **[concepts.md](references\u002Ffoundations\u002Fconcepts.md)** - MCP primitives (Tool, Resource, Prompt, Widget) and when to use each\n2. **[architecture.md](references\u002Ffoundations\u002Farchitecture.md)** - Server structure (Hono-based), middleware system, server.use() vs server.app\n3. **[quickstart.md](references\u002Ffoundations\u002Fquickstart.md)** - Scaffolding, setup, and first tool example\n4. **[deployment.md](references\u002Ffoundations\u002Fdeployment.md)** - Deploying to Manufact Cloud, self-hosting, Docker, managing deployments\n\nLoad these before diving into tools\u002Fresources\u002Fwidgets sections.\n\n---\n\n### 🔐 Adding Authentication?\n\n**When:** Protecting your server with OAuth (WorkOS, Supabase, or custom)\n\n- **[overview.md](references\u002Fauthentication\u002Foverview.md)**\n  - When: First time adding auth, understanding `ctx.auth`, or choosing a provider\n  - Covers: `oauth` config, user context shape, provider comparison, common mistakes\n\n- **[workos.md](references\u002Fauthentication\u002Fworkos.md)**\n  - When: Using WorkOS AuthKit for authentication\n  - Covers: Setup, env vars, DCR vs pre-registered, roles\u002Fpermissions, WorkOS API calls\n\n- **[supabase.md](references\u002Fauthentication\u002Fsupabase.md)**\n  - When: Using Supabase for authentication\n  - Covers: Setup, env vars, HS256 vs ES256, RLS-aware API calls\n\n- **[custom.md](references\u002Fauthentication\u002Fcustom.md)**\n  - When: Using any other identity provider (GitHub, Okta, Azure AD, Google, etc.)\n  - Covers: Custom verification, user info extraction, provider examples\n\n---\n\n### 🔧 Building Server Backend (No UI)?\n\n**When:** Implementing MCP features (actions, data, templates). Read the specific file for the primitive you're building.\n\n- **[tools.md](references\u002Fserver\u002Ftools.md)**\n  - When: Creating backend actions the AI can call (send-email, fetch-data, create-user)\n  - Covers: Tool definition, schemas, annotations, context, error handling\n\n- **[resources.md](references\u002Fserver\u002Fresources.md)**\n  - When: Exposing read-only data clients can fetch (config, user profiles, documentation)\n  - Covers: Static resources, dynamic resources, parameterized resource templates, URI completion\n\n- **[prompts.md](references\u002Fserver\u002Fprompts.md)**\n  - When: Creating reusable message templates for AI interactions (code-review, summarize)\n  - Covers: Prompt definition, parameterization, argument completion, prompt best practices\n\n- **[response-helpers.md](references\u002Fserver\u002Fresponse-helpers.md)**\n  - When: Formatting responses from tools\u002Fresources (text, JSON, markdown, images, errors)\n  - Covers: `text()`, `object()`, `markdown()`, `image()`, `error()`, `mix()`\n\n---\n\n### 🎨 Building Visual Widgets (Interactive UI)?\n\n**When:** Creating React-based visual interfaces for browsing, comparing, or selecting data\n\n- **[basics.md](references\u002Fwidgets\u002Fbasics.md)**\n  - When: Creating your first widget or adding UI to an existing tool\n  - Covers: Widget setup, `useWidget()` hook, `isPending` checks, props handling\n\n- **[state.md](references\u002Fwidgets\u002Fstate.md)**\n  - When: Managing UI state (selections, filters, tabs) within widgets\n  - Covers: `useState`, `setState`, state persistence, when to use tool vs widget state\n\n- **[interactivity.md](references\u002Fwidgets\u002Finteractivity.md)**\n  - When: Adding buttons, forms, or calling tools from within widgets\n  - Covers: `useCallTool()`, form handling, action buttons, optimistic updates\n\n- **[ui-guidelines.md](references\u002Fwidgets\u002Fui-guidelines.md)**\n  - When: Styling widgets to support themes, responsive layouts, or accessibility\n  - Covers: `useWidgetTheme()`, light\u002Fdark mode, `autoSize`, layout patterns, CSS best practices\n\n- **[advanced.md](references\u002Fwidgets\u002Fadvanced.md)**\n  - When: Building complex widgets with async data, error boundaries, or performance optimizations\n  - Covers: Loading states, error handling, memoization, code splitting\n\n---\n\n### 📚 Need Complete Examples?\n\n**When:** You want to see full implementations of common use cases\n\n- **[common-patterns.md](references\u002Fpatterns\u002Fcommon-patterns.md)**\n  - End-to-end examples: weather app, todo list, recipe browser\n  - Shows: Server code + widget code + best practices in context\n\n---\n\n## Decision Tree\n\n```\nWhat do you need?\n\n├─ New project from scratch\n│  └─> quickstart.md (scaffolding + setup)\n│\n├─ OAuth \u002F user authentication\n│  └─> authentication\u002Foverview.md → provider-specific guide\n│\n├─ Simple backend action (no UI)\n│  └─> Use Tool: server\u002Ftools.md\n│\n├─ Read-only data for clients\n│  └─> Use Resource: server\u002Fresources.md\n│\n├─ Reusable prompt template\n│  └─> Use Prompt: server\u002Fprompts.md\n│\n├─ Visual\u002Finteractive UI\n│  └─> Use Widget: widgets\u002Fbasics.md\n│\n└─ Deploy to production\n   └─> deployment.md (cloud deploy, self-hosting, Docker)\n```\n\n---\n\n## Core Principles\n\n1. **Tools for actions** - Backend operations with input\u002Foutput\n2. **Resources for data** - Read-only data clients can fetch\n3. **Prompts for templates** - Reusable message templates\n4. **Widgets for UI** - Visual interfaces when helpful\n5. **Mock data first** - Prototype quickly, connect APIs later\n\n---\n\n## ❌ Common Mistakes\n\nAvoid these anti-patterns found in production MCP servers:\n\n### Tool Definition\n\n- ❌ Returning raw objects instead of using response helpers\n  - ✅ Use `text()`, `object()`, `widget()`, `error()` helpers\n- ❌ Skipping Zod schema `.describe()` on every field\n  - ✅ Add descriptions to all schema fields for better AI understanding\n- ❌ No input validation or sanitization\n  - ✅ Validate inputs with Zod, sanitize user-provided data\n- ❌ Throwing errors instead of returning `error()` helper\n  - ✅ Use `error(\"message\")` for graceful error responses\n\n### Widget Development\n\n- ❌ Accessing `props` without checking `isPending`\n  - ✅ Always check `if (isPending) return \u003CLoading\u002F>`\n- ❌ Widget handles server state (filters, selections)\n  - ✅ Widgets manage their own UI state with `useState`\n- ❌ Missing `McpUseProvider` wrapper or `autoSize`\n  - ✅ Wrap root component: `\u003CMcpUseProvider autoSize>`\n- ❌ Inline styles without theme awareness\n  - ✅ Use `useWidgetTheme()` for light\u002Fdark mode support\n\n### Security & Production\n\n- ❌ Hardcoded API keys or secrets in code\n  - ✅ Use `process.env.API_KEY`, document in `.env.example`\n- ❌ No error handling in tool handlers\n  - ✅ Wrap in try\u002Fcatch, return `error()` on failure\n- ❌ Expensive operations without caching\n  - ✅ Cache API calls, computations with TTL\n- ❌ Missing CORS configuration\n  - ✅ Configure CORS for production deployments\n\n---\n\n## 🔒 Golden Rules\n\n**Opinionated architectural guidelines:**\n\n### 1. One Tool = One Capability\n\nSplit broad actions into focused tools:\n\n- ❌ `manage-users` (too vague)\n- ✅ `create-user`, `delete-user`, `list-users`\n\n### 2. Return Complete Data Upfront\n\nTool calls are expensive. Avoid lazy-loading:\n\n- ❌ `list-products` + `get-product-details` (2 calls)\n- ✅ `list-products` returns full data including details\n\n### 3. Widgets Own Their State\n\nUI state lives in the widget, not in separate tools:\n\n- ❌ `select-item` tool, `set-filter` tool\n- ✅ Widget manages with `useState` or `setState`\n\n### 4. `exposeAsTool` Defaults to `false`\n\nWidgets are registered as resources only by default. Use a custom tool (recommended) or set `exposeAsTool: true` to expose a widget to the model:\n\n```typescript\n\u002F\u002F ✅ ALL 4 STEPS REQUIRED for proper type inference:\n\n\u002F\u002F Step 1: Define schema separately\nconst propsSchema = z.object({\n  title: z.string(),\n  items: z.array(z.string()),\n});\n\n\u002F\u002F Step 2: Reference schema variable in metadata\nexport const widgetMetadata: WidgetMetadata = {\n  description: \"...\",\n  props: propsSchema, \u002F\u002F ← NOT inline z.object()\n  exposeAsTool: false,\n};\n\n\u002F\u002F Step 3: Infer Props type from schema variable\ntype Props = z.infer\u003Ctypeof propsSchema>;\n\n\u002F\u002F Step 4: Use typed Props with useWidget\nexport default function MyWidget() {\n  const { props, isPending } = useWidget\u003CProps>(); \u002F\u002F ← Add \u003CProps>\n  \u002F\u002F ...\n}\n```\n\n⚠️ **Common mistake:** Only doing steps 1-2 but skipping 3-4 (loses type safety)\n\n### 5. Validate at Boundaries Only\n\n- Trust internal code and framework guarantees\n- Validate user input, external API responses\n- Don't add error handling for scenarios that can't happen\n\n### 6. Prefer Widgets for Browsing\u002FComparing\n\nWhen in doubt, add a widget. Visual UI improves:\n\n- Browsing multiple items\n- Comparing data side-by-side\n- Interactive selection workflows\n\n---\n\n## Quick Reference\n\n### Minimal Server\n\n```typescript\nimport { MCPServer, text } from \"mcp-use\u002Fserver\";\nimport { z } from \"zod\";\n\nconst server = new MCPServer({\n  name: \"my-server\",\n  title: \"My Server\",\n  version: \"1.0.0\",\n});\n\nserver.tool(\n  {\n    name: \"greet\",\n    description: \"Greet a user\",\n    schema: z.object({ name: z.string().describe(\"User's name\") }),\n  },\n  async ({ name }) => text(\"Hello \" + name + \"!\"),\n);\n\nserver.listen();\n```\n\n---\n\n## Response Helpers\n\n| Helper       | Use When               | Example                                       |\n| ------------ | ---------------------- | --------------------------------------------- |\n| `text()`     | Simple string response | `text(\"Success!\")`                            |\n| `object()`   | Structured data        | `object({ status: \"ok\" })`                    |\n| `markdown()` | Formatted text         | `markdown(\"# Title\\nContent\")`                |\n| `widget()`   | Visual UI              | `widget({ props: {...}, output: text(...) })` |\n| `mix()`      | Multiple contents      | `mix(text(\"Hi\"), image(url))`                 |\n| `error()`    | Error responses        | `error(\"Failed to fetch data\")`               |\n| `resource()` | Embed resource refs    | `resource(\"docs:\u002F\u002Fguide\", \"text\u002Fmarkdown\")`   |\n",{"name":5,"description":7},"master","d79ad30f665ba072efbccd2b5f98affce4e64a10","addons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog","2026-05-15 05:46:13",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add damianlevy1987-prog\u002Fpi-test --skill mcp-apps-builder",{"tool":37,"command":38},"bunx","bunx skills add damianlevy1987-prog\u002Fpi-test --skill mcp-apps-builder",{"tool":40,"command":41},"pnpm","pnpm dlx skills add damianlevy1987-prog\u002Fpi-test --skill mcp-apps-builder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002FSKILL.md",true,[45,50,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":16},"LICENSE.txt","LICENSE","许可证",9164,{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fauthentication\u002Fcustom.md","REFERENCE","参考文档",7479,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fauthentication\u002Fcustom.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fauthentication\u002Foverview.md",7009,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fauthentication\u002Foverview.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fauthentication\u002Fsupabase.md",5771,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fauthentication\u002Fsupabase.md",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fauthentication\u002Fworkos.md",6810,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fauthentication\u002Fworkos.md",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Ffoundations\u002Farchitecture.md",6707,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Ffoundations\u002Farchitecture.md",{"path":73,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Ffoundations\u002Fconcepts.md",3527,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Ffoundations\u002Fconcepts.md",{"path":77,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Ffoundations\u002Fdeployment.md",3197,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Ffoundations\u002Fdeployment.md",{"path":81,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Ffoundations\u002Fquickstart.md",6515,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Ffoundations\u002Fquickstart.md",{"path":85,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fpatterns\u002Fcommon-patterns.md",22010,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fpatterns\u002Fcommon-patterns.md",{"path":89,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fserver\u002Fprompts.md",17269,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fserver\u002Fprompts.md",{"path":93,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fserver\u002Fresources.md",11772,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fserver\u002Fresources.md",{"path":97,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fserver\u002Fresponse-helpers.md",13196,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fserver\u002Fresponse-helpers.md",{"path":101,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fserver\u002Ftools.md",10547,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fserver\u002Ftools.md",{"path":105,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fwidgets\u002Fadvanced.md",20659,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fwidgets\u002Fadvanced.md",{"path":109,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fwidgets\u002Fbasics.md",18858,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fwidgets\u002Fbasics.md",{"path":113,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Fwidgets\u002Finteractivity.md",24795,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fwidgets\u002Finteractivity.md",{"path":117,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":118,"sourceHtmlUrl":119},"references\u002Fwidgets\u002Fstate.md",16289,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fwidgets\u002Fstate.md",{"path":121,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":122,"sourceHtmlUrl":123},"references\u002Fwidgets\u002Fui-guidelines.md",16889,"https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-apps-builder\u002Freferences\u002Fwidgets\u002Fui-guidelines.md",[125,134,142],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":129,"licenseFileUrl":130,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":20},"01M76A50ES11GJ2PFFJR6EW234","copilotkit","Use when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.","MIT","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002Fcopilot-skills\u002Fskills-main\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002Fcopilot-skills\u002Fskills-main\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":138,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":20},"01M76A4VT5D6H3JTWB5QFRHQ77","mcp-builder","DEPRECATED: This skill has been replaced by `mcp-app-builder`.\nCheck if `mcp-app-builder` is available in the skills folder. If not, install it:\n`npx skills install mcp-use\u002Fmcp-use --skill mcp-app-builder`\nUse `mcp-app-builder` instead of this skill.\n\nBuild Model Context Protocol (MCP) servers with mcp-use framework.\nUse when creating MCP servers, defining tools\u002Fresources\u002Fprompts, working with mcp-use,\nbootstrapping MCP projects, or when user mentions MCP development, tools, resources, or prompts.","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fmcp-builder\u002FSKILL.md",[],[],{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":146,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":20},"01M76A4HMMMC48QQSRZYB1447E","chatgpt-app-builder","DEPRECATED: This skill has been replaced by `mcp-app-builder`.\nCheck if `mcp-app-builder` is available in the skills folder. If not, install it:\n`npx skills install mcp-use\u002Fmcp-use --skill mcp-app-builder`\nUse `mcp-app-builder` instead of this skill.\n\nBuild ChatGPT apps with interactive widgets using mcp-use and OpenAI Apps SDK.\nUse when creating ChatGPT apps, building MCP servers with widgets, defining React widgets,\nworking with Apps SDK, or when user mentions ChatGPT widgets, mcp-use widgets, or Apps SDK development.","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fchatgpt-app-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdamianlevy1987-prog\u002Fpi-test\u002Fblob\u002Fmaster\u002Faddons-implementation\u002FCopilotKit\u002FCopilotKit-main\u002Fexamples\u002Fshowcases\u002Fopen-mcp-client\u002Fapps\u002Fmcp-use-server\u002F.agent\u002Fskills\u002Fchatgpt-app-builder\u002FSKILL.md",[],[]]