Learning resourcesReviewed · OpenAI

OpenAI Plugins: MCP server and UI quickstart

This is OpenAI's step-by-step developer tutorial for building a small to-do MCP server, with an optional in-chat widget, that ChatGPT can install as a plugin. It is aimed at developers comfortable with Node.js. Its main catch is that the example keeps tasks in one in-memory variable, has no authentication, and has to be served from a publicly reachable HTTPS endpoint ending in /mcp, through either a tunnel or a deployment, before ChatGPT can reach it. The tutorial supplies a single-file HTML widget and a Node server that uses the official MCP SDK and the MCP Apps helpers. It also explains how to test locally with MCP Inspector and how to connect the server in ChatGPT.

Researched 12 Nov 2026

In short.

This is OpenAI's developer quickstart for building a small to-do MCP server with an optional in-ChatGPT widget and installing it as a plugin. It suits developers comfortable with Node.js. Its main catch is that the sample is a demo: it uses shared in-memory state, has no authentication and allows requests from any origin (open CORS), and ChatGPT can only reach it through a publicly reachable HTTPS endpoint ending in /mcp, from either a tunnel or a deployment. The page walks through one HTML file that keeps the markup, CSS and JavaScript together and talks to the host over the MCP Apps bridge, which sends JSON-RPC messages through postMessage. It also supplies a server.js that uses @modelcontextprotocol/sdk, @modelcontextprotocol/ext-apps and zod to register a UI resource and two tools (add_todo, complete_todo) on a /mcp endpoint. It then covers running the server, testing it with MCP Inspector, exposing it through a tunnel such as ngrok, and creating the plugin in ChatGPT. None of the code was run. The captured text does not state costs, account or plan requirements, licence terms or the page's publication date.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the single selected documentation page at [https://developers.openai.com/plugins/build/app-quickstart.md], read in full as one captured file. Linked pages were excluded and not read. These include the MCP server concepts, ChatGPT UI, authentication, state management, submission and guidelines pages, the examples repository, the MCP SDK repository, and the MCP Inspector and ngrok documentation. No licence or terms file was captured, so rights are not stated. Nothing was executed: the code, package versions, local server, tunnel, MCP Inspector and ChatGPT plugin flow were not run or tested. No behaviour described in this report has been confirmed beyond what the page text says or what the printed code implies.

The overview

What this is

This is a single documentation page titled "MCP server and UI quickstart" on OpenAI's developer site [https://developers.openai.com/plugins/build/app-quickstart.md]. It is part of the Plugins build documentation. It is a tutorial, not a library or a product. It teaches how to build the server side of a plugin (an MCP server that defines tools) and an optional UI side (a web component rendered in an iframe inside ChatGPT).

The page says plugins use the Model Context Protocol to expose server-backed capabilities to ChatGPT and Codex. It also says ChatGPT implements the open MCP Apps UI standard, so a UI can be built once and run in other MCP Apps-compatible hosts. The domain and the links to the openai GitHub organisation show that OpenAI is the author. The captured text names no individual author and gives no version number for the page itself.

Assessment

Judged on the page text alone, this is a clear and complete first tutorial. It gives every file you need (an HTML widget, server.js and package.json) rather than fragments. It states the expected console output and includes the steps for connecting the server in ChatGPT. That makes it a good starting point for someone who wants to see the whole path from an empty folder to a plugin appearing in a chat.

It is deliberately a demo. The to-do data lives in one module-level variable, there is no authentication, and the server allows requests from any origin. The page says the server returns 404 for OAuth discovery routes "you are not using yet". It does not claim the sample is production-ready, and it points to separate pages on submission, guidelines, authentication and richer UI for that stage. Nothing was executed, so it is not known whether the code runs as written against current package versions and the current ChatGPT interface.

Who it is for

The main audience is developers who want to give ChatGPT (and, according to the page's introduction, Codex) new tools backed by their own server. The code is JavaScript for Node.js using ES modules, so it assumes basic comfort with npm, HTTP servers and browser JavaScript. A beginner who knows some JavaScript can follow it, because the steps are in order and the code is given in full. Someone new to MCP gets only a short explanation of the protocol on this page and is sent to a separate MCP server concepts page, which was not captured.

The page offers no Python code. Python developers are told to refer to OpenAI's examples repository for a server built with the Python SDK. Developers who want a React-based UI are pointed to the same repository [https://github.com/openai/openai-apps-sdk-examples]. The page states that teams who only need tools and no UI can skip the widget step.

What you can learn to do

Following the page, you build a basic to-do workflow with two tools the model can call: add_todo, which takes a non-empty title, and complete_todo, which takes an id. Both return text content plus structuredContent holding a tasks array, where each task has an id, a title and a completed flag. A widget registered at ui://widget/todo.html shows the list and has a form for adding tasks. The user can tick a checkbox to mark a task done. The widget calls the same tools through the host and redraws the list from the structured results. It also updates when the model itself calls a tool.

The page also shows how to register a UI resource and link it to tools through _meta.ui.resourceUri, and how to serve the MCP endpoint over Streamable HTTP. It covers answering CORS preflight requests and a health-check route, inspecting the server with MCP Inspector, and exposing it through a tunnel. Finally, it shows how to create a plugin from a custom MCP server in ChatGPT and install it. It mentions optional ChatGPT-specific extensions through window.openai but does not demonstrate them.

Using it

Requirements

The page states or implies these requirements. You need Node.js and npm; no minimum Node version is given. Your package.json needs "type": "module". You need the packages @modelcontextprotocol/sdk (^1.20.2), @modelcontextprotocol/ext-apps (^1.0.1) and zod (^3.25.76). ChatGPT has to be able to reach the server at a public HTTPS address ending in /mcp, for example through ngrok. You also need access to the ChatGPT Plugins page [https://chatgpt.com/plugins] with an option to add a custom MCP server. Running MCP Inspector uses npx and the @modelcontextprotocol/inspector package.

The page does not say which ChatGPT plans, workspace types or regions can add a custom MCP server, or whether admin approval is needed. It also does not give a minimum Node version, supported operating systems, or whether an ngrok account is needed. These points are unknown.

How it works

On the server side, server.js builds a new McpServer for each accepted POST, GET or DELETE request to /mcp. It connects that server to a StreamableHTTPServerTransport in stateless mode (sessionIdGenerator undefined, enableJsonResponse true). registerAppResource publishes the widget HTML at the ui:// address with the MCP Apps MIME type. registerAppTool defines each tool with a title, a description, a zod input schema, an output schema and a _meta.ui.resourceUri that links the tool to the widget. The HTTP handler answers OPTIONS requests on /mcp with CORS headers and GET / with a plain-text health response. It passes POST, GET and DELETE requests on /mcp to the MCP transport and returns 404 for everything else. It listens on the port set in the PORT environment variable, or 8787 if none is set.

On the widget side, the HTML runs inside an iframe and talks to the host with JSON-RPC 2.0 messages sent through window.parent.postMessage. It first sends a ui/initialize request with appInfo, empty appCapabilities and protocolVersion "2026-01-26", then a ui/notifications/initialized notification. It calls tools with tools/call and listens for ui/notifications/tool-result so it can update the list when the model calls a tool. It ignores any message that does not come from the parent window. For new UI, the page recommends using the MCP Apps bridge and adding window.openai features only when the standard lacks something you need.

Setup steps

The page gives these steps in this order. (1) Create public/todo-widget.html with the supplied code. (2) Install the dependencies with npm install @modelcontextprotocol/sdk @modelcontextprotocol/ext-apps zod. (3) Create server.js with the supplied code. (4) Make sure package.json has "type": "module". (5) Run node server.js and wait for the ready message, which says the to-do MCP server is listening on [http://localhost:8787/mcp]. (6) Optionally, run npx @modelcontextprotocol/inspector@latest, choose Streamable HTTP, enter [http://localhost:8787/mcp] and connect to inspect the tool responses. (7) Expose the port with a tunnel, for example with the command ngrok http <port>.

To connect the server in ChatGPT, open [https://chatgpt.com/plugins], select the plus button and choose Add custom MCP server. Paste the HTTPS address ending in /mcp, name the connection and configure authentication. Accept the risk warning and choose Create as a plugin. Then install the plugin, open a new chat, type @, select the plugin and prompt the model; the page suggests "Add a new task to read my book". After any change to tools, metadata or configuration, refresh the connection from the plugin's detail page. If you use a framework such as React, you first need a build step so the HTML template can inline the compiled assets. The plain HTML example needs no build step.

Worked example

The page itself is the worked example. After selecting the plugin with @, a user types a request such as "Add a new task to read my book". The model calls add_todo with a title. The server creates an item such as { id: "todo-1", title, completed: false } and adds it to the todos array. It returns the text "Added \"<title>\"." along with structuredContent containing all the tasks. ChatGPT renders the widget, which draws the list. The user can then tick a task's checkbox. The widget calls complete_todo with the task's id, the server marks the task completed, and the widget redraws it with a line through the title.

The code shows a few small behaviours. The widget will not let a user un-tick a completed task; it sets the checkbox back to ticked. The handler contains text replies for a whitespace-only title and an unknown task ID. Missing or empty required arguments violate the declared input schemas; runtime validation responses are unverified. Task ids come from a counter that resets when the server restarts. None of this was run, so it is not confirmed how ChatGPT actually renders the widget or what responses it shows.

Assessment & evidence

Limitations and risks

The design is demo-grade. Tasks are held in a module-level variable, so they are lost when the server restarts. Because every request shares that variable, all callers of one running server see the same list. The server runs in stateless mode and creates a new MCP server for each accepted POST, GET or DELETE request to /mcp. The server code has no authentication check, and the page says it returns 404 for OAuth discovery routes. The sample also sends Access-Control-Allow-Origin: * on /mcp. As written, any client that can reach a publicly exposed /mcp endpoint could call its tools, because the code contains nothing that would stop it. The page says authentication is covered on a separate page and that the ChatGPT connection flow shows a risk warning. Whether this code is secure enough for any particular use has not been checked.

The widget sends messages to window.parent with a target origin of "*". For incoming messages it checks event.source but not event.origin. The page does not discuss either point, and the security impact of these choices has not been checked. The UI depends on a specific MCP Apps protocol version string ("2026-01-26") and on the given package version ranges, so it may stop matching as those change. The page does not cover testing beyond MCP Inspector and manual chat prompts, error handling beyond basic checks, production deployment or Codex-specific setup. It links to separate pages on authentication, richer UI, state management, guidelines and submission. Those pages were not read, so their detailed contents are unknown.

Why this assessment

These conclusions come from reading the complete page, including both code listings and the steps around them. The identity, requirements, mechanism and setup details are taken directly from the page text. The limitations about shared in-memory state, open CORS, missing authentication and the permissive postMessage target origin are a reading of the code as printed, not results of running it. Costs, plan eligibility, licence and freshness are marked unknown because the page does not cover them. The judgement that this is a good first tutorial rests on how complete it is and how clearly its steps are ordered. That was checked only by reading the page, not by following the steps.

Alternatives and related paths

The page itself points to several related routes. OpenAI's examples repository [https://github.com/openai/openai-apps-sdk-examples] has a React-based UI and a server built with the Python SDK. The MCP TypeScript SDK repository is at [https://github.com/modelcontextprotocol/typescript-sdk]. A third route is a tools-only server that skips the UI resource entirely. The page also links to pages on authentication, richer UI, state management, guidelines and submission. Those pages were not read, so their detailed contents are unknown.

No alternatives beyond the page's own links were examined, so no comparison is made. If you only want to try the server locally, the page's MCP Inspector step lets you test it without ChatGPT.

Evidence base

The only evidence is the full text of the selected page, retrieved as the Markdown version of the documentation page (about 19 KB). It includes the introduction, the full HTML widget, the notes on the MCP Apps bridge, the Node server code, the instructions for running the server, using MCP Inspector and setting up a tunnel, the ChatGPT connection steps, and the closing links to next steps. It does not include any linked page, repository contents, package metadata, screenshots or change history. The page refers to an MCP Inspector image only as a link. Nothing from the page was executed, installed or tested.

Access & freshness

Costs

The page states no prices. The captured text does not say what it costs to access the page or to use the workflow it describes. The tutorial relies on a ChatGPT account that can use the Plugins page; the page does not say which ChatGPT plan is needed. It also needs a way to make the server reachable over public HTTPS. The page names ngrok as one tunnel tool but gives no pricing for it and does not say whether an account is needed. Deploying the server to a host is an optional alternative to a tunnel, not a stated requirement, and no hosting cost is given. The npm packages and MCP Inspector are mentioned without any licence or price information.

Rights and licence

The captured page contains no licence statement, copyright notice or terms of use for the tutorial text or the code snippets. This evidence therefore does not establish whether the snippets may be copied into your own projects, redistributed or republished. The examples repository, the MCP SDK and the other tools the page refers to may have their own licences, but those pages were not captured or read. Check the site terms and the repositories' licences before reusing the code for anything beyond following the tutorial.

Freshness

The page shows no publication or last-updated date. It lists @modelcontextprotocol/sdk ^1.20.2, @modelcontextprotocol/ext-apps ^1.0.1 and zod ^3.25.76, and the widget code sets an MCP Apps protocol version string of 2026-01-26. The text was captured on 12 November 2026. It is unknown whether the ChatGPT Plugins interface, button labels, package versions and protocol version still match what the page shows. Before relying on them, compare the page's version strings and steps with what you actually see.

What to do next

If you are building a ChatGPT or Codex plugin, use this page for a first end-to-end pass: set up the folder, run the server, check it in MCP Inspector, then connect it in ChatGPT through a tunnel. Treat the code as a teaching sample. Before connecting anything that handles real data, replace the in-memory list with real storage, add authentication, restrict CORS and check message origins.

Before you start, check the current page for changes to package versions or the protocol version. Also confirm that your ChatGPT account can add a custom MCP server, because this page does not say who can. Read the linked guidelines and authentication pages before sharing or submitting a plugin. Do not reuse the sample code beyond the tutorial until you have checked the licence position.

Evidence for this report

selected-page.txtselected · checked 2026-11-12