Labsco
karerckor logo

Quiz MCP

from karerckor

MCP server for interactive quizzes

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

quiz-mcp

Let AI models hand off interactive quizzes to humans through a real browser UI.

Instead of generating HTML forms as artifacts or asking questions one-by-one in chat, the model describes a quiz as JSON, the user fills it in at http://localhost:<port>, and the answers flow back to the model as structured data.

Useful for teachers building quizzes with AI, researchers running structured interviews, or any agent that needs real input from a human.

Quiz runner showing the bundled JavaScript basics demo

Repository structure

PathPackage / AppDescription
apps/cli@quiz-mcp/cliPublished binary (quiz-mcp). MCP stdio server, lazy runner lifecycle, create scaffolding command.
apps/runner@quiz-mcp/runnerStandalone CLI that loads a quiz from a file/URL/stdin, serves it in a browser, and writes answers to a file or webhook.
apps/remote-mcp-oauth@quiz-mcp/remote-mcp-oauthCloudflare Worker hosting an OAuth-protected remote MCP server (WorkOS AuthKit + Durable Objects). Powers https://quiz-mcp-oauth.karerckor.workers.dev.
packages/core@quiz-mcp/coreDomain foundation: Zod schemas, types, grading engine, answer validation. Single source of truth for the quiz format.
packages/runner-api@quiz-mcp/runner-apiHono HTTP server and SSR shell for the quiz runtime. REST endpoints, theming, i18n. Not published standalone.
packages/runner-ui@quiz-mcp/runner-uiVite/Hono-JSX client bundle. Hydrates the SSR shell and wires <quiz-player> events to the REST API. Assets only, not a runtime import.
packages/web-components@quiz-mcp/web-componentsFramework-agnostic <quiz-player> custom element (Svelte 5 + Shadow DOM + DaisyUI 5).
demo/โ€”Sample quiz JSON files.
schema/โ€”Generated JSON Schema for the Quiz type (schema/quiz.schema.json).
scripts/โ€”Build-time utilities: JSON Schema generation and validation against AJV.

Development

git clone https://github.com/karerckor/quiz-mcp.git
cd quiz-mcp
pnpm install
CommandPurpose
pnpm buildBuild all packages (Turborepo respects the ^build graph).
pnpm testRun the full test suite.
pnpm typecheckType-check every package.
pnpm devWatch mode, parallel across packages.

Quiz schema

The Quiz format is defined in packages/core as a Zod schema and exported as a JSON Schema to schema/quiz.schema.json.

Top-level shape:

{
  "id": "my-quiz-1",
  "title": "Quiz title",
  "description": "Optional description",
  "questions": [ /* Question[] */ ]
}

Supported question types (_kind):

single_choice, multiple_choice, short_text, long_text, dropdown, fill_gaps, match, scale, sorting, upload

Regenerate or verify the schema:

pnpm schema:gen    # writes schema/quiz.schema.json
pnpm schema:check  # validates the generated schema with AJV

The schema is also available at the canonical URL embedded in the file: https://raw.githubusercontent.com/karerckor/quiz-mcp/main/schema/quiz.schema.json

Package READMEs