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
MCP server & MCP Apps framework
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
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
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.
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
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.
Saved “Monday invoices”
Snippet library · JavaScript excerpt
const minimum = erp.params.minimum;
// …
return erp.call("erpnext_doc_list", {
doctype: "Sales Invoice",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
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.
execute
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.@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
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
Contracts has no dependencies — no DOM, no MCP SDK, no React or Preact — so servers, hosts, agents and browser Apps import the same manifest.
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"],
}],
});@mcpview/contracts · experimentalDependency-free manifests for apps, resources, composition and recorded sessions.JSR npm
Get started
Build an MCP server with an interactive view. Deno-first, with a native Node build — same API on both.
1Install
Two packages: the server and the view runtime.
deno add jsr:@mcpview/server
deno add jsr:@mcpview/viewnpm i @mcpview/server @mcpview/view2Serve the view
Register the bundled view as a ui:// resource.
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.
// 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.
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
Six packages under the @mcpview scope: the MCP server framework, the MCP Apps view runtime and components, shared contracts, composition and bridges.
SERVER
MCP server framework for Deno and Node — concurrency, OAuth, HTTP/stdio, MCP Apps resources, saved Code Mode snippets.
SHARED
Dependency-free contracts — app manifests, composition, selection, recorded sessions.
IN THE VIEW
Browser-side runtime for MCP Apps — iframe lifecycle, routing, tool results, events, declared views for Code Mode results.
Preact component kit, theme and presentation runtime for views — with drill-down and context-pin controls.
ACROSS HOSTS
Multi-server boards — run Code Mode snippets across MCP servers and lay the results out as panels you can move and resize.
Bridge MCP Apps to external hosts such as Telegram and LINE, or to a private network.
Hosts
Ecosystem
Every MCP server Casys publishes runs on the mcpview server framework, and so do servers from the community.
npx -y @casys/mcp-erpnext --mode=code-mode.@casys/mcp-server, forked from mcp-erpnext.Questions
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.
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.
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.
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.
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.
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.
Claude (web and desktop), ChatGPT, VS Code with GitHub Copilot, and Goose render MCP Apps views.
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.