Discover and explore top open-source AI tools and projects—updated daily.
vercel-labsNext.js starter for building OpenAI Apps SDK compatible MCP servers
Top 100.0% on SourcePulse
This starter project provides a minimal Next.js application template for building OpenAI Apps SDK compatible MCP (Model Context Protocol) servers. It enables developers to expose tools and resources that can be called from ChatGPT, with responses rendered natively within the ChatGPT interface as interactive widgets. The primary benefit is seamless integration, allowing Next.js applications to act as dynamic components within the ChatGPT user experience.
How It Works
The project leverages a Next.js application as an MCP server. A dedicated route (app/mcp/route.ts) registers tools and resources, including HTML content for iframe rendering, using OpenAI-specific metadata. Crucially, next.config.ts is configured with an assetPrefix to ensure static assets load correctly within the iframe context. A CORS middleware handles preflight requests for cross-origin communication. The NextChatSDKBootstrap component in app/layout.tsx patches browser APIs like window.fetch and history.pushState to ensure proper functionality within the ChatGPT iframe environment.
Quick Start & Requirements
npm install or pnpm installnpm run dev or pnpm devHighlighted Details
openai/resultCanProduceWidget: true to enable widget rendering.assetPrefix configuration in next.config.ts prevents 404 errors for static assets loaded within the iframe.suppressHydrationWarning due to initial HTML modifications by ChatGPT.Maintenance & Community
No specific details regarding maintainers, community channels, or project health signals were found in the provided README.
Licensing & Compatibility
The README does not explicitly state the project's license. Compatibility for commercial use or closed-source linking is undetermined without a specified license.
Limitations & Caveats
Connecting MCP servers to ChatGPT requires developer mode access. The suppressHydrationWarning prop is currently a mandatory configuration due to ChatGPT modifying the initial HTML before Next.js hydration.
4 months ago
Inactive
openai