clone

minesweeper as an mcp server: agents start games, play moves in batches and watch the board

Add classic smiley to masthead and favicon

Dami committed f541b85
Inline SVG of the Minesweeper reset button replaces the blank bevel cell
in the h1 and doubles as a data-URI favicon; CSP gains img-src data:
commit
f541b8508b76c78b6a308d58d658dca1b41e740d
parent
935aea7b11c9227dc24cbc97c8a449b4032f9786
author
Dami <dami.etoile@gmail.com>
1 file changed, +6 -11
Msrc/landing.ts17++++++-----------
M src/landing.ts +6 -11
@@ -8,7 +8,7 @@ function escapeHtml(value: string): string {
88 }99 1010 export const LANDING_CSP =11- "default-src 'none'; script-src 'self'; connect-src 'self'; style-src 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; base-uri 'none'; form-action 'self'; frame-ancestors 'none'";11+ "default-src 'none'; script-src 'self'; connect-src 'self'; img-src data:; style-src 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; base-uri 'none'; form-action 'self'; frame-ancestors 'none'";1212 1313 // Served at /webmcp.js. Registers this page's WebMCP tools (imperative API) and1414 // wires the declarative start_game form; both proxy JSON-RPC to the same-origin
@@ -110,6 +110,7 @@ export function landingPage(request: Request): string {
110110 <meta charset="UTF-8" />111111 <meta name="viewport" content="width=device-width, initial-scale=1.0" />112112 <title>MCPSweeper</title>113+<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Crect width='26' height='26' fill='%23ffffff'/%3E%3Crect x='2' y='2' width='24' height='24' fill='%23808080'/%3E%3Crect x='2' y='2' width='22' height='22' fill='%23c0c0c0'/%3E%3Ccircle cx='13' cy='13' r='8.5' fill='%23ffff00' stroke='%23000000' stroke-width='1.3'/%3E%3Ccircle cx='10.2' cy='10.8' r='1.3' fill='%23000000'/%3E%3Ccircle cx='15.8' cy='10.8' r='1.3' fill='%23000000'/%3E%3Cpath d='M9.2 15.6q3.8 3.4 7.6 0' fill='none' stroke='%23000000' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E" />113114 <link rel="preconnect" href="https://fonts.googleapis.com" />114115 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />115116 <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;1,400&display=swap" rel="stylesheet" />
@@ -156,16 +157,10 @@ export function landingPage(request: Request): string {
156157 margin: 0 0 14px;157158 }158159 159- h1 .cell {160- display: inline-block;161- width: 0.62em; height: 0.62em;160+ h1 .smiley {161+ width: 0.78em; height: 0.78em;162162 margin-left: 0.28em;163- vertical-align: baseline;164- background: var(--w98-face);165- border-top: 3px solid var(--w98-light);166- border-left: 3px solid var(--w98-light);167- border-right: 3px solid var(--w98-shadow);168- border-bottom: 3px solid var(--w98-shadow);163+ vertical-align: -0.06em;169164 }170165 171166 .lede {
@@ -456,7 +451,7 @@ export function landingPage(request: Request): string {
456451 <body>457452 <main>458453 <header>459- <h1>MCPSweeper<span class="cell" aria-hidden="true"></span></h1>454+ <h1>MCPSweeper<svg class="smiley" viewBox="0 0 26 26" aria-hidden="true"><rect width="26" height="26" fill="#ffffff"/><rect x="2" y="2" width="24" height="24" fill="#808080"/><rect x="2" y="2" width="22" height="22" fill="#c0c0c0"/><circle cx="13" cy="13" r="8.5" fill="#ffff00" stroke="#000000" stroke-width="1.3"/><circle cx="10.2" cy="10.8" r="1.3" fill="#000000"/><circle cx="15.8" cy="10.8" r="1.3" fill="#000000"/><path d="M9.2 15.6q3.8 3.4 7.6 0" fill="none" stroke="#000000" stroke-width="1.3" stroke-linecap="round"/></svg></h1>460455 <p class="lede">A no-guess Minesweeper server for AI agents, built as a working example of the July 2026 Model Context Protocol specification and MCP Apps. Point an agent at it and watch it solve a board live.</p>461456 </header>462457