mcp-quiz-server
Version:
๐ง AI-Powered Quiz Management via Model Context Protocol (MCP) - Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
309 lines (245 loc) โข 10.1 kB
Markdown
# ๐ง MCP Quiz Server
[](https://github.com/GSejas/mcp-quiz-oss/actions/workflows/ci-cd.yml)
[](https://www.npmjs.com/package/mcp-quiz-server)
[](https://nodejs.org/en/)
[](https://opensource.org/licenses/MIT)
> ๐ **AI-Powered Quiz Management via Model Context Protocol (MCP)**
> Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
## โจ Features
- ๐ฏ **Zero-Install Setup** - Use with `npx` - no global installation required
- ๐ **VS Code Integration** - Seamless quiz management in your favorite editor
- ๐ค **Claude Desktop Support** - AI-powered quiz creation and analysis
- ๐ **Advanced Analytics** - Track performance and learning outcomes
- ๐ **Web Interface** - Browser-based quiz taking experience
- ๐จ **Modern UI** - Clean, responsive design with dark mode support
- ๐ **Secure & Private** - Local database, no cloud dependencies
- ๐งช **TypeScript** - Fully typed for better development experience
## ๐ Quick Start
### Option 1: NPX (Recommended)
```bash
# Start the quiz server
npx mcp-quiz-server start
# Start MCP server for VS Code/Claude integration
npx mcp-quiz-server mcp
# Show help
npx mcp-quiz-server help
```
### Option 2: Global Installation
```bash
npm install -g mcp-quiz-server
mcp-quiz-server start
```
## ๐ง Integration Setup
### VS Code MCP Extension
Add to your VS Code settings (`settings.json`):
```json
{
"mcp": {
"servers": {
"mcp-quiz-server": {
"command": "npx",
"args": ["mcp-quiz-server", "mcp"]
}
}
}
}
```
### Claude Desktop
Add to your Claude Desktop config (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"mcp-quiz-server": {
"command": "npx",
"args": ["mcp-quiz-server", "mcp"]
}
}
}
```
## ๐ Available Tools
| Tool | Description | Category |
|------|-------------|----------|
| `create_quiz` | Create new quizzes with questions | Quiz Management |
| `list_quizzes` | List all available quizzes | Quiz Management |
| `get_quiz` | Get specific quiz details | Quiz Management |
| `delete_quiz` | Delete existing quizzes | Quiz Management |
| `submit_quiz_result` | Submit quiz answers for scoring | Analytics |
| `get_quiz_analytics` | Get quiz performance analytics | Analytics |
| `generate_quiz_urls` | Generate shareable quiz URLs | Analytics |
| `start_web_server` | Start the web interface | Server Management |
| `stop_web_server` | Stop the web interface | Server Management |
| `server_status` | Check server status | Server Management |
## ๐ฏ Usage Examples
### Creating a Quiz with VS Code
1. Open Command Palette (`Ctrl+Shift+P`)
2. Type "MCP: Execute Tool"
3. Select `create_quiz`
4. Provide quiz data:
```json
{
"title": "JavaScript Fundamentals",
"description": "Test your JavaScript knowledge",
"category": "programming",
"questions": [
{
"question": "What is the correct way to declare a variable in JavaScript?",
"options": ["var x = 5;", "variable x = 5;", "v x = 5;", "declare x = 5;"],
"correctAnswer": "var x = 5;",
"explanation": "Variables in JavaScript are declared using var, let, or const keywords."
}
]
}
```
### Using with Claude Desktop
Simply ask Claude:
```
Create a 10-question quiz about Python programming covering variables, functions, loops, and data structures. Make it suitable for beginners.
```
Claude will use the MCP tools to create and manage your quiz automatically!
## ๐ Web Interface
Start the web server:
```bash
npx mcp-quiz-server start
```
Then visit: **http://localhost:3000**
Features:
- ๐ฑ **Responsive Design** - Works on desktop, tablet, and mobile
- ๐จ **Theme Support** - Light and dark modes
- โฑ๏ธ **Timer Support** - Optional quiz timing
- ๐ **Real-time Feedback** - Instant question feedback
- ๐ **Shareable Links** - Send quizzes to others
- ๐ **Progress Tracking** - Visual progress indicators
## ๐ Analytics & Reporting
Get comprehensive insights:
- **Completion Rates** - Track how many users finish quizzes
- **Average Scores** - Monitor learning effectiveness
- **Question Analysis** - Identify difficult questions
- **Time Tracking** - Understand quiz duration patterns
- **Score Distribution** - See performance patterns
Example analytics query:
```javascript
// Get analytics for a specific quiz
const analytics = await getQuizAnalytics("quiz-id", "last30days");
console.log(analytics.averageScore); // 78.5%
console.log(analytics.completionRate); // 92%
```
## ๐ง Configuration
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `PORT` | Web server port | `3000` |
| `QUIZ_DB_PATH` | Database file location | `./data/quiz.db` |
| `LOG_LEVEL` | Logging level | `info` |
| `NODE_ENV` | Environment mode | `development` |
### Custom Database Location
```bash
export QUIZ_DB_PATH="/path/to/custom/quiz.db"
npx mcp-quiz-server start
```
### Debug Mode
```bash
export LOG_LEVEL="debug"
npx mcp-quiz-server mcp
```
## ๐ ๏ธ Development
### Prerequisites
- Node.js v16 or higher
- npm or yarn
### Setup
```bash
git clone https://github.com/GSejas/mcp-quiz-oss.git
cd mcp-quiz-oss
npm install
```
### Development Commands
```bash
npm run dev # Start development server
npm run build # Build for production
npm run test # Run tests
npm run lint # Run linting
npm run format # Format code
```
### Testing
```bash
npm run test:quick # Quick smoke tests
npm run test:mcp # MCP integration tests
npm run test:db # Database tests
npm run test:e2e # End-to-end tests
```
## ๐ Project Structure
```
mcp-quiz-server/
โโโ src/
โ โโโ application/ # Application layer (commands, queries)
โ โโโ domain/ # Domain layer (entities, services)
โ โโโ infrastructure/ # Infrastructure layer (database, HTTP)
โ โโโ mcp/ # MCP protocol implementation
โ โโโ shared/ # Shared utilities
โ โโโ index.ts # CLI entry point
โ โโโ server.ts # Web server entry point
โ โโโ mcp-server.ts # MCP server entry point
โโโ public/ # Web interface assets
โโโ tests/ # Test suites
โโโ docs/ # Documentation
โโโ data/ # Database files
```
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
### Development Workflow
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Run the test suite
6. Submit a pull request
### Code Style
- TypeScript with strict mode
- ESLint + Prettier for formatting
- Clean Architecture principles
- Comprehensive test coverage
## ๐ Documentation
- ๐ง [VS Code Setup Guide](docs/vscode-setup.md)
- ๐ค [Claude Desktop Setup Guide](docs/claude-setup.md)
- ๐๏ธ [Architecture Overview](docs/architecture.md)
- ๐ [API Documentation](docs/api.md)
- ๐งช [Testing Guide](docs/testing.md)
## ๐ Security
- **Local Database** - No cloud dependencies or data transmission
- **Input Validation** - All inputs are sanitized and validated
- **Type Safety** - TypeScript provides compile-time safety
- **Secure Headers** - HTTP security headers enabled by default
- **Rate Limiting** - Protection against abuse
Report security issues to: [security@example.com](mailto:security@example.com)
## ๐ Roadmap
- [ ] **Multi-language Support** - Internationalization
- [ ] **Advanced Question Types** - Drag-drop, code snippets, multimedia
- [ ] **Team Collaboration** - Multi-user quiz editing
- [ ] **LMS Integration** - Canvas, Moodle, Blackboard connectors
- [ ] **AI Question Generation** - Automated content creation
- [ ] **Voice Interaction** - Audio-based quiz taking
- [ ] **Mobile Apps** - Native iOS and Android apps
## ๐ Why Choose MCP Quiz Server?
| Feature | MCP Quiz Server | Traditional Quiz Tools |
|---------|-----------------|------------------------|
| **AI Integration** | โ
Native VS Code & Claude | โ Limited or none |
| **Zero Install** | โ
NPX ready | โ Complex setup |
| **Local First** | โ
No cloud dependency | โ Cloud required |
| **Developer Friendly** | โ
TypeScript, APIs | โ Limited extensibility |
| **Open Source** | โ
MIT License | โ Proprietary |
| **Modern UI** | โ
React-like experience | โ Outdated interfaces |
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- Built with the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
- Inspired by modern educational technology needs
- Thanks to all contributors and the open-source community
## ๐ Support
- ๐ [Report Issues](https://github.com/GSejas/mcp-quiz-oss/issues)
- ๐ฌ [Discussions](https://github.com/GSejas/mcp-quiz-oss/discussions)
- ๐ง [Email Support](mailto:support@example.com)
- ๐ [Documentation](https://github.com/GSejas/mcp-quiz-oss/wiki)
---
<div align="center">
**Made with โค๏ธ for educators, developers, and learners worldwide**
[โญ Star this project](https://github.com/GSejas/mcp-quiz-oss) โข [๐ Fork it](https://github.com/GSejas/mcp-quiz-oss/fork) โข [๐ข Share it](https://twitter.com/intent/tweet?text=Check%20out%20MCP%20Quiz%20Server%20-%20AI-powered%20quiz%20management!&url=https://github.com/GSejas/mcp-quiz-oss)
</div>