Skip to main content
Use the mcp-use TypeScript server framework to expose tools, resources, prompts, or interactive MCP App views. Start with the quickstart, or see the v1 migration guide.

Create a server

server.fetch is the Web-standard deployment handler. server.listen() uses the same application for local Node serving. The protocol runtime is stateless: registrations are replayed into a fresh SDK server for each request, so register everything before the first request.

Register a tool

Schemas implement Standard Schema; Zod 4 is the documented example.
Prefer raw MCP result envelopes. Deprecated response helpers remain available for migration, but new tools with outputSchema should return matching structuredContent and model-visible content.

Add an MCP App view

Put the component at views/<name>/view.tsx, bind exactly one tool with view: { name }, and declare its outputSchema. The view reads pending, error, and ready states through useToolContext().
See MCP Apps for binding, assets, CSP, and host hooks.

Develop locally

The default scaffold serves MCP at http://localhost:3000/mcp and opens the Inspector at http://localhost:3000/mcp/inspector. Successful server reloads swap the handler used by subsequent requests; view edits use Vite hot module replacement.

Tools

Define typed model actions.

Resources

Expose readable URI content.

Prompts

Publish reusable prompt templates.

Authentication

Protect the MCP endpoint.

OpenAPI

Generate tools from an API document.

Deployment

Build and deploy the server.