Quiz App MCP server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Quiz App MCP serverCreate a quiz 'Science Quiz' with admin ID 7, then add two questions."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Quiz App MCP server
A Python MCP (Model Context Protocol) server built with FastMCP. Exposes tools to:
Claude Desktop, locally, over stdio
claude.ai, remotely, over HTTP (deployed on Render)
Optionally backed by a MySQL database via SQLAlchemy.
Project layout
.
├── server.py # entry point — branches on RENDER env var (stdio vs HTTP)
├── config.py # loads .env, exposes shared SQLAlchemy engine
├── tools/
│ ├── __init__.py
│ └── quiz.py # tool definitions — register(mcp) adds them to a FastMCP instance
├── .env # secrets — never commit
├── .env.example
└── requirements.txtRelated MCP server: Quiz App MCP server
Setup
git clone https://github.com/sathvik1607/Quiz_mcp_server.git
cd Quiz_mcp_server
python -m venv venv
.\venv\Scripts\pip install -r requirements.txt
copy .env.example .env
# fill in .env with real DB credentials (or remove the DB_* lines if unused)Sanity-check the DB connection before wiring this into Claude Desktop:
.\venv\Scripts\python.exe -c "from config import engine; from sqlalchemy import text; print(engine.connect().execute(text('SELECT 1')).scalar())"This should print 1. If it hangs or errors, fix .env/DB connectivity first — don't try to
debug that through Claude Desktop.
Run locally (stdio)
.\venv\Scripts\python.exe server.pyOr use the MCP inspector to call tools manually (browser UI, no Claude Desktop needed — good for
checking each tool's request/response in isolation). Requires Node/npm, since it launches via
npx:
.\venv\Scripts\mcp.exe dev server.pyUse the mcp.exe entry point in venv\Scripts, not python -m mcp — the mcp package has no
__main__ and that form fails.
Connect to Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json (merge into whatever's already there —
don't overwrite the file):
{
"mcpServers": {
"quizapp": {
"command": "C:\\path\\to\\project\\venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\project\\server.py"]
}
}
}Use absolute paths matching wherever you cloned the repo.
Fully quit and restart Claude Desktop — close it from the system tray, not just the window. It only reloads MCP config on a full restart.
Then verify it loaded: Settings → Connectors → quizapp should be listed under "Other
tools" with 8 tools (Create quiz, Add question, Register user, Get question, Validate answer,
Generate leaderboard, Clear leaderboard, Review answers).
Creating and hosting a quiz (admin)
Start a new chat and be explicit, e.g.:
"Use create_quiz to create a quiz titled 'Lease Deed Basics', admin name <name>, admin_unique_id <id>. Then help me add a few questions."
This registers you as the quiz's admin and returns a quiz_code — share that with
participants. Only the admin_unique_id used at creation can add questions (add_question) or
clear the leaderboard (clear_leaderboard) for that quiz later.
Playing the quiz (participant)
Start a new chat, be explicit (a vague prompt like "let's start the quiz" can get misrouted to an unrelated built-in "generate a quiz" flow instead of calling this server's tools), and include the quiz code the admin shared with you:
"Use the register_user tool to join quiz code <code> as <name> with unique_id <id>, then start the quiz."
From there the server's own instructions (in server.py) drive the rest of the flow — one
question at a time, waiting for your answer before moving on. Each quiz's questions are
numbered independently starting at 1, and its leaderboard only tracks that quiz's participants.
Database schema / migrations
There's no ORM-managed schema — tables (users, quizzes, questions, attempts) are
created directly in MySQL. If you're updating an existing deployment (e.g. Render) from before
multi-quiz support existed, run the one-off migration against that database first:
.\venv\Scripts\python.exe scripts\migrate_multi_quiz.pyIt adds the quizzes table and a quiz_id column to questions/attempts, moving any
existing questions/attempts into a LEGACY1 quiz so nothing is lost. It's safe to re-run — it
checks what's already applied and skips those steps.
Deploy to Render (HTTP, for claude.ai)
Push to GitHub (
.envis gitignored — never commit it).Create a Render Web Service connected to the repo.
Set environment variables in the Render dashboard:
Variable
Value
RENDERtrueDB_HOSTyour DB host
DB_USERyour DB user
DB_PASSWORDyour DB password
DB_NAMEyour DB name
Start command:
python server.pyIn
server.py, updateBASE_URLunder theRENDERbranch to your actual Render URL.In claude.ai → Settings → Connectors, add:
https://your-app.onrender.com/mcp
No auth is currently configured on the HTTP endpoint — anyone with the URL can call every tool, including DB-backed ones. This was an explicit choice to keep setup simple for now; revisit before exposing anything sensitive (see Security below).
Note
OAuth was removed from the HTTP endpoint for now — we're not using claude.ai against this server's DB/tools yet, so it wasn't worth the extra complexity. Add it back later if needed.
Keep-alive
Render's free tier sleeps after 15 minutes idle, which makes the first request after sleep slow (30–60s) or time out. Mitigations already in place:
A background thread in
server.pypings/healthevery 10 minutes.Add an external monitor (e.g. UptimeRobot) on
https://your-app.onrender.com/healthevery 5 minutes — not on/mcp.
Adding a new tool
Open tools/quiz.py and add a function inside register(mcp):
@mcp.tool()
def my_new_tool(param1: str, param2: int) -> dict:
"""
One-sentence description of what this tool does.
The agent reads this docstring to decide when to call the tool.
Args:
param1: What this string parameter means.
param2: What this integer parameter means.
"""
result = do_something(param1, param2)
return {"result": result}No separate registration step — register(mcp) is called for both the stdio and HTTP instances.
Security
.envis gitignored — never commit it.Tools never return raw SQL or expose the DB schema.
All queries use parameterized SQL (
text("... WHERE id = :id"), not string interpolation).Any user-supplied table/column name should be checked against an allowlist before use in SQL.
The Render HTTP endpoint has no authentication — treat it as public. Don't add tools that expose sensitive data or destructive DB operations until auth is added back.
Whoever holds the shared
DB_*credentials is pointed at the same live database — there's no separate dev/staging instance.register_userandvalidate_answerwrite directly into it, so testing locally adds real rows next to real quiz data. Use a distinctiveunique_idwhen testing, and don't reuse these credentials past what's needed.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for trivia: 1.4M+ questions (EN+PL), 24 categories, 12 tools + 4 prompts, OAuth 2.1.
Create, edit, validate, publish, and inspect Formasty forms and quizzes over authenticated MCP.
MCP server for the Inistate platform: module discovery, entry management, and activity submission.
Quiz.Video MCP: list, create, AI-generate, and render quiz and flashcard videos.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceA Python MCP server built with FastMCP that exposes tools for a quiz app, optionally backed by a MySQL database.1
- FlicenseNot gradedqualityBmaintenanceEnables users to run an interactive quiz through natural language, registering players, retrieving questions, validating answers, and generating leaderboards or answer reviews via MCP tools.
- FlicenseNot gradedqualityBmaintenanceEnables users to run and manage quizzes through natural language, including registering users, fetching questions, validating answers, and generating leaderboards, over both local stdio and remote HTTP connections.
- FlicenseNot gradedqualityBmaintenanceEnables quiz gameplay through natural language, including user registration, retrieving questions, validating answers, generating leaderboards, and reviewing answers. It runs locally via stdio for Claude Desktop or remotely over HTTP for claude.ai, with optional MySQL-backed persistence.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hsharma16/quiz_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server