Docs menu

Guides

Use trivia questions in Claude, Cursor and other AI apps

Connect The Trivia API's MCP server to Claude, Cursor, VS Code or any other MCP client, so an AI assistant can fetch real, reviewed trivia questions for your quiz.

The Trivia API has an MCP server, so AI assistants such as Claude can fetch questions from the question bank instead of writing their own. Every question has been checked by a person, so the answers are right and the wrong options are plausible.

The server is at:

https://the-trivia-api.com/mcp

It doesn't need an API key or an account.

Connect it

Claude (web, desktop and mobile): open Settings → Connectors, choose Add custom connector, and paste the URL above.

Claude Code:

claude mcp add --transport http the-trivia-api https://the-trivia-api.com/mcp

Cursor: add this to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project:

{
  "mcpServers": {
    "the-trivia-api": {
      "url": "https://the-trivia-api.com/mcp"
    }
  }
}

VS Code: add this to .vscode/mcp.json:

{
  "servers": {
    "the-trivia-api": {
      "type": "http",
      "url": "https://the-trivia-api.com/mcp"
    }
  }
}

Other clients that support remote MCP servers over HTTP work the same way: give them the URL.

What you can ask for

Once it's connected, ask in plain English. For example:

  • "Run a 10-question pub quiz on 80s music, getting harder as it goes. Don't tell me the answers until I've guessed."
  • "Give me 20 easy geography questions for a class of 11 year olds."
  • "How many hard history questions are there about the Romans?"

The assistant picks the filters from what you asked for. It can use four tools:

ToolWhat it does
get_random_questions
Up to 50 random multiple choice questions, filtered by category, difficulty, tag, region or family-friendly content. The same filters as GET /v2/questions.
count_questions
How many questions match a set of filters, so the assistant can check there are enough before building a quiz.
list_tags
Searches the tags, for themed quizzes on narrower topics like the_beatles or dinosaurs.
get_question_totals
How many questions there are in each category and difficulty.

What it doesn't do

The MCP server returns English multiple choice questions only. These features need an API key and are available through the HTTP API:

Separate calls to get_random_questions can return the same question, so for a long quiz, ask for all the questions in one go.

Limits

The MCP server is free to use, for the same non-commercial uses as the API without a key. Requests are rate limited, and if you hit the limit, wait a minute and try again. To use questions in a product, get an API key and call the HTTP API instead.

License

Information about the Creative Commons license for The Trivia API.

The API and all data returned from it are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Creative Commons License

This means that the API and the questions it returns are free for noncommercial use. If you have somewhere suitable in your app, then please credit the API somewhere discreet — we love having our hard work shared!

If you would like to use the API commercially, or would like enhanced functionality, this service is offered through a paid subscription.

Sign in

Sign in to access your API key and manage your account.

or continue with email