Joke Button MCP Server
A minimal MCP server that exposes a single-button UI. Clicking the button prompts the assistant to deliver a short, family-friendly joke.
README
MCP Joke Button App
This project is a tiny MCP server that exposes one MCP App UI: a single button. When the button is clicked, the app sends a message to the host asking the assistant to answer with one short, family-friendly joke.
It intentionally uses only Node.js built-in modules. There are no runtime package dependencies.
What It Demonstrates
- MCP core protocol version
2026-07-28 - Stateless Streamable HTTP on one endpoint:
/mcp server/discover,tools/list,tools/call,resources/list, andresources/read- MCP Apps UI resource metadata with
_meta.ui.resourceUri - A sandbox-friendly
text/html;profile=mcp-appwidget ui/initializeandui/messageoverpostMessage
Requirements
Install Node.js 20 or newer from nodejs.org. The LTS download is fine.
You do not need to run npm install; this project has no third-party libraries.
Start the Server
Open a terminal in this folder and run:
npm start
You should see:
MCP Joke Button server listening on http://127.0.0.1:8787/mcp
Preview the widget shell at http://127.0.0.1:8787/preview
Leave that terminal open while you test.
MCP requests are logged by method while the server is running. For an interactive app render, the log should include a successful UI resource read similar to:
[mcp] request method=resources/read name=ui://joke-button/app.html
[mcp] response method=resources/read status=200
Set MCP_LOG_REQUESTS=false if you want to disable these development logs.
Heroku Deployment
The joke-button Heroku app is deployed at:
https://joke-button-31cddc4bc964.herokuapp.com
Its MCP endpoint is:
https://joke-button-31cddc4bc964.herokuapp.com/mcp
Deploy the current branch with:
git push heroku HEAD:main
Quick Local Check
Open this address in a browser:
http://127.0.0.1:8787/preview
This only previews the button's appearance. The button can ask the AI for a joke only when it is rendered inside an MCP Apps-compatible host such as ChatGPT.
Use with ChatGPT Desktop or ChatGPT Web
ChatGPT needs an HTTPS URL for a remote MCP server during development. Keep npm start running, then expose port 8787 with a tunnel tool such as ngrok or Cloudflare Tunnel.
Example with ngrok:
ngrok http 8787
Copy the HTTPS forwarding URL and add /mcp to the end, for example:
https://example.ngrok.app/mcp
Then connect it in ChatGPT:
- Open ChatGPT.
- Open Settings.
- Open Security and login.
- Turn on Developer mode if it is not already enabled.
- Open Plugins. If you are in the desktop app and do not see it in the sidebar, open
https://chatgpt.com/pluginsin a browser while signed in to the same account. - Select the plus button to add a developer MCP server connection.
- Paste the HTTPS URL ending in
/mcp. - Name it
Joke Button. - Start a new chat, select the plugin from the More menu, and ask:
Show the joke button. - Click
Tell a joke.
You do not need a setting named MCP servers for this ChatGPT UI test. That setting is for Codex's local MCP host configuration, not for adding a ChatGPT developer plugin connection.
If Developer mode or the plus button is missing, check that the desktop app is up to date and that your account or workspace allows plugin development.
If the app is working, ChatGPT should receive the button's message and respond with a short joke.
Use with Codex in the ChatGPT Desktop App
Codex can connect to Streamable HTTP MCP servers from the shared MCP settings.
The MCP servers setting appears only on Codex-capable local clients and may not appear in a regular ChatGPT chat settings view. If it is available:
- Keep
npm startrunning. - Open the ChatGPT desktop app.
- Open Settings, then MCP servers.
- Select Add server.
- Choose Streamable HTTP.
- Name the server
joke_button. - Use this URL:
http://127.0.0.1:8787/mcp
- Save, then restart when prompted.
- In a Codex task, type
/mcpto confirm the server is connected. - Ask Codex:
Use the Joke Button MCP server.
Codex MCP tool support may show the text fallback rather than rendering the iframe UI, depending on the surface. For the actual one-button UI, use ChatGPT with MCP Apps UI support.
If the setting is not visible, copy the sample configuration from codex-config.example.toml into a trusted project's .codex/config.toml or into your user ~/.codex/config.toml, then restart the ChatGPT desktop app or Codex client.
Useful URLs
- Health check:
http://127.0.0.1:8787/health - MCP endpoint:
http://127.0.0.1:8787/mcp - Widget preview:
http://127.0.0.1:8787/preview
Security Notes
The server validates the MCP protocol version and mirrored MCP headers required by the 2026-07-28 Streamable HTTP transport.
For local development, requests without an Origin header are accepted, loopback browser origins are accepted, and common OpenAI host origins are accepted. For another host origin, start the server with:
$env:MCP_ALLOWED_ORIGINS="https://your-host.example"
npm start
Use authentication before exposing a real MCP server that can access private data or perform actions. This sample does neither.
Project Files
server.js: dependency-free MCP serverpublic/joke-button.html: MCP App UI widgetcodex-config.example.toml: sample Codex MCP configuration
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。