7.0 KiB
MCP Consumption Spec
Purpose
Define exactly how an MCP client such as Claude Desktop or another agent runtime should consume the ClassroomIO MCP server.
This spec assumes:
- the agent performs source extraction externally
- the MCP server only accepts structured course payloads
- ClassroomIO API is the system of record
Consumption Model
User prompt/source material
-> Claude or agent
-> MCP tool call
-> ClassroomIO API
-> ClassroomIO DB
The MCP server is consumed as a tool surface, not as a conversational model.
Agent Responsibilities
The agent must:
- read source material such as PDFs, notes, prompts, or websites
- infer a structured course outline
- construct a normalized payload that matches the draft schema
- call MCP tools with that payload
- handle validation errors and revise payloads when needed
- only publish after explicit user confirmation
The agent must not:
- write directly to the ClassroomIO database
- assume ClassroomIO will parse raw PDFs
- assume drafts are automatically published
Authentication Model
Target model
Use an organization-scoped MCP key generated from the org Automation -> MCP tab.
That key should come from the same shared key infrastructure later reused by the Public API.
The MCP server forwards that credential to ClassroomIO on every request.
Example environment:
CLASSROOMIO_API_URL=https://api.classroomio.example
CLASSROOMIO_API_KEY=cio_mcp_xxxxx
Recommended request header:
Authorization: Bearer cio_mcp_xxxxx
Current bootstrap implementation
Until the shared organization key system lands, the local package uses:
Authorization: Bearer <PRIVATE_SERVER_KEY>
cio-org-id: <organization-id>
x-cio-actor-id: <profile-id>
That is an implementation bridge, not the intended long-term auth model.
MCP Transport
v1
stdio
This is the best default for Claude Desktop and local agent environments.
Future
- SSE or HTTP transport if remote/shared infrastructure is needed
Tool Surface
create_course_draft
Creates a reviewable draft from a normalized payload.
Input:
{
"sourceType": "prompt",
"idempotencyKey": "optional-key",
"summary": {
"sourceLabel": "Exponential Functions PDF"
},
"sourceArtifacts": [
{
"type": "pdf",
"label": "chapter-1.pdf"
}
],
"draft": {
"course": {
"title": "Exponential Functions",
"description": "A structured introduction to exponential functions.",
"type": "SELF_PACED",
"locale": "en"
},
"sections": [
{
"externalId": "sec-1",
"title": "Foundations",
"order": 0
}
],
"lessons": [
{
"externalId": "lesson-1",
"sectionExternalId": "sec-1",
"title": "What Is an Exponential Function?",
"order": 0
}
],
"lessonLanguages": [
{
"lessonExternalId": "lesson-1",
"locale": "en",
"content": "<p>Lesson content here</p>"
}
],
"warnings": []
}
}
Output:
{
"draftId": "uuid",
"status": "DRAFT",
"summary": {
"sectionCount": 1,
"lessonCount": 1,
"localeCount": 1,
"warningCount": 0
},
"warnings": []
}
get_course_draft
Fetches the current stored draft.
Input:
{
"draftId": "uuid"
}
Output:
{
"id": "uuid",
"status": "DRAFT",
"draft": {
"...": "normalized payload"
},
"warnings": []
}
update_course_draft
Updates a stored draft with revised structure or content.
Input:
{
"draftId": "uuid",
"draft": {
"...": "updated normalized payload"
}
}
Output:
{
"draftId": "uuid",
"status": "DRAFT",
"summary": {
"sectionCount": 3,
"lessonCount": 12,
"localeCount": 1,
"warningCount": 1
},
"warnings": [
{
"code": "LOW_CONFIDENCE_BOUNDARY",
"message": "Section split was inferred.",
"severity": "warning"
}
]
}
publish_course_draft
Publishes a stored draft into real ClassroomIO entities.
Input:
{
"draftId": "uuid",
"title": "Optional override",
"description": "Optional override",
"type": "SELF_PACED"
}
Output:
{
"courseId": "uuid",
"createdSections": 3,
"createdLessons": 12,
"localeCount": 1
}
Expected Agent Workflow
Flow A: Prompt-Based Course Creation
- User asks Claude to create a course.
- Claude plans the structure.
- Claude calls
create_course_draft. - Claude presents the summary to the user.
- User requests revisions if needed.
- Claude calls
update_course_draft. - User confirms publish.
- Claude calls
publish_course_draft.
Flow B: PDF-Based Course Creation
- User provides PDF to Claude.
- Claude extracts and structures the content externally.
- Claude builds normalized payload.
- Claude calls
create_course_draft. - Claude presents draft summary and warnings.
- Claude revises if needed.
- Claude publishes only after user confirmation.
Draft Schema Rules
The agent must ensure:
section.externalIdvalues are uniquelesson.externalIdvalues are unique- every
lesson.sectionExternalIdreferences an existing section - every
lessonLanguage.lessonExternalIdreferences an existing lesson - all required text fields are non-empty
If these rules are violated, ClassroomIO should reject the request with validation errors.
Error Handling Contract
Validation Errors
The MCP client should expect 400-level errors when:
- the payload shape is invalid
- section or lesson references are broken
- required fields are missing
Expected behavior:
- surface the error to the agent
- revise payload
- retry with corrected structure
Authorization Errors
The MCP client should expect:
401for missing or invalid auth403for valid auth but insufficient org permission
Publish Errors
If publish fails:
- do not assume partial success
- inspect returned error
- fetch the draft again if needed
- retry only if the failure is clearly safe to retry
Idempotency Guidance
The MCP client should send an idempotencyKey on draft creation when:
- the same source material may be retried
- the same user prompt may be replayed
- the client cannot guarantee exactly-once execution
Use one stable key per logical draft creation request.
Recommended User Experience in Claude
The agent should present:
- course title
- section count
- lesson count
- warnings
- a publish confirmation prompt before calling
publish_course_draft
The agent should not auto-publish immediately after draft creation.
Minimal v1 MCP Server Requirements
The MCP server should:
- expose the draft/publish tools above
- validate required inputs before forwarding
- forward auth and org context to ClassroomIO
- return structured JSON outputs to the client
- avoid embedding model logic
Future Extensions
Possible future tools:
list_course_draftsdelete_course_draftclone_course_structureadd_exercises_to_draftpreview_publish_diff
These are not required for v1.