Install any skill in seconds. Free to start, no credit card required.
Get Started Free →**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.promp
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 39% | 0% |
Treat the installed mcp-use package, its generated types, and the project's existing exports as the source of truth. Check the installed version before changing code; do not assume APIs from mcp-use v1.
package.json, the server entry, exported tool refs, views/, and the installed mcp-use version.npx create-mcp-use-app@latest; do not hand-build framework boilerplate.mcp-use; provider adapters come from mcp-use/oauth/*; React APIs come from mcp-use/react.inputSchema; add outputSchema when returning structured data or binding a View.content, structuredContent, and optionally _meta or isError.views/<name>/view.tsx and bind it with view: { name: "<name>" }.useToolContext; use focused hooks such as useCallTool, useViewState, useHostContext, and useDisplayMode for additional behavior.mcp-use dev, build, and start own framework lifecycle and View compilation.tsimport { MCPServer } from "mcp-use"; import { z } from "zod"; const server = new MCPServer({ name: "catalog", version: "1.0.0" }); export const showProduct = server.tool( { name: "show-product", description: "Show one catalog product", inputSchema: z.object({ id: z.string() }), outputSchema: z.object({ id: z.string(), name: z.string() }), view: { name: "product" }, }, async ({ id }) => { const product = { id, name: "Example product" }; return { content: [{ type: "text", text: JSON.stringify(product) }], structuredContent: product, }; }, ); export default server;
tsx// views/product/view.tsx import { ThemeProvider, useToolContext } from "mcp-use/react"; export default function ProductView() { const view = useToolContext<"show-product">(); if (view.status === "pending") return <p>Loading…</p>; if (view.status === "error") return <p>{view.error.message}</p>; return <ThemeProvider>{view.toolOutput.name}</ThemeProvider>; }
outputSchema and matching structuredContent.Run node <skill-dir>/scripts/check-v2.mjs <project-root> during migrations and reviews, then complete the focused checks in Verification.
Put reusable agent workflows in skills/<name>/SKILL.md; the directory is served automatically, so normally omit the skills server option. Use skills: false to disable it or skills: { directory: "server-skills" } to override the project-relative directory. Keep supporting references, scripts, templates, and assets in the skill instead of inflating tool descriptions.
Other measured skills in the registry, with their headline benchmark lift.