Add material with your agent
Course Material Protocol, version 1: each colleague's agent connects to the course over MCP, reads the material and proposes new material.
1. Connect your agent
Ask the course admin for your personal token, then run:
claude mcp add --transport http prog1 https://prog1.ucas.app/mcp \ --header "Authorization: Bearer YOUR_TOKEN"
Or add this to the settings of any agent that supports MCP:
{
"mcpServers": {
"prog1": {
"type": "http",
"url": "https://prog1.ucas.app/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
2. Ask for what you want
For example: "Add a lecture on inheritance after arrays." The agent reads the rules with get_protocol, checks its work with validate_lecture, and sends it with submit_lecture.
3. Nothing goes live without review
- DraftSubmitting returns a private review link showing the lecture as it will appear.
- VerifyA button on the review page runs every program in the lecture on a real JVM and compares the output with what the material claims.
- PublishAn editor publishes that revision with publish_revision, and it appears at once with no rebuild. Publishing is refused unless every program passed.
Roles
| Role | Can |
|---|---|
author | Read, validate and submit drafts |
editor | All of that, plus publish, reject and retire lectures |
Block types
| type | Description |
|---|---|
text | A paragraph. Fields: text. |
list | Bullets, or numbers with ordered:true. Fields: items[], ordered?. |
callout | A highlighted note. Fields: kind (note|tip|warn|activity|teacher), title?, text. "teacher" appears only in teacher view. |
cards | Side-by-side cards. Fields: items[{title, text?, code?}]. |
steps | Numbered procedure. Fields: items[{title, text?}]. |
table | A table. Fields: headers[], rows[][]. |
boxes | Variables drawn as named boxes. Fields: items[{type, name, value}]. |
code | A read-only fragment that need not compile. Fields: code, caption?. |
lab | An editable program students run and debug in place. Fields: id, title?, text?, files[] or code, stdin?, output? (exact stdout, checked by the verifier; omit only for interactive labs). |
predict | Students predict the output, then reveal or run it. Fields: id, code, question?, options?[], output, stdin?, why. |
quiz | Multiple choice. Fields: id, question, code?, options[], answer (zero-based index), why. |
fixit | A broken program to repair. Fields: id, title?, text?, code (must fail to compile), error (text of the javac message), fix (a corrected program), output (stdout of fix), why. |
exercise | An autograded task. Fields: id, title, text, starter, tests[{stdin?, output}], hints[], solution. |
Public reading, no token
GET https://prog1.ucas.app/api/lectures
GET https://prog1.ucas.app/api/lectures/{id}