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.
An MCP (Model Context Protocol) server that exposes your
Turso database to AI agents (Claude, Cursor, Gemini, etc.) as callable
tools. Hosted on Val Town and served over Streamable HTTP at /mcp.
| Tool | Description |
|---|---|
query | Run a read-only SQL query (SELECT / PRAGMA) |
execute | Run a write statement (INSERT / UPDATE / DELETE) |
list_tables | List tables/views in the database |
describe_table | Show a table's schema (PRAGMA table_info) |
- Set these environment variables on the val:
TURSO_DATABASE_URL— e.g.libsql://your-db-org.turso.ioTURSO_AUTH_TOKEN— a database token from the Turso dashboard
- Your MCP endpoint is:
https://g5-mcp.val.run/mcp
For example, with Claude Code:
claude mcp add --transport http turso https://g5-mcp.val.run/mcp
Or in a generic mcp.json:
{ "mcpServers": { "turso": { "type": "http", "url": "https://g5-mcp.val.run/mcp" } } }
main.ts— HTTP handler: Hono +@hono/mcptransport, exposes/mcpmcp.ts— the MCP server and its tool definitionsturso.ts— Turso client helper (@libsql/client/web, reads env vars)
The execute tool can modify your database, and this val is currently public
(httpPrivacy: public). Anyone with the URL can call it. If you want to restrict who can
reach it, mark the val restricted and grant access only to your own orgs, or add your own
auth check in main.ts.