mcpChat
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: v6View latest version
A ChatGPT-style chat interface that connects to MCP (Model Context Protocol) servers, giving your AI access to external tools.
- 💬 Multiple chat conversations with auto-generated titles
- 🔧 Add/remove MCP servers via the settings UI
- 📱 Mobile-optimized responsive design
- 🔐 Support for authenticated MCP servers via environment variables
-
Add your OpenAI API key in Environment Variables:
- Key:
OPENAI_API_KEY - Value: Your OpenAI API key
- Key:
-
Open the app and click "New Chat"
-
Add MCP servers via the settings (gear icon)
Click the settings button at the bottom of the sidebar to manage MCP servers.
Each server needs:
- Name: A label for the server (e.g., "dice")
- URL: The server's HTTP endpoint
- Auth env key (optional): Name of an environment variable containing the auth token
| Name | URL | Auth | Description |
|---|---|---|---|
| dice | See mcp-dice | - | Roll dice, flip coins |
| fatebook | See mcp-fatebook | FATEBOOK_API_KEY | Track predictions |
To use the dice server, remix dcm31/mcp-dice and add its URL.
To use the fatebook server:
- Get an API key from fatebook.io/api-setup
- Add
FATEBOOK_API_KEYto your environment variables - Remix dcm31/mcp-fatebook and add its URL with auth env key
FATEBOOK_API_KEY
For MCP servers that require authentication:
- Add the API key as an environment variable (e.g.,
MY_SERVICE_KEY) - When adding the server, enter
MY_SERVICE_KEYin the "Auth env key" field - The app will automatically add
Authorization: Bearer <value>to requests
See dcm31/mcp-dice for a minimal example of building MCP servers that work with this chat client.
main.ts- HTTP handler and API routesdb.ts- SQLite database operationsui.tsx- React-style UI components