certs-mcp
# certs-mcp
MCP server for **reading study material** and **practicing exam questions** for any tech certification.
Built with the official MCP TypeScript SDK **v2** (`@modelcontextprotocol/server` 2.4, Zod 4, TypeScript 7).
Serves both protocol eras over stdio (2026-07-28 and 2025-era `initialize` clients) via `serveStdio`.
## Features
- Pluggable question banks: one JSON file per certification (`data/certs/*.json`), validated with Zod at load.
- Study: certification overview, per-domain topics, keyword search.
- Practice: `practice` mode (instant feedback + explanation) or `exam` mode (results at the end).
- Smart selection: `focus` = `all` | `unseen` | `incorrect` | `weak`.
- Options shuffled and relabelled A, B, C… so answers never leak.
- Opt-in progress: before practicing, the user picks **track my progress** (under a unique nickname or email) or **guest** (nothing saved).
- Tracked progress persisted to `~/.certs-mcp/progress.json` per user (per-question history, sessions, topics read, weak domains); returning users get their history back.
## MCP surface
| Kind | Name | Purpose |
|------|------|---------|
| tool | `list_certifications` | Available certs |
| tool | `get_certification` | Exam info, domains, topics |
| tool | `read_topic` | Study notes (marks read) |
| tool | `search_content` | Keyword search |
| tool | `set_progress_mode` | Track progress (nickname/email) or guest |
| tool | `get_progress_mode` | Current mode and user |
| tool | `start_practice` | Start quiz session |
| tool | `submit_answer` | Answer current question |
| tool | `get_current_question` | Re-show current question |
| tool | `end_session` | Score report + review |
| tool | `get_progress` | Accuracy per domain, weakest areas |
| tool | `reset_progress` | Clear saved progress |
| resource | `cert://{certId}` | Overview JSON |
| resource | `cert://{certId}/topics/{topicId}` | Topic markdown |
| prompt | `study_plan`, `quiz_me`, `explain_concept` | Guided workflows |
## Quick start
```bash
npm install
npm run build
npm test
```
Try it in the MCP Inspector:
```bash
npm run inspect
```
### Claude Code
```bash
claude mcp add certs -- node /absolute/path/to/certs-mcp/dist/index.js
```
### Claude Desktop / other clients
```json
{
"mcpServers": {
"certs": {
"command": "node",
"args": ["/absolute/path/to/certs-mcp/dist/index.js"],
"env": { "CERTS_DATA_DIR": "/path/to/my/extra/certs" }
}
}
}
```
## Configuration
| Env var | Default | Meaning |
|---------|---------|---------|
| `CERTS_DATA_DIR` | — | Extra dirs (`:`-separated) with cert JSON files. Same `id` overrides built-in. |
| `CERTS_MCP_HOME` | `~/.certs-mcp` | Where `progress.json` lives. |
| `CERTS_MCP_PROFILE` | — | Skip the question: `guest` or a nickname/email to track under. |
## Progress opt-in
Until the user chooses, `start_practice`, `get_progress` and `reset_progress` return
`status: "progress_choice_required"` with two options for the assistant to present:
1. **Yes, track my progress** – the assistant asks for a unique nickname (3-40 chars: letters, digits, `.` `_` `-`) or an email, then calls `set_progress_mode { trackProgress: true, userId }`. Ids are case-insensitive.
2. **No, practice as a guest** – `set_progress_mode { trackProgress: false }`; progress lives in memory only.
The nickname/email is self-declared and stored in plain text in the local progress file. That is fine for a
local, single-user server; a remote deployment should take the user's identity from authentication instead.
Progress files from before this feature are kept under the `default` profile.
## Adding a certification
Create `data/certs/<id>.json` (or put it in `CERTS_DATA_DIR`):
```jsonc
{
"id": "cka", // kebab-case, unique
"name": "Certified Kubernetes Administrator",
"vendor": "CNCF",
"code": "CKA",
"description": "…",
"examInfo": { "durationMinutes": 120, "questionCount": 17, "passingScore": "66%", "format": "Performance-based" },
"domains": [{ "id": "troubleshooting", "name": "Troubleshooting", "weight": 30 }],
"topics": [{ "id": "…", "domain": "troubleshooting", "title": "…", "content": "markdown", "keyPoints": [] }],
"questions": [{
"id": "cka-001", "domain": "troubleshooting", "type": "single", "difficulty": "medium",
"question": "…", "options": [{ "id": "a", "text": "…" }, { "id": "b", "text": "…" }],
"answer": ["a"], "explanation": "…", "references": []
}]
}
```
Validate with:
```bash
npm run validate-data
```
Write original questions or use content you have rights to. Do not paste real exam questions (exam NDAs).
## Project layout
```
src/
index.ts stdio entry point
server.ts McpServer wiring
schema.ts Zod schema for cert files
config.ts env/config
store/ cert loader, progress persistence
practice/ session engine, stats
tools/ tool registrations
resources.ts, prompts.ts
data/certs/ question banks
test/ vitest, runs every case against both protocol eras
```
TDQS
Scored across 12 tools
Most tools map to a single distinct resource+action (list/get certification, read topic, start/submit/end session, reset progress). The main risk is get_progress vs get_progress_mode, which sound similar, but the descriptions make clear that one is a tracking-mode flag and the other is an analytics report. get_current_question and end_session are also close to the session flow but clearly differentiated by description.
All 12 tool names follow a consistent snake_case verb_noun pattern (list_certifications, get_certification, start_practice, submit_answer, reset_progress, etc.). No mixed conventions or odd casing. The get_/set_ and start_/end_ pairs even mirror each other predictably.
12 tools is well within the ideal 3-15 range for a certification study domain. Each tool covers a distinct workflow step (browse content, manage progress mode, run a quiz session, report analytics) with no apparent filler.
The full lifecycle is covered: content discovery (list/get/search/read), practice sessions (start/submit/get_current/end), and progress management (set/get mode, get_report, reset). Minor gaps exist, such as no way to undo a single topic read mark, list/resume specific past sessions, or retrieve a past session's detail beyond the summary in get_progress.