Public
Likemcp-client
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v22View latest version
A lightweight chat UI for talking to OpenAI models that can use MCP servers as tools. Built on Val Town with Hono.
Point it at any MCP server URL, ask a question, and the model will discover and call tools on its own.
Rendering mermaid diagram...
- Plug in any MCP server — add/remove server URLs in the sidebar. Ships with a dice roller as a default.
- Multiple threads — conversations persist in localStorage.
- Tool call inspector — click any tool call to expand arguments and output.
- Model picker — switch between gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, o3, o4-mini.
- Fork this val
- Set the
OPENAI_API_KEYenvironment variable in your val's settings - That's it — open the endpoint URL
index.tsx → Hono HTTP entrypoint, serves HTML + routes
api/
chat.ts → POST /api/chat — proxies to OpenAI with MCP tools
ui/
Layout.tsx → HTML shell
Sidebar.tsx → Thread list, MCP server manager, settings
ChatArea.tsx → Message area + input bar
client.ts → All client-side JS (threads, MCP, send loop)
styles.ts → CSS
| Key | Required | Description |
|---|---|---|
OPENAI_API_KEY | ✅ | Your OpenAI API key. Used server-side only — never sent to the browser. |