Index of every page on this site: llms.txt
All skills
mcp-use avatar

/mcp-apps-builder

@338b9a7 official
by Manufactmcp-use/mcp-use11k stars
1,535
Run it yourself

Build, modify, debug, migrate, review, or verify TypeScript MCP servers and MCP Apps with mcp-use. Use for tools, resources, prompts, middleware, Views, authentication, Skills over MCP, scaffolding, and advanced features.

Use this Skill: https://skilld.dev/gh/mcp-use/mcp-use/mcp-apps-builder

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesserver.md

≈850 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Server

Project and lifecycle

Import MCPServer from mcp-use. Default-export the server entry so mcp-use dev, mcp-use build, and mcp-use start can own the listener and View pipeline. Call server.listen() only in an explicitly standalone program.

Use the project's package manager and existing scripts. For a new stable project, scaffold instead of recreating framework boilerplate:

npx create-mcp-use-app@latest my-server --template mcp-server

Tools

Use a Standard Schema-compatible validator such as Zod, ArkType, or Valibot. Describe fields when the description helps a client or model choose valid input.

import { MCPServer } from "mcp-use";
import { z } from "zod";

const server = new MCPServer({ name: "inventory", version: "1.0.0" });

export const lookupInventory = server.tool(
  {
    name: "lookup-inventory",
    description: "Return available inventory for one SKU",
    inputSchema: z.object({ sku: z.string().describe("Inventory SKU") }),
    outputSchema: z.object({ sku: z.string(), available: z.number().int() }),
    annotations: { readOnlyHint: true, openWorldHint: false },
  },
  async ({ sku }) => {
    const data = { sku, available: await inventory.count(sku) };
    return {
      content: [{ type: "text", text: JSON.stringify(data) }],
      structuredContent: data,
    };
  },
);

export default server;

Use visibility: "app" for helper tools intended for Views but hidden from the model. Treat annotations as behavioral hints, not authorization controls.

Result channels

  • Put concise model-readable output in content.
  • Put schema-validated JSON in structuredContent when outputSchema exists.
  • Put invocation-specific, View-only data in result _meta; validate or narrow it in the View.
  • Return isError: true with useful content for expected operational failures.
  • Throw only for unexpected failures that should surface as protocol errors.

Resources and prompts

Use server.resource() for one stable URI and server.resourceTemplate() for a URI family. Return { contents: [...] }; each entry must include its URI and either text or a base64 blob. A template callback receives (uri, params, ctx), and template values may be string | string[].

Use server.prompt() for model-ready messages. Prompt arguments use schema, not a tool's inputSchema, and the callback returns { messages: [...] }. Wrap a string field with completable() when clients should receive suggestions without restricting other valid strings.

MCP middleware and request context

Register protocol middleware with server.use("mcp:<method>", handler). Use the narrowest operation, call next(), and return its result unless intentionally replacing it.

server.use("mcp:tools/call", async (ctx, next) => {
  const startedAt = Date.now();
  const result = await next();
  console.log(`${ctx.params.name}: ${Date.now() - startedAt}ms`);
  return result;
});

Tool, resource, and prompt callbacks receive request-scoped context. Use ctx.signal for cancellation, ctx.client for self-reported capabilities, and ctx.auth only when OAuth is configured. Never use client metadata for authorization.

Register static capabilities while constructing the server. Use the notification helpers described in Advanced features when discoverable lists or resource content change.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning11d5 checks · Risk SAFE
  • Gen Agent Trust Hub11d

    This skill provides comprehensive instructions for building and maintaining TypeScript MCP servers using the mcp-use framework, including scaffolding, authentication, and UI components.

  • Socket11d

    No alerts

  • Snyk11d

    Risk: LOW · No issues

  • Runlayer8mo

    6/20 files flagged

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 338b9a7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated 2 weeks ago
  • MCP
  • TypeScript
  • mcp-use
  • server
  • tools
  • resources
  • prompts
  • widgets
  • authentication

README badge

README badge for mcp-use/mcp-use/mcp-apps-builder

Provides architecture patterns, best practices, and reference guides for building MCP servers with the mcp-use framework, covering tools, resources, prompts, widgets, authentication, and deployment. Essential reading before implementing any MCP server feature—use the navigation guide to find the specific reference file for your task.

Generated from the current SKILL.md.

Is this skill for building MCP servers or using them?
This skill is for building MCP servers with mcp-use. It provides architecture patterns, authentication setup, and implementation guides for tools, resources, prompts, and widgets.
Do I need to read all the reference files before starting?
No. Start with concepts.md and architecture.md for foundations, then read only the specific reference file for the feature you're implementing (e.g., tools.md for creating a tool, authentication/overview.md for adding auth).
Can I manually create MCP server boilerplate instead of using the CLI?
No. Always use `npx create-mcp-use-app` to scaffold new projects. The CLI sets up TypeScript, dev scripts, inspector integration, and widget compilation that are difficult to replicate manually.
How do I test my MCP server without the inspector UI?
Use the `mcp-use client` CLI tool to drive your server from the terminal. Commands like `npx mcp-use client connect dev http://localhost:3000/mcp` let you list and call tools directly, optionally saving a screenshot with `--screenshot`.
Does this cover widget development?
Yes. The skill includes guides for building React-based widgets covering basics, state management, interactivity, theming, file uploads, and keeping the AI model aware of UI state.

Generated from the current SKILL.md. These answers refresh after source changes.