Skip to main content
mcp-use is a full-stack TypeScript framework for MCP Apps. Every app is powered by a stateless MCPServer that exposes capabilities to AI clients and can render interactive React Views. Use this page to understand how the server and Views work together, configure protocol compatibility, and find the guide for each capability.

What the mcp-use framework provides

  • Stateless request handling: each MCP request runs independently, so server state belongs in your application storage instead of an MCP session.
  • Typed server primitives: tool inputs, tool outputs, and prompt arguments accept Standard Schema-compatible validators with JSON Schema conversion.
  • MCP App Views: bind React Views to tools and render interactive results in Claude and ChatGPT.
  • Authentication and middleware: verify callers with OAuth and apply shared behavior around HTTP requests or MCP operations.
  • Inspector-first development: run, inspect, and hot-reload tools, resources, prompts, and Views locally.
Zod, ArkType, and Valibot implement the required Standard Schema interfaces. Generated projects use Zod, but you can bring another compatible validation library without changing the mcp-use registration API.

How an MCP App fits together

An MCP App combines server capabilities and Views in one project:
  1. MCPServer registers tools, resources, prompts, authentication, and middleware.
  2. An AI client such as Claude or ChatGPT calls a tool.
  3. The tool returns model-readable content and optional typed structuredContent.
  4. When the tool has a view binding, the client renders the matching React View with the tool result.
A View is an optional presentation layer for a tool, not a separate project type. The same MCP App can contain tools that render Views and tools that return data without a user interface. Scaffold the complete MCP App stack:
The TypeScript quickstart walks through the generated server, tools, and View. Use Build your first MCP App for the complete View workflow.

Build the server foundation

Import MCPServer from mcp-use, register callbacks separately from their definitions, return MCP wire results, and default-export the server for the CLI.
mcp-use dev, mcp-use build, and mcp-use start use the default export and own the HTTP listener. A standalone Node.js script can call await server.listen() instead.

Choose protocol compatibility

Set legacy on MCPServer to decide whether the endpoint accepts older MCP protocol requests. Use "stateless" while clients are migrating. Use "reject" when every client connecting to the endpoint supports the modern protocol. See ServerConfig for the complete configuration surface.

Explore server capabilities

Tools and prompts accept Standard Schema-compatible validation libraries. Views use exported tool references and useToolContext() to infer their input and output types.

Develop locally

Run the development server from a scaffolded project:
The development server starts: Keep the Inspector open while editing index.ts and files under views/. The development server reloads MCP registrations and View assets as they change. Run the project type check after changing schemas or exported tool references:

Next steps

TypeScript quickstart

Scaffold, run, inspect, and deploy a v2 project.

Tools

Define validated tool inputs, outputs, and behavior.

MCP Apps

Return interactive React Views from tools.

Authentication

Protect the server and access verified caller identity.

Middleware

Add shared behavior around HTTP and MCP operations.

ServerConfig

Configure protocol compatibility, routing, logging, and CORS.