Sentra — mock exams from your PDFs (free, open-source MCP server)
Sentra turns lecture PDFs and past exams into realistic mock exams with answer keys. It runs on your machine, costs nothing, and works with any MCP-compatible AI agent (OpenCode, Claude Code, Cursor, VS Code, Gemini CLI).
Your agent does the thinking; Sentra does the reading, the analysis prep, and the file saving. Sentra itself makes no model calls.
Bilingual site + docs: landing/ (English / Egyptian Arabic).
Fastest start
- Copy this repo link:
https://github.com/mo22zy2/Sentra-MCP - In your AI agent, paste it and say:
download and run this mcp - Restart your agent so the sentra tools appear.
- Drop lecture PDFs into
lectures/and past exams intopast_exams/. - Say:
run the sentra pipeline— the agent follows the prompts in order (extract_text → knowledge_base → professor_dna → exam_targets → predicted_exam) and saves each.mdunderoutput/. No forms, no schema — the prompts define the structure. Or say:make me 2 exams using the sentra mcp.
Not on OpenCode? uvx sentra-mcp init --agent <claude|cursor|vscode|gemini>
writes the right config for your agent. Every agent uses the same local
lectures/, past_exams/, output/ folders.
Prefer the terminal?
Install uv once (Windows: winget install -e --id astral-sh.uv,
otherwise: pip install uv), then:
uvx sentra-mcp init
init creates your course folder, connects your agent (backing up its
config first), and tells you where to drop PDFs. Then ask your agent:
- "Analyze the previous exams and summarize the professor's question patterns."
- "Generate a two-hour Operating Systems mock exam with an answer key."
You get output/<name>_exam.md + output/<name>_answers.md, saved locally.
Your folders
<the folder you opened in your agent>/
├── lectures/ # lecture PDFs (auto-created)
├── past_exams/ # previous exam PDFs (auto-created)
└── output/ # generated *_exam.md + *_answers.md (auto-created)
PDF only in this version. Scanned/image PDFs are flagged instead of silently returning nothing — OCR is out of scope, use a text-based export.
Tools (9) + Prompts (5, the core, all local)
Prompts-first: run these in order. Tools only supply evidence.
start_pipeline does steps 1+2 in one call (file list + first prompt).
| Name | What it does |
|---|---|
extract_text (prompt) |
Step 1: how to read every PDF faithfully. |
knowledge_base (prompt) |
Step 2: writes output/knowledge_base.md from lectures. |
professor_dna (prompt) |
Step 3: writes output/professor_dna.md from past exams. |
exam_targets (prompt) |
Step 4: writes output/exam_targets.md from the two above. |
predicted_exam (prompt) |
Step 5: writes output/predicted_exam.md from the three above. |
prompt://{name} (resource) |
Raw prompt text (text/markdown). |
start_pipeline |
File listing + ordered steps + step-1 prompt in one call. |
list_workflow_prompts |
Ordered prompt list with output files. |
get_workflow_prompt |
One prompt verbatim + writes/next (+ OCR note for step 1). |
save_pipeline_file |
Saves knowledge_base.md etc. Schemaless — prompt defines structure; only safety checks (known name, non-empty, 1MB cap, no silent overwrite). |
list_course_pdfs |
Lists your PDFs, reports unreadable files. Never leaves the course folder. |
extract_pdf_text |
Page-preserving text extraction (50 pages / 60k chars per call). No OCR — scanned PDFs return insufficient_text instead of invented text. |
analyze_past_exams |
Evidence for the professor_dna prompt (counts + file:page cites). |
prepare_exam_brief |
Evidence for mock-exam writing (spec + excerpts + style card). |
save_exam_files |
Saves exam + separate answer key. Refuses silent overwrites. |
Question types allowed: MCQ, True/False, Short Answer, Essay, Numerical, Comparison, Diagram, Case Study, Application, Analysis, Problem Solving.
Privacy & limits
- Everything is processed and saved on your machine; Sentra uploads nothing. If your agent's model is cloud-hosted, what you ask about is sent to that provider.
- 50 MB per file. All paths stay inside the course folder (
../rejected). - PDFs are treated as untrusted data (never executed). No secrets in logs.
Troubleshooting
| Symptom | Fix |
|---|---|
No PDFs listed |
Put files in lectures/ or past_exams/ inside the opened folder. |
| Tools missing in your agent | Run its server-list command, then restart it. Still missing? Re-run init. |
... must sum to 100 |
Difficulty {easy,medium,hard} must total exactly 100. |
Refusing to overwrite |
New basename or overwrite: true. |
insufficient_text: true |
Scanned PDF — use a text-based export. |
Developers
git clone https://github.com/mo22zy2/Sentra-MCP.git
cd Sentra-MCP
uv sync # needs Python 3.11+ and uv
uv run pytest -q # expect: 49 passed
Manual config example: opencode.jsonc.example
(prefer ["uvx", "sentra-mcp"]; from source use
["uv", "--directory", "<ABSOLUTE_REPO_PATH>", "run", "sentra"]).
Contribute via issues/PRs with your OS, Python version, command, and full
error message. Never attach private course materials.
For AI agents: bootstrap contract (user pasted this repo's link)
Do everything below yourself. Never ask the student to run commands or edit files. Nothing leaves this machine — NEVER upload their files anywhere.
- Install: if
uvx sentra-mcp initworks, use it. Otherwise clone,uv sync(installuvfirst; need Python 3.11+). Verify:uv run pytest -q. - Configure with
uvx sentra-mcp init --agent <id>when the user names an agent, else defaultinit(OpenCode). Manual fallback: thesentrablock fromopencode.jsonc.exampleundermcpin the agent config. - Course folder = the opened folder:
lectures/,past_exams/,output/(auto-created). Tell the user where to drop PDFs, in their language. - Verify the pipeline responds (
list_workflow_prompts+ 5 prompts), then tell the user to RESTART their agent. - Prompts-first:
start_pipeline, then run prompts in order (extract_text → knowledge_base → professor_dna → exam_targets → predicted_exam), saving each withsave_pipeline_file(schemaless — prompt defines structure). Per mock exam:prepare_exam_briefwith its spec, original questions only (never copy past exams),save_exam_fileswith a DIFFERENT basename per exam. Answer keys stay in separate*_answers.mdfiles.
Metadata
Release files for sentra-mcp 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sentra_mcp-1.1.0.tar.gz | 118.5 kB | Without provenance | Details for sentra_mcp-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sentra_mcp-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for sentra_mcp-1.1.0-py3-none-any.whl |
Total release size: 157.2 kB
Release files / sentra_mcp-1.1.0.tar.gz
| Download URL | sentra_mcp-1.1.0.tar.gz |
|---|---|
| Size | 118.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
347df069ef2079b3dbdc53f067c8c04830aa8ddbb547f305a1d144b8306f5d4c
|
|
BLAKE2b-256 checksum How to use checksums |
46a07a1e3825ac6a9ed6b2dc7f1a251cc0ed5cea5ea3e88fb6e63bed37a92d6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sentra_mcp-1.1.0-py3-none-any.whl
| Download URL | sentra_mcp-1.1.0-py3-none-any.whl |
|---|---|
| Size | 38.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4346a9622a39400f14d12124a39025a2d594045f463d8e3b756779e81cde357f
|
|
BLAKE2b-256 checksum How to use checksums |
57833ebcac916b9da8336ba43323fb6d5eb52a99e0398d8e99c21e6f7c3cabc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for sentra-mcp 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.