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.
How an MCP App fits together
An MCP App combines server capabilities and Views in one project:MCPServerregisters tools, resources, prompts, authentication, and middleware.- An AI client such as Claude or ChatGPT calls a tool.
- The tool returns model-readable
contentand optional typedstructuredContent. - When the tool has a
viewbinding, the client renders the matching React View with the tool result.
Build the server foundation
ImportMCPServer 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
Setlegacy 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:
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.