3.3 KiB
3.3 KiB
MCP Course Authoring from Structured Payloads Implementation Plan
Scope Lock (v1)
- The MCP server is a thin API adapter, not a persistence layer.
- Draft review is mandatory before publish.
- External agents submit normalized course payloads.
- ClassroomIO does not parse PDFs or source material in v1.
- Publish uses existing ClassroomIO services for course, section, lesson, and lesson language creation.
- Authentication is org-scoped and must reject cross-org mutations.
Delivery Phases
- Phase A: Payload schema, validation, and draft persistence
- Phase B: Draft create/get/update API
- Phase C: Draft publish orchestration
- Phase D: MCP server and tool contracts
- Phase E: Observability, auth hardening, and idempotency
Ticket Breakdown
| ID | Area | Task | Key Files | Dependencies | Done When |
|---|---|---|---|---|---|
| MCP-A1 | Validation | Add structured course payload validation module | packages/utils/src/validation/course-import/course-import.ts |
None | Schemas exported and built |
| MCP-A2 | DB | Add draft persistence table | packages/db/src/schema.ts |
None | Draft schema updated |
| MCP-A3 | DB | Add draft query module | packages/db/src/queries/course-import/course-import.ts |
MCP-A2 | CRUD/query helpers exist |
| MCP-A4 | API | Add draft route skeleton | apps/api/src/routes/organization/course-import.ts |
MCP-A1 | Route group registered |
| MCP-B1 | API | Implement draft create service | apps/api/src/services/course-import/course-import.ts |
MCP-A4 | Structured payload creates draft |
| MCP-B2 | API | Implement draft fetch/update endpoints | apps/api/src/routes/organization/course-import.ts |
MCP-B1 | Draft can be reviewed and edited |
| MCP-C1 | API | Implement draft publish service | apps/api/src/services/course-import/course-import.ts |
MCP-B2 | Draft creates course, sections, lessons, languages |
| MCP-C2 | API | Add idempotent publish behavior | apps/api/src/services/course-import/course-import.ts |
MCP-C1 | Retries do not duplicate courses |
| MCP-D1 | MCP | Scaffold MCP package | apps/mcp/ or packages/mcp/ |
MCP-B2 | Stdio server runs locally |
| MCP-D2 | MCP | Add create_course_draft tool |
MCP server tool files | MCP-D1, MCP-B1 | Claude can create drafts |
| MCP-D3 | MCP | Add get_course_draft and update_course_draft tools |
MCP server tool files | MCP-B2 | Claude can inspect and revise drafts |
| MCP-D4 | MCP | Add publish_course_draft tool |
MCP server tool files | MCP-C2 | Claude can publish reviewed drafts |
| MCP-E1 | Security | Enforce org-scoped auth and rate limits | middleware + routes | MCP-A4 | Unauthorized access returns 401/403 |
| MCP-E2 | Observability | Add structured logging and audit trail | services + middleware | MCP-C1 | Draft and publish actions are traceable |
| MCP-E3 | Docs | Document setup and consumption contract | prd/mcp-course-authoring [DONE]/ and docs follow-up |
MCP-D4 | Operator docs exist |
Suggested First Sprint Slice
- Draft schema and table
- Draft create endpoint
- Draft get/update endpoint
- Draft publish endpoint
- Minimal MCP server with:
create_course_draftget_course_draftpublish_course_draft
Build and Verification Commands
pnpm --filter @cio/utils buildpnpm --filter @cio/db buildpnpm --filter @cio/api build- Build the MCP package/app once created