MCP server & MCP Apps framework

Point, open, go deeper — inside the MCP view.

mcpview is a TypeScript framework for MCP servers and MCP Apps — Deno-first, with a native Node build. The user acts in the view; the model follows along. With Code Mode, one executecall runs the model's script and can open its results in your views.

Deno · Node 20+ · TypeScript · MIT

Five interactions

Inside the view

Interactions · 5 recordings · mcp-erpnext 3.2.0-beta.3
ui://mcp-erpnext…/doclist-viewerClick to share context

A click adds a row, a chart point or a document to the model's context through ui/update-model-context.

Recorded with mcp-erpnext 3.2.0-beta.3 on a local ERPNext instance with demo data. In views that use the @mcpview/components0.14 controls, a click opens the detail, and a pin, a double-click or a long press toggles the item in the context.

Live demo

Try it

Real viewers from two MCP servers, running in an MCP Apps host on this page. Click, double-click, jump — the panel shows exactly what the view hands to the model.

Lists, charts and boards from ERPNext: open the documents behind a figure, follow the breadcrumb back, and select what the model should know.

Waiting to load…
Open standalone

Viewer bundles from mcp-erpnext 3.2.0 and mcp-syson 0.9.1 with the standard AppBridge from @modelcontextprotocol/ext-apps, on sample data and recorded SysON views, in your browser.

Code Mode

One tool. The model writes the program.

Instead of a long list of tools, the model gets one: execute. It writes a few lines of JavaScript that call your server's operations and can open the results in the views you declared. Saved as a snippet, the same script runs again in a new chat with new parameters.

ERPNext · Code ModeSynthetic data
  1. executeChat 1 · you
    executecode · min €1,000

    Overdue invoices

    2 · ≥€1,000
    • Sales invoice · SINV-QA-0001

      Atelier Boréal

      Due date
      Status
      Overdue
      Outstanding
      €1,200
    • Sales invoice · SINV-QA-0002

      Maison Atlas

      Due date
      Status
      Overdue
      Outstanding
      €3,400
  2. catalog save

    Saved “Monday invoices”

    Snippet library · JavaScript excerpt

    const minimum = erp.params.minimum;
    // …
    return erp.call("erpnext_doc_list", {
      doctype: "Sales Invoice",

    Snippet library · JavaScript

    Monday invoices

    // Overdue EUR invoices from a minimum outstanding amount.
    const minimum = erp.params.minimum;
    if (typeof minimum !== "number" || !Number.isFinite(minimum) || minimum < 0) {
      throw new Error("A non-negative minimum outstanding amount in EUR is required");
    }
    return erp.call("erpnext_doc_list", {
      doctype: "Sales Invoice",
      fields: ["name", "customer", "due_date", "currency", "outstanding_amount", "status"],
      filters: [["status", "=", "Overdue"], ["currency", "=", "EUR"], ["outstanding_amount", ">=", minimum]],
      order_by: "outstanding_amount asc",
    });
  3. New chat · you
    Monday invoices · min €3,000

    Overdue invoices

    1 · ≥€3,000
    • Sales invoice · SINV-QA-0002

      Maison Atlas

      Due date
      Status
      Overdue
      Outstanding
      €3,400

Build it@mcpview/server/snippets saves and replays snippets in a scope your server derives from the caller, @mcpview/view mounts or updates the view a result declares, and@mcpview/compose/code-mode runs snippets across several MCP servers. To try it on ERPNext: npx -y @casys/mcp-erpnext --mode=code-mode.Walkthrough ↗

Compose · driven by Code Mode

Several MCP servers, one board

Compose can build a dashboard from a template. With Code Mode, the model builds it: one execute call runs snippets on several MCP servers and lays the selected results out as panels of one board. You move and resize the panels, and saving the snippet can keep that layout.

One execute · 2 MCP servers
Two panels side by side. Left, the slicer server's PLA print estimate: 16 min 41 s, 917.27 mm and 2.74 g of filament, with its print settings. Right, the CAD server's 3D mounting plate, 40 × 24 × 4 mm, with zoom, wireframe and reset controls.
One call gets results from a CAD server and a slicer. The board shows the 3D part and the print estimate side by side.
Saved layout · ERPNext · sample data
Drag a panel by its grip, snap its corner to a width the view declares, then update the snippet. Replayed in a new chat, it brings the board back as arranged.
  • Several servers, one call. api.runSnippet runs an approved snippet on a configured MCP server and returns a value the next call can use. api.panelpicks what the board shows.
  • Panels stay mounted. Moving or resizing a panel keeps its view mounted and the event routes between panels in place.
  • The snippet can keep the layout. On an explicit save or update, the host stores the panels' order, widths and placements with the code. A replay fetches fresh results, and selections stay in their original chat.

@mcpview/compose · experimentalRun snippets across MCP servers in one execute call and lay the results out as panels you can move and resize.JSR npm

Beyond the host

Take the same view anywhere

Bridge serves any tool with a ui:// resource as a Telegram Mini App or a LINE LIFF app. It can also route tool calls from a cloud endpoint to a private network over an outbound WebSocket.

@mcpview/bridge · experimentalTelegram Mini Apps, LINE LIFF, and private-network routing.JSR npm

One shared contract

Typed contracts between server, view and host

Contracts has no dependencies — no DOM, no MCP SDK, no React or Preact — so servers, hosts, agents and browser Apps import the same manifest.

manifest.ts
import {
  defineViewAppManifest,
  VIEW_APP_MANIFEST_SCHEMA,
  VIEWER_SESSION_APPLY_ACTION,
} from "@mcpview/contracts";

export const manifest = defineViewAppManifest({
  schemaVersion: VIEW_APP_MANIFEST_SCHEMA,
  app: { id: "io.casys.cad.results", title: "CAD results", version: "1.0.0" },
  resources: [{
    uri: "ui://mcp-cad/results-viewer",
    ownership: "whole-view",
    resultSchemas: ["io.casys.cad.execution/1.0"],
    acceptedActions: [VIEWER_SESSION_APPLY_ACTION],
    sessionSchemas: ["io.casys.thread.cad-viewer-session/1.0"],
  }],
});
  • no DOM
  • no MCP SDK
  • no React / Preact
  • exact versions: /1.0, never latest

@mcpview/contracts · experimentalDependency-free manifests for apps, resources, composition and recorded sessions.JSR npm

Get started

Quickstart

Build an MCP server with an interactive view. Deno-first, with a native Node build — same API on both.

Quickstart · one server, one tool, one view

1Install

Two packages: the server and the view runtime.

terminal
deno add jsr:@mcpview/server
deno add jsr:@mcpview/view
terminal
npm i @mcpview/server @mcpview/view

2Serve the view

Register the bundled view as a ui:// resource.

server.ts
import { MCP_APP_MIME_TYPE, McpApp } from "@mcpview/server";

const server = new McpApp({ name: "invoices", version: "1.0.0" });

// The view: a single-file HTML bundle served as a ui:// resource.
server.registerResource(
  { uri: "ui://invoices/list-viewer", name: "Invoice list" },
  async (uri) => ({
    uri: uri.toString(),
    mimeType: MCP_APP_MIME_TYPE,
    text: "<!doctype html><html><!-- your bundled view --></html>",
  }),
);

3Point a tool at it

The tool declares its view in _meta; the model gets a short text, the view gets the data.

server.ts
// One tool. Hosts discover its view from _meta on the definition;
// the model's text stays tiny while the view renders the full data.
server.registerTool(
  {
    name: "invoice_list",
    description: "List recent invoices",
    inputSchema: {
      type: "object",
      properties: { limit: { type: "number" } },
    },
    _meta: { ui: { resourceUri: "ui://invoices/list-viewer" } },
  },
  async ({ limit = 20 }) => {
    const invoices = await listInvoices(limit); // your data source
    return {
      content: [{ type: "text", text: invoices.length + " invoices" }],
      structuredContent: {
        doctype: "Sales Invoice",
        count: invoices.length,
        data: invoices,
      },
      _meta: { ui: { resourceUri: "ui://invoices/list-viewer" } },
    };
  },
);

await server.start(); // stdio — or server.startHttp({ port: 3000 })

4Render it in the view

The view runtime handles the iframe handshake and routing.

view.ts · bundled to one HTML file
import { createMcpApp, defineView } from "@mcpview/view";

const app = await createMcpApp({
  info: { name: "Invoice list", version: "1.0.0" },
  root: document.getElementById("root")!,
  views: {
    list: defineView({ render: () => "<h2>Invoices</h2>" }),
  },
  initialView: "list",
});

5Connect a host

Point any MCP Apps host at your stdio command — or at the HTTP endpoint from startHttp().

Coming from @casys/mcp-*? Read the migration guide →

The @mcpview family

Packages

Six packages under the @mcpview scope: the MCP server framework, the MCP Apps view runtime and components, shared contracts, composition and bridges.

@mcpview · how the pieces fit

SERVER

@mcpview/server

MCP server framework for Deno and Node — concurrency, OAuth, HTTP/stdio, MCP Apps resources, saved Code Mode snippets.

  • middleware
  • OAuth2 · JWT
  • rate limiting
  • schema validation
  • backpressure
  • OpenTelemetry
  • Prometheus
  • MCP Apps resources

stableJSRnpmSource

SHARED

@mcpview/contracts

Dependency-free contracts — app manifests, composition, selection, recorded sessions.

experimentalJSRnpmSource

IN THE VIEW

@mcpview/view

Browser-side runtime for MCP Apps — iframe lifecycle, routing, tool results, events, declared views for Code Mode results.

experimentalJSRnpmSource

@mcpview/components

Preact component kit, theme and presentation runtime for views — with drill-down and context-pin controls.

experimentalJSRnpmSource

ACROSS HOSTS

@mcpview/compose

Multi-server boards — run Code Mode snippets across MCP servers and lay the results out as panels you can move and resize.

experimentalJSRnpmSource

@mcpview/bridge

Bridge MCP Apps to external hosts such as Telegram and LINE, or to a private network.

experimentalJSRnpmSource

Hosts

Where MCP views run

Claude

MCP Apps viewsViews
Yes
Model contextContext (ui/update-model-context)
Yes

ChatGPT

MCP Apps viewsViews
Yes
Model contextContext (ui/update-model-context)
Yes

VS Code

MCP Apps viewsViews
Yes
Model contextContext (ui/update-model-context)
Yes

Goose

MCP Apps viewsViews
Yes
Model contextContext (ui/update-model-context)
Not listed

Ecosystem

Built with it

Every MCP server Casys publishes runs on the mcpview server framework, and so do servers from the community.

Built with it · 15 servers · 2 from the community
ServerWhat it doesDomainLinks
@casys/mcp-erpnextpilot
ERPNext with interactive viewers — the pilot behind these videos. Opt-in Code Mode: npx -y @casys/mcp-erpnext --mode=code-mode.
ERP & FINANCE
@casys/mcp-einvoice
French e-invoicing, platform-agnostic.
ERP & FINANCE
@casys/mcp-syson
SysML v2 models through SysON.
SYSTEMS & SIMULATION
@casys/mcp-modelica
Modelica simulation with run evidence.
SYSTEMS & SIMULATION
@casys/mcp-chrono
Rigid-body kinematics.
SYSTEMS & SIMULATION
@casys/mcp-spice
Circuit analyses with ngspice.
SYSTEMS & SIMULATION
@casys/mcp-build123d
build123d CAD models.
MECHANICAL & MANUFACTURING
@casys/mcp-onshape
Onshape CAD/PDM, with interactive viewers.
MECHANICAL & MANUFACTURING
@casys/mcp-calculix
Finite-element analysis of STEP parts (CalculiX).
MECHANICAL & MANUFACTURING
@casys/mcp-dfm
Design-for-manufacturability checks on STEP geometry.
MECHANICAL & MANUFACTURING
@casys/mcp-tolerance
ISO 286 tolerances and stack-ups.
MECHANICAL & MANUFACTURING
@casys/mcp-prusaslicer
Print time and material from the PrusaSlicer CLI.
MECHANICAL & MANUFACTURING
@casys/mcp-std
A broad standard tool library for MCP.
TOOLING
@hvgllc/hvgerp-mcpcommunity
An ERPNext server built on @casys/mcp-server, forked from mcp-erpnext.
Community
@memetaltin/mcp-carbon-erpcommunity
Carbon ERP (Dokos / ERPNext), derived from mcp-erpnext.
Community

Questions

Frequently asked questions

FAQ · mcpview
What is mcpview?

mcpview is an open-source TypeScript framework for building Model Context Protocol (MCP) servers and MCP Apps — servers that return interactive views alongside their tool results. It is Deno-first, ships a native Node build, and is published as @mcpview/* on JSR and npm under the MIT license.

What is an MCP App?

An MCP App is a view that a server attaches to its tools: an HTML resource with a ui:// URI that the host renders next to the conversation. The view talks to the host: it can call the server's tools, update the model's context, and follow the host's theme and language.

How does mcpview compare with the official MCP SDK?

mcpview is built on the official @modelcontextprotocol packages and adds the production stack: a middleware pipeline, OAuth2 and JWT auth with OIDC presets, rate limiting, JSON Schema validation, concurrency control with backpressure, OpenTelemetry tracing, Prometheus metrics, and helpers for MCP Apps resources.

Does it run on Node.js?

Yes. Deno 2 is the primary target, including Deno Deploy, and Node.js 20+ is supported through a native ESM build with the same API.

What is active context?

Instead of pasting data into the chat, the user marks rows, chart points or documents in the view. The view sends a bounded snapshot to the host with ui/update-model-context, so the model knows what the user is pointing at. In views that use the @mcpview/components 0.16 controls, a click or a tap opens the detail immediately (0 ms), while the Select mode toggle, Cmd/Ctrl+click, rectangle drag, a pin, or a long press toggles items in the context.

What is Code Mode?

Instead of a long list of tools, the model gets one, execute, and writes a few lines of JavaScript that call the server's operations. A result can open in the view the server declares for it. With a snippet catalog, the program can be saved and replayed in a new chat with fresh inputs: @mcpview/server/snippets provides the catalog in a scope your server derives from the caller, and @mcpview/compose/code-mode runs snippets on several MCP servers and shows the selected results together.

Which hosts display MCP Apps views?

Claude (web and desktop), ChatGPT, VS Code with GitHub Copilot, and Goose render MCP Apps views.

Who maintains mcpview?

mcpview is maintained by Casys and released under the MIT license. Its pilot, mcp-erpnext, is the ERPNext MCP server shown in the videos and the demo.