PM

pomerium/mcp-app-typescript-template

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

20 stars 5 forks 品質 79 トレンド 14Apache-2.0

Pomerium、Model Context Protocol (MCP) TypeScript SDK を使用した MCP アプリテンプレートで、Node.js サーバーと Vite が提供する React ウィジェットを使用します.

概要

よく設計されたスターターテンプレートは、Reactウィジェットでモデルコンテキストプロトコル(MCP)を使用してMCPアプリを構築するためのベストプラクティスを実証しています。 TypeScript、Tailwind CSS v4、Pinoロギング、ストーリーブック、Vivtestを活用し、堅牢な開発体験を実現します。 - - McpServer と MCP Apps ヘルパーで Node.js サーバー - Zod 検証と UI のバインディングを使った例のツール - MCP Apps API デモ - インライン、ピクチャインピクチャ、リクエストを介してランタイムトggling でフルスクリーン - callServerTool、openLink、 sendMessage、updateModelContext が Echo ウィジェットのファクトリで紹介されている - トランスポートセッションやセッションのアフィニティーなしで Per-request server または ライブサーバーをロードする - VMRD からライブサーバーをロードする -.

概要(AI 翻訳)

よく設計されたスターターテンプレートは、Reactウィジェットでモデルコンテキストプロトコル(MCP)を使用してMCPアプリを構築するためのベストプラクティスを実証しています。 TypeScript、Tailwind CSS v4、Pinoロギング、ストーリーブック、Vivtestを活用し、堅牢な開発体験を実現します。

##特徴

  • MCP Server - [McpServer]とMCP Appsヘルパーを持つNode.jsサーバー
  • Echo Tool - Zod検証とUIバインディングによるサンプルツール
  • React Widgets - MCP Apps [[App] API デモでインタラクティブな Echo コンポーネント
  • 表示モード - インライン、画像、およびランタイムトグルリングによるフルスクリーン[requestDisplayMode() -App API Demo - [callServerTool, [openLink]], [sendMessage]], [[updateModelContext]]エコーウィジェットに表示 -Stateless MCP HTTP - トランスポートセッションやセッションのアフィニティなしの Per-request サーバー工場
  • No-Build Dev Loop - Widgets は、Claude.ai と ChatGPT で Vite dev サーバからライブ
  • コンテナの寸法 - ホスト認証によるレスポンシブウィジェット [containerDimensions -Mock App - ドロップイン createMockApp()] - ライブMCP接続なしでテストとストーリーブックのヘルパー

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

MCP Apps Template

A well-architected starter template demonstrating best practices for building MCP Apps using the Model Context Protocol (MCP) with React widgets. It leverages TypeScript, Tailwind CSS v4, Pino logging, Storybook, and Vitest for a robust development experience.

Features

  • MCP Server - Node.js server with McpServer and MCP Apps helpers
  • Echo Tool - Example tool with Zod validation and UI binding
  • React Widgets - Interactive Echo component with MCP Apps App API demo
  • Display Modes - Inline, picture-in-picture, and fullscreen with runtime toggling via requestDisplayMode()
  • App API Demo - callServerTool, openLink, sendMessage, updateModelContext showcased in the Echo widget
  • Stateless MCP HTTP - Per-request server factories with no transport sessions or session affinity
  • No-Build Dev Loop - Widgets load live from the Vite dev server with HMR in Claude.ai and ChatGPT
  • Container Dimensions - Responsive widget sizing using host-provided containerDimensions
  • Mock App - Drop-in createMockApp() helper for testing and Storybook without a live MCP connection
  • Pino Logging - Structured logging with pretty printing in development
  • TypeScript - Strict mode with ES2023 target
  • Tailwind CSS v4 - Modern styling with dark mode support
  • Storybook - Component development with a11y addon
  • Testing - Vitest for server and widgets with accessibility checks
  • Build Optimizations - Parallel builds, content hashing, compression
  • Docker - Multi-stage builds with health checks
  • Production Ready - Stateless transport, graceful shutdown, and error handling

Architecture

graph TD
    A[MCP Host] -->|HTTPStreamable| B[MCP ServerNode.js + Express]
    B -->|_meta.ui.resourceUri| C[App ViewReact in iframe]

    B -.-> B1[Echo Tool]
    B -.-> B2[Resource Registration]
    B -.-> B3[text/html;profile=mcp-appMIME type]

    C -.-> C1[Receives App.ontoolresult]
    C -.-> C2[callServerTool, openLink,sendMessage, updateModelContext]
    C -.-> C3[Theme, displayMode, safeArea,containerDimensions]

    style A fill:#e1f5ff
    style B fill:#fff4e6
    style C fill:#f3e5f5

Quick Start

Setup time: ~5 minutes (first time)

Prerequisites

  • Node.js 24+ (required for ES2023 support and native type stripping)
    • Verify: node -v (should show v24.0.0 or higher)
  • npm 11+ (ships with Node 24)
    • Verify: npm -v (should show v10.0.0 or higher)

Supported platforms: macOS, Linux, Windows (via WSL2)

Installation & Setup

git clone https://github.com/pomerium/mcp-app-typescript-template your-mcp-app
cd your-mcp-app
npm install
npm run dev
GitHub で README 全文を見る

インストール

npx playwright install --with-deps chromium`.
MCP 初心者?mcpskill.org のガイドから始めましょう →