ExamPrepAgent

ExamPrepAgent

An MCP server that provides tools to search for study questions and answers from a knowledge base, enabling exam preparation through random questions and guided learning.

Category
Visit Server

README

🧠 ExamPrepAgent

An AI agent that assists students preparing for any exam or test, such as Linux Foundation (LF) certifications. The agent serves as an intelligent study companion leveraging Large Language Models (LLMs) and MCP servers to provide an engaging and interactive learning experience. The agent supports:

  • Ask random study questions
  • Semantic and keyword search of the correct answers
  • Guided conversation for deeper understanding

It consists of two major components.

  • An MCP (Model Context Protocol) server that provides tools to search for study questions and answers from a knowledge base. It can be used with any MCP-compatible LLM client.
  • A chatbot application that utilizes any LLM and the MCP server. It asks the user study questions, and helps the user to reach the correct answer.

Live demo: http://k8s.cardea.cc/

Video demo: https://x.com/realwasmedge/status/1964435649534316809


šŸš€ Getting Started

  1. Clone the repository.
https://github.com/cardea-mcp/ExamPrepAgent.git
  1. Install dependencies
pip install fastmcp fastapi requests mysql-connector-python ffmpeg
  1. Create a .env file from the .env.example file and fill in the required values.

You will need API endpoints for an LLM service, and the system prompt for the conversation management. If you want to use the voice features on the chatbot app, you will also need API endpoints for ASR and TTS services. You can run LLM, ASR, and TTS services using open-source models locally on your own computers via LlamaEdge.

  1. Set up the question and answer database.

First download a CSV file for the QA knowledge base. The CSV file contains 3 columns: the question, the answer, and an explanation of the answer. The CSV file must be saved as dataset/qa.csv.

cd dataset
curl -L -o qa.csv https://huggingface.co/datasets/ItshMoh/k8_qa_pairs/resolve/main/kubernetes_qa_output.csv

Run the script to load the CSV file into a database. The database connection URL and table name are configured in the .env file.

python csv_loader.py
  1. Start the MCP server.
python3 main.py
  1. Start the chatbot app.
python3 app.py

ScreenShots of the bot in action Bot giving practicing question to the user


We have created two datasets for the QA knowledge base for you to experiment with. The Kubernetes QA is the default dataset used in our scripts.

  • Kubernetes-Q&A - A collection of Q&A pairs focused on Kubernetes and cloud native concepts. It is uploaded to my hugging face id. here is the link to the dataset. https://huggingface.co/datasets/ItshMoh/k8_qa_pairs . It contains 445 Q&A pairs. It is made for KCNA exam. Contents are taken from the kubernetes.io licensed under CC BY 4.0

  • Metal-mining-Q&A - A collection of Q&A pairs focused on metal mining methods. The link to the dataset https://huggingface.co/datasets/ItshMoh/metal-mining-qa-pairs . It has also more than 31 downloads on hugging face.

šŸ—ļø Architecture

šŸ”§ Key Files Description

Core Application Files

app.py

app.py: Direct API integration architecture

  • Communicates directly with LLM APIs (OpenAI-compatible)
  • Manages MCP server subprocess internally
  • Suitable for direct API deployments

LLM Integration Files

llm_api.py - FastAPI Integration (Direct)

  • HTTP API endpoint integration
  • Subprocess MCP server management
  • Audio message processing
  • Session-based context handling

MCP & Database

main.py - MCP Server

  • Implements FastMCP server
  • Provides get_random_question() and get_question_and_answer() tools
  • Interfaces with TiDB for full-text search The system is composed of several core components:

database/tidb.py - TiDB Integration

  • Vector similarity search
  • Full-text search capabilities
  • Q&A pair management
  • Bulk data operations

✨ Features

Core Workflows

šŸ“Œ Workflow 1: Question Search

  1. User asks a specific question.
  2. LLM invokes the get_question_and_answer() MCP function.
  3. The system searches the TiDB for relevant Q&A pairs.
  4. The LLM provides a contextual, helpful response based on the findings.

šŸŽÆ Workflow 2: Practice Mode

  1. User requests a practice question.
  2. LLM invokes the get_random_question() MCP function.
  3. The system returns a random Q&A pair.
  4. The LLM presents the question and guides the user's learning.

šŸ› ļø Technical Stack

  • Python 3.x
  • FastMCP – MCP server framework
  • TiDB – SQL database for Full text Search
  • JSON – Data storage format

šŸ“ Project Structure

└── ExamPrepAgent/
    ā”œā”€ā”€ README.md
    ā”œā”€ā”€ app.py
    ā”œā”€ā”€ llm_api.py
    ā”œā”€ā”€ llmclient.py
    ā”œā”€ā”€ load_dataset.py
    ā”œā”€ā”€ main.py
    ā”œā”€ā”€ requirements.txt
    ā”œā”€ā”€ setup_dataset.sh
    ā”œā”€ā”€ .env.example
    ā”œā”€ā”€ audio_processing/
    │   ā”œā”€ā”€ audio_utils.py
    │   ā”œā”€ā”€ tts_handler.py
    │   └── whisper_handler.py
    ā”œā”€ā”€ database/
    │   ā”œā”€ā”€ dataloader.py
    │   └── tidb.py
    ā”œā”€ā”€ dataset/
    │   ā”œā”€ā”€ csv_loader.py
    │   └── dataPrep.py
    ā”œā”€ā”€ static/
    │   ā”œā”€ā”€ audio_recorder.js
    │   ā”œā”€ā”€ index.html
    │   ā”œā”€ā”€ script.js
    │   ā”œā”€ā”€ styles.css
    │   └── uploads/
    │       └── .gitkeep
    └── utils/
        └── ques_select.py

   

šŸ”® Future Enhancements

  • Expanded Datasets: Add more LF certification topics
  • Advanced Analytics: Track learning progress and weak areas
  • Multi-modal Support: Include diagrams and visual aids

Kubernetes Dataset

The dataset has been created using the kubernetes.io documentation. It is available under CC BY 4.0. license.

Here is the link to the dataset

The dataset has been generated using this script

šŸ¤ Contributing

  1. Fork the repository
  2. Create your feature branch:
    git checkout -b feature/amazing-feature
    
  3. Add your Q&A datasets in the specified format
  4. Test your changes with the MCP server
  5. Submit a pull request.

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