Public
Nokia Snake MCP App with SQLite leaderboard
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.

Snake MCP

Nokia-style Snake as an MCP App, with SQLite high scores and a leaderboard.

Live URLs

Connect a client

{ "mcpServers": { "snake": { "url": "https://alexmcroberts--28d29b367c8711f18ed61607ee4eb77e.web.val.run/mcp" } } }

Or with Claude Code:

claude mcp add --transport http snake https://alexmcroberts--28d29b367c8711f18ed61607ee4eb77e.web.val.run/mcp

Then ask: play snake or show the leaderboard.

Tools

ToolWhoWhat
play_snakemodelOpens the Snake MCP App
get_leaderboardmodelShows top scores (MCP App UI)
submit_scoreapp onlySaves name + score after a crash

How it works

Rendering mermaid diagram...
  1. The host calls play_snake and renders the MCP App from ui://snake/mcp-app.html.
  2. Play with arrow keys or the on-screen D-pad.
  3. On crash, enter a name — the app calls submit_score.
  4. Scores live in this val's SQLite database.

Files

  • main.ts — Hono HTTP + Streamable MCP transport
  • mcp.ts — tools + MCP App resources
  • db.ts — SQLite schema / leaderboard helpers
  • snake-app.html — Snake UI (@modelcontextprotocol/ext-apps)
  • index.html — landing page