BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/utilcn/chatgpt-app-backend

ChatGPT MCP Backend

utilcn/chatgpt-app-backend
FreeBlock

MCP server bootstrap, widget asset builder, and tool registration for the ChatGPT widget.

Install it

npx shadcn@latest add https://utilcn.dev/r/chatgpt-app-backend.json

Source

registry/default/chatgpt-app/mcp-server.tsutilcn.dev/r/chatgpt-app-backend.json
1import {
2 createServer,
3 type IncomingMessage,
4 type ServerResponse,
5} from 'node:http';
6import { URL } from 'node:url';
7
8import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
10
11import { registerAdd } from '@/registry/default/chatgpt-app/add';
12
13function createUtilCnServer(): McpServer {
14 const server = new McpServer({
15 name: 'utilcn-mcp',
16 version: '0.1.0',
17 });
18
19 registerAdd(server);
20 return server;
21}
22
23type SessionRecord = {
24 server: McpServer;
25 transport: SSEServerTransport;
26};
27
28const sessions = new Map<string, SessionRecord>();
29
30const ssePath = '/mcp';
31const postPath = '/mcp/messages';
32
33async function handleSseRequest(res: ServerResponse) {
34 res.setHeader('Access-Control-Allow-Origin', '*');
35 const server = createUtilCnServer();
36 const transport = new SSEServerTransport(postPath, res);
37 const sessionId = transport.sessionId;
38
39 sessions.set(sessionId, { server, transport });
40
41 transport.onclose = () => {
42 sessions.delete(sessionId);
43 };
44
45 transport.onerror = (error) => {
46 console.error('SSE transport error', error);
47 };
48
49 try {
50 await server.connect(transport);
51 } catch (error) {
52 sessions.delete(sessionId);
53 console.error('Failed to start SSE session', error);
54 if (!res.headersSent) {
55 res.writeHead(500).end('Failed to establish SSE connection');
56 }
57 }
58}
59
60async function handlePostMessage(
61 req: IncomingMessage,
62 res: ServerResponse,
63 url: URL,
64) {
65 res.setHeader('Access-Control-Allow-Origin', '*');
66 res.setHeader('Access-Control-Allow-Headers', 'content-type');
67 const sessionId = url.searchParams.get('sessionId');
68
69 if (!sessionId) {
70 res.writeHead(400).end('Missing sessionId query parameter');
71 return;
72 }
73
74 const session = sessions.get(sessionId);
75
76 if (!session) {
77 res.writeHead(404).end('Unknown session');
78 return;
79 }
80
81 try {
82 await session.transport.handlePostMessage(req, res);
83 } catch (error) {
84 console.error('Failed to process message', error);
85 if (!res.headersSent) {
86 res.writeHead(500).end('Failed to process message');
87 }
88 }
89}
90
91const portEnv = Number(process.env.PORT ?? 8000);
92const port = Number.isFinite(portEnv) ? portEnv : 8000;
93
94const httpServer = createServer(
95 async (req: IncomingMessage, res: ServerResponse) => {
96 if (!req.url) {
97 res.writeHead(400).end('Missing URL');
98 return;
99 }
100
101// … truncated

What it pulls in

npm packages

  • @modelcontextprotocol/sdk
  • zod@3

Files it writes

  • registry/default/chatgpt-app/mcp-server.ts
  • registry/default/chatgpt-app/widget-util.ts
  • registry/default/chatgpt-app/add.ts

Facts

Registry
utilcn
Type
registry:block
Access
Free
Files written
3
Licence
the repository states none
In the index
at or before 2026-08-08
Last confirmed
today

Go to the source

utilcn.dev BrennenRocks/utilcn on GitHub Raw registry item This item as JSON

More from utilcn

All 17 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ChatGPT Widget Frontendchatgpt-apputilcnBlocksFree6 deps · 9 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex