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.
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
- Clone the repository.
https://github.com/cardea-mcp/ExamPrepAgent.git
- Install dependencies
pip install fastmcp fastapi requests mysql-connector-python ffmpeg
- Create a
.envfile from the.env.examplefile 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.
- 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
- Start the MCP server.
python3 main.py
- Start the chatbot app.
python3 app.py
ScreenShots of the bot in action

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
- User asks a specific question.
- LLM invokes the
get_question_and_answer()MCP function. - The system searches the TiDB for relevant Q&A pairs.
- The LLM provides a contextual, helpful response based on the findings.
🎯 Workflow 2: Practice Mode
- User requests a practice question.
- LLM invokes the
get_random_question()MCP function. - The system returns a random Q&A pair.
- 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
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Add your Q&A datasets in the specified format
- Test your changes with the MCP server
- Submit a pull request.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。