<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Development Tools</title><link>https://itsnikhil.github.io/blog/categories/development-tools/</link><description>I am a programmer interested in all sorts of technology. I like working on open source projects, writing blog articles, and reading on the internet. I also like swimming, biking and playing games. I study at The Northcap University.</description><language>en-us</language><atom:link href="https://itsnikhil.github.io/blog/categories/development-tools/index.xml" rel="self" type="application/rss+xml"/><item><title>I Built a Local Dev Tool for ChatGPT Apps SDK</title><link>https://itsnikhil.github.io/blog/posts/oai-app-composer/</link><guid>https://itsnikhil.github.io/blog/posts/oai-app-composer/</guid><pubDate>Wed, 05 Nov 2025 00:00:00 GMT</pubDate><description>&lt;p&gt;When OpenAI released the &lt;strong&gt;Apps SDK&lt;/strong&gt;, I was really excited.
It finally allowed developers to build &lt;strong&gt;custom UI components&lt;/strong&gt; inside ChatGPT, a big step toward making ChatGPT more like a real app platform.&lt;/p&gt;
&lt;p&gt;So I tried it on day one.
And getting it to work, I quickly realized that testing these apps locally wasn’t easy.&lt;/p&gt;
&lt;h2 id=&quot;the-setup-i-wanted-to-avoid&quot;&gt;The Setup I Wanted to Avoid&lt;/h2&gt;
&lt;p&gt;&lt;span id=&quot;the-developer-experience-today&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When I started experimenting with the SDK in late 2025, testing a simple app inside ChatGPT involved:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Having access to &lt;strong&gt;ChatGPT developer mode&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Running a local &lt;strong&gt;MCP server&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Exposing it using &lt;strong&gt;ngrok&lt;/strong&gt; (or another tunnel)&lt;/li&gt;
&lt;li&gt;Serving a bundled component with proper &lt;strong&gt;Content Security Policy (CSP)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even then, you can run into issues like tools not working or ChatGPT not loading your resources correctly.
It felt like too much setup just to preview a button click or test a small UI change.&lt;/p&gt;
&lt;h2 id=&quot;the-idea-mock-the-chatgpt-environment-locally&quot;&gt;The Idea: Mock the ChatGPT Environment Locally&lt;/h2&gt;
&lt;p&gt;The Apps SDK components I was building used &lt;code&gt;window.openai&lt;/code&gt; as the bridge to their ChatGPT host.&lt;/p&gt;
&lt;p&gt;So I thought,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“What if I just mock that API locally?”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If I can simulate &lt;code&gt;window.openai.callTool()&lt;/code&gt;, &lt;code&gt;widgetState&lt;/code&gt;, and &lt;code&gt;setWidgetState()&lt;/code&gt;,
I could preview components in a local sandbox that simulates the interactions I wanted to test
without running a real MCP server or using ChatGPT at all.&lt;/p&gt;
&lt;h2 id=&quot;the-result-a-storybook-like-ide-for-chatgpt-components&quot;&gt;The Result: A Storybook-Like IDE for ChatGPT Components&lt;/h2&gt;
&lt;p&gt;I built a &lt;strong&gt;local development tool&lt;/strong&gt; that does exactly that.
It’s a &lt;strong&gt;Storybook-style IDE&lt;/strong&gt; for developing and testing ChatGPT MCP components — locally with mock data, without connecting to ChatGPT.&lt;/p&gt;
&lt;p&gt;The preview loads React, ReactDOM and Tailwind from CDNs, so it still needs network access unless those assets are made local.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/journalapp/image/upload/v1762364992/component-development-tool-for-chatgpt-app-sdk-v0-wclnjfh8l9zf1_te08ut.webp&quot; alt=&quot;Component Preview Screenshot&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;-features&quot;&gt;✨ Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;🎨 &lt;strong&gt;React + Vite + TypeScript&lt;/strong&gt; with hot reload&lt;/li&gt;
&lt;li&gt;🔍 &lt;strong&gt;Monaco-based JSON editor&lt;/strong&gt; for mock data&lt;/li&gt;
&lt;li&gt;🎭 &lt;strong&gt;Sandboxed ChatGPT-like preview&lt;/strong&gt; inside an iframe&lt;/li&gt;
&lt;li&gt;🌐 Mock implementations of common &lt;strong&gt;&lt;code&gt;window.openai&lt;/code&gt; APIs&lt;/strong&gt; (tool calls, state, etc.)&lt;/li&gt;
&lt;li&gt;💾 &lt;strong&gt;Widget state simulation&lt;/strong&gt; using IndexedDB&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Copy starter MCP server code&lt;/strong&gt; for deployment&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Component templates&lt;/strong&gt; for faster starts (List Card, Map Card, Carousel, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;how-it-works&quot;&gt;How It Works&lt;/h2&gt;
&lt;p&gt;Each component lives in its own folder:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;components/
  my-widget/
    ├── manifest.json
    ├── component.tsx
    └── mocks/
        ├── default.json
        ├── empty.json
        └── loading.json
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When you open the dev tool, it loads your component inside a sandboxed iframe.
A small bridge script injects a mock &lt;code&gt;window.openai&lt;/code&gt; object. A component can then use the bridge like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;hljs language-ts&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;const&lt;/span&gt; state = &lt;span class=&quot;hljs-variable language_&quot;&gt;window&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;openai&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;widgetState&lt;/span&gt; ?? {};
&lt;span class=&quot;hljs-variable language_&quot;&gt;window&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;openai&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;setWidgetState&lt;/span&gt;({ ...state, &lt;span class=&quot;hljs-attr&quot;&gt;selectedId&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;item-1&amp;quot;&lt;/span&gt; });
&lt;span class=&quot;hljs-keyword&quot;&gt;const&lt;/span&gt; result = &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;hljs-variable language_&quot;&gt;window&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;openai&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;callTool&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&amp;quot;get_items&amp;quot;&lt;/span&gt;, {});
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The local bridge routes these calls to fixtures and local state. It does not replace integration testing in ChatGPT, especially for CSP, authentication, tool behavior and host-specific UI.
You can call tools, update state, and see real-time results — no tunnel required.&lt;/p&gt;
&lt;h2 id=&quot;quick-templates-for-faster-start&quot;&gt;Quick Templates for Faster Start&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/journalapp/image/upload/v1762364991/component-development-tool-for-chatgpt-app-sdk-v0-h9hs6ze9o9zf1_jhftmy.webp&quot; alt=&quot;Template Selector Screenshot&quot;&gt;&lt;/p&gt;
&lt;p&gt;You don’t have to start from scratch.
The tool includes ready-to-use templates like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;List Card&lt;/li&gt;
&lt;li&gt;Map Card&lt;/li&gt;
&lt;li&gt;Image Carousel&lt;/li&gt;
&lt;li&gt;Grid Layout&lt;/li&gt;
&lt;li&gt;Blank Canvas&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click &amp;quot;New Component&amp;quot;, pick a template, and get a scaffolded setup with mock data in seconds.&lt;/p&gt;
&lt;h2 id=&quot;simulating-tool-calls-and-flows&quot;&gt;Simulating Tool Calls and Flows&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/journalapp/image/upload/v1762364992/component-development-tool-for-chatgpt-app-sdk-v0-5rznw9oml9zf1_uzvm3a.webp&quot; alt=&quot;Tool Routing Screenshot&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can even simulate &lt;strong&gt;tool switching&lt;/strong&gt; — for example, how one component triggers another when calling &lt;code&gt;window.openai.callTool()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Define simple “tool routing rules” inside the app and test multi-step flows locally.&lt;/p&gt;
&lt;h2 id=&quot;why-i-built-it&quot;&gt;Why I Built It&lt;/h2&gt;
&lt;p&gt;ChatGPT Apps are powerful — but the setup I encountered made simple experiments slow.
I wanted a way for frontend developers to &lt;strong&gt;just start building&lt;/strong&gt;, without setup pain or dependency on the ChatGPT UI.&lt;/p&gt;
&lt;p&gt;This tool makes local prototyping easy, fast, and open for everyone — no tunnels, no accounts, no waiting.&lt;/p&gt;
&lt;h2 id=&quot;try-it-yourself&quot;&gt;Try It Yourself&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href=&quot;https://github.com/itsnikhil/oai-app-composer&quot;&gt;https://github.com/itsnikhil/oai-app-composer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Install Git, Node.js and npm first. To reproduce the reviewed version:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;hljs language-bash&quot;&gt;git &lt;span class=&quot;hljs-built_in&quot;&gt;clone&lt;/span&gt; https://github.com/itsnikhil/oai-app-composer.git
&lt;span class=&quot;hljs-built_in&quot;&gt;cd&lt;/span&gt; oai-app-composer
git checkout d6163e3bec1a2c9b0234471ca128c7a5bd608ac5
npm install
npm run dev
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Open the local URL printed by Vite, normally &lt;code&gt;http://localhost:3000&lt;/code&gt;. Vite may choose another port if 3000 is occupied. The commands were checked against the linked source. In a separate checkout of this pinned version, dependency installation with lifecycle scripts disabled and &lt;code&gt;npm run build&lt;/code&gt; both passed on Node.js 24.22.1. This verifies dependency resolution and the TypeScript/production build, not every browser interaction or ChatGPT integration.&lt;/p&gt;
&lt;p&gt;You’ll see a sidebar with components and a live ChatGPT-like preview on the right.
Edit mock data, change your UI, and see results instantly.&lt;/p&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;The OpenAI Apps SDK is a huge step forward — but it’s still early.
Tools like this can make the developer experience smoother and help more people build quality apps.&lt;/p&gt;
&lt;p&gt;If you’re exploring ChatGPT Apps SDK, give it a try.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Built with ❤️ for the ChatGPT developer community&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;accuracy-update--9-november-2026&quot;&gt;Accuracy update — 9 November 2026&lt;/h3&gt;
&lt;p&gt;The descriptions above were clarified against the &lt;a href=&quot;https://github.com/itsnikhil/oai-app-composer/tree/d6163e3bec1a2c9b0234471ca128c7a5bd608ac5&quot;&gt;November 2025 implementation&lt;/a&gt;. The preview uses CDN assets, the API bridge is a mock rather than full host parity, and export provides starter MCP server code with implementation work remaining. For current setup and API requirements, consult the &lt;a href=&quot;https://help.openai.com/en/articles/12584461-developer-mode-and-full-mcp-apps-in-chatgpt-beta&quot;&gt;developer-mode documentation&lt;/a&gt; and &lt;a href=&quot;https://developers.openai.com/plugins/reference&quot;&gt;Apps SDK reference&lt;/a&gt;.&lt;/p&gt;
</description></item></channel></rss>