Content
## What is this?
This realizes English composition practice using a local LLM. It uses example sentences from the educational example sentence corpus SCoRE. The local LLM grades and explains the user's answers.
## Configuration
```mermaid
sequenceDiagram
autonumber
actor User as 👤 User
participant Model as 🤖 gemma (LM Studio)
participant MCP as 🔌 MCP Server
participant DB as 🗃️ SQLite
User->>Model: Start
Model->>MCP: Request example sentence
MCP->>DB: Execute SQL
DB-->>MCP: Example sentence data
MCP-->>Model: Pass example sentence as context
Model->>User: 6. Present question
User->>Model: 7. Answer in English composition
Model->>User: 8. Grade and explain
```
## Prerequisites
- [Python](https://www.python.org/) For Windows, install from the official Python website, not from Microsoft Store.
- [LM Studio](https://lmstudio.ai/)
## Installation
Commands are for Windows, but adjust according to your environment.
### Install dependencies
```bash
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
```
### Write score_samples.txt to SQLite
```bash
python create_db.py
```
## LM Studio settings
### mcp.json
```json
{
"mcpServers": {
"english-quiz": {
"command": "C:\\mcp-servers\\my-english-server\\venv\\Scripts\\python.exe",
"args": [
"-u",
"C:\\mcp-servers\\my-english-server\\mcp_server.py"
]
}
}
}
```
Replace the paths to python and mcp_server.py with your installation locations.
### Model
google/gemma-4-e2b is recommended. It follows system prompts relatively well compared to other models.
### System prompt
Enter the following in the system prompt field. The LLM will follow these instructions. You can change the behavior by modifying this.
```
You are an English teacher.
## Operation rules
1. Continue until the user says to stop.
2. When presenting a question, always call the get_question tool to retrieve the problem from external data.
3. Based on the retrieved problem, present an English composition question. Do not include English or model answers in the question.
4. After presenting the question, wait for the user's answer.
5. When the user answers, grade the answer, explain, and evaluate how well the answer conveys the meaning. Provide a supplementary model answer.
6. After the explanation, call get_question to present the next question.
```
## How to start
Enable the configured mcp english-quiz. Then, enter "start" in the chat field.
## Screenshot
<img width="1352" height="1160" alt="Image" src="https://github.com/user-attachments/assets/63ef69cb-a54e-444a-b1cd-11b29c9181bf" />
## Data Sources
| Source | License | Description |
| --- | --- | --- |
| [Educational example sentence corpus SCoRE](https://score.ddl-study.org/) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) | Chujo, K., Oghigian, K. and Akasegawa, S. “A corpus and grammatical browsing system for remedial EFL learners,” In A. Leńko-Szymańska and A. Boulton (eds.), Multiple Affordances of Language Corpora for Data-driven Learning. Amsterdam: John Benjamins, 2015, 109-128. |
## Disclaimer
> **This project is not related to the SCoRE project. Do not inquire about this project to the SCoRE project.**
>
> This software is provided as is, without any warranties, express or implied.
> The author is not responsible for any damages caused by the use of this software.
> **Use at your own risk.**
## License
MIT License