@dennisk2025/random-trivia-question
v1.0.0
Published
Fetches a random trivia question, including category, difficulty, question, correct answer, and incorrect answers.
Downloads
26
Readme
random-trivia-question MCP Server
Fetches a random trivia question, including category, difficulty, question, correct answer, and incorrect answers using the Open Trivia Database (opentdb.com).
Installation
Install globally with npm:
npm install -g @dennisk2025/random-trivia-questionOr run directly via npx:
npx @dennisk2025/random-trivia-questionAdding to Claude Desktop
Add the following JSON to your Claude Desktop configuration file:
{
"mcpServers": {
"trivia": {
"command": "npx",
"args": ["@dennisk2025/random-trivia-question"]
}
}
}Add this to your Claude Desktop config file at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Usage
Once added to Claude Desktop, you can use the following tool:
Available Tool(s)
get_random_trivia
Fetches a random trivia question and returns its details.
Parameters:
- None
Returns:
category: string — The question's categorydifficulty: string — The question's difficulty (easy,medium,hard)question: string — The trivia questioncorrect_answer: string — The correct answerincorrect_answers: array of strings — Incorrect answers
Example Tool Call
Request:
[get_random_trivia]
{}Response Example:
{
"category": "General Knowledge",
"difficulty": "medium",
"question": "What is the French word for 'hat'?",
"correct_answer": "Chapeau",
"incorrect_answers": ["Bonnet", "Echarpe", "Casque"]
}Error Handling
If the Open Trivia Database is not reachable or returns no results, you will receive a response indicating the error condition.
License
MIT
