Quiz App MCP server

Quiz App MCP server

A Python MCP server built with FastMCP that exposes tools for a quiz app, optionally backed by a MySQL database.

Category
Visit Server

README

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.txt

Setup

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)

Run locally (stdio)

.\venv\Scripts\python.exe server.py

Or use the MCP inspector to call tools manually:

.\venv\Scripts\python.exe -m mcp dev server.py

Connect to Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "quizapp": {
      "command": "C:\\path\\to\\project\\venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\project\\server.py"]
    }
  }
}

Restart Claude Desktop — tools appear automatically.

Deploy to Render (HTTP, for claude.ai)

  1. Push to GitHub (.env is gitignored — never commit it).

  2. Create a Render Web Service connected to the repo.

  3. Set environment variables in the Render dashboard:

    Variable Value
    RENDER true
    DB_HOST your DB host
    DB_USER your DB user
    DB_PASSWORD your DB password
    DB_NAME your DB name
  4. Start command: python server.py

  5. In server.py, update BASE_URL under the RENDER branch to your actual Render URL.

  6. 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.py pings /health every 10 minutes.
  • Add an external monitor (e.g. UptimeRobot) on https://your-app.onrender.com/health every 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

  • .env is 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured