Skip to content

Feature/mcp - #271

Merged
guillermoscript merged 3 commits into
masterfrom
feature/mcp
Mar 2, 2026
Merged

Feature/mcp#271
guillermoscript merged 3 commits into
masterfrom
feature/mcp

Conversation

@guillermoscript

Copy link
Copy Markdown
Owner

This pull request introduces several important changes across the MCP server, client UI, and Supabase migrations to improve content management, ownership, and deletion capabilities for lessons, exams, and exercises. It also refines the UI for the OAuth consent flow and fixes issues with Supabase triggers when using the service role. The most significant updates are grouped below.

Content Deletion Tools (Destructive Actions)

  • Added new destructive tools for permanently deleting lessons (lms_delete_lesson), exams (lms_delete_exam), and exercises (lms_delete_exercise). These tools ensure all related data is removed and provide confirmation messages, with appropriate annotations indicating irreversibility. (Fd0600b5L351R418, Ff5b0038L574R621, F73b4317L356R396)
  • Updated the delete exam question tool to correctly indicate it is not idempotent.

Ownership, Filtering, and Validation Improvements

  • Added tenant ID when creating exercises and lessons to support multi-tenant filtering and ownership. (F73b4317L327R327, mcp-server/src/tools/lessons.tsR213)
  • Improved exercise template filtering to show both system templates and those created by the current user.
  • Enforced validation for multiple choice and true/false exam questions to require at least one option, both when creating exams and adding questions. [1] [2]

UI/UX Enhancements

API and Routing Fixes

Supabase Migration: Trigger and Policy Fixes

  • Made the changed_by field in content_versions nullable and updated triggers for lessons, exams, exercises, and prompt templates to work with service role inserts. Also updated RLS policies to allow inserts with changed_by as NULL.

These changes collectively improve data integrity, user experience, and multi-tenant support for the MCP platform.

guillermoscript and others added 3 commits March 2, 2026 18:25
The Next.js proxy strips /api/mcp prefix, so POST /api/mcp becomes
POST / on the MCP server. Added / as an additional route for the MCP
endpoint. Also fixed proxy fallback to /mcp instead of /.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of staying in a loading state forever after clicking Approve,
the consent page now shows a green checkmark with "Authorization complete"
message telling the user to close the window. Same for Deny.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tenant_id to lms_create_lesson and lms_create_exercise inserts
- Fix lms_create_exam: exam_date was NOT NULL in DB but optional in tool — add migration to make it nullable
- Fix lms_get_exam: order questions by question_id for deterministic output
- Fix lms_upsert_lesson_ai_task: validate at least one field provided
- Fix lms_get_lesson_ai_task: use maybeSingle() to distinguish DB errors from missing row
- Fix lms_delete_exam_question: correct idempotentHint to false
- Fix lms_add_exam_question and lms_create_exam: validate multiple_choice/true_false questions have options
- Fix lms_list_templates: scope to system templates + own templates (was returning all tenants' data)
- Add lms_delete_lesson, lms_delete_exam, lms_delete_exercise tools
- Add lms_get_lesson_ai_task tool
- Fix changed_by NOT NULL violation when MCP service role updates lessons/exams

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@guillermoscript
guillermoscript merged commit 4582025 into master Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant