| title | description | icon |
|---|---|---|
MCP Server & AI Assistance |
Model Context Protocol server for AI-powered student support and development assistance |
brain-circuit |
Pawtograder includes a Model Context Protocol (MCP) server that enables AI assistants to help instructors and TAs support students who are struggling with programming assignments.
The MCP server provides AI assistants with secure, authenticated access to course data, allowing them to:
- Fetch help requests and discussion threads
- Access student submissions and test results
- Review build output and error messages
- Provide context-aware assistance to course staff
All access is controlled through Supabase OAuth authentication and restricted to instructors and graders only.
- Supabase OAuth: Secure authentication using your Pawtograder account
- Role-based access: Only instructors and graders can use the MCP server
- Privacy protection: Never exposes sensitive user data or private profile information
- Row-level security: All database queries respect Supabase RLS policies
The MCP server provides the following tools for AI assistants:
- Fetch help requests: Retrieve active and resolved help requests from office hours queues
- Get discussion threads: Access discussion board posts and replies
- View chat history: Read conversation history between students and staff
- Fetch submissions: Access student code submissions for specific assignments
- Get test results: Retrieve autograder test output and results
- View build output: Access compilation errors and build logs
- Assignment handouts: Access assignment descriptions and requirements via the
handout_urlfield - Course information: Retrieve course settings and configuration
Course staff can access AI assistance directly from:
- Help request chat: Click the "AI Help" button in the help request interface
- Discussion threads: Use AI assistance when responding to student questions
The AI Help button generates an MCP context URL that can be used with any MCP-compatible client (such as Claude Desktop, Cursor, or other AI development tools).
When running Supabase locally, the MCP server is automatically available at:
http://127.0.0.1:54321/mcp
This URL is displayed in the output when you run npx supabase start.
The MCP server requires the following database schema additions:
Assignments can include a handout_url field that points to the assignment description or requirements document. This provides AI assistants with context about what students are working on:
ALTER TABLE assignments ADD COLUMN handout_url TEXT;Update your assignments to include handout URLs:
UPDATE assignments
SET handout_url = 'https://example.com/assignments/hw1.pdf'
WHERE id = 'assignment-id';- Navigate to a help request or discussion thread where you want AI assistance
- Click the "AI Help" button in the interface
- Copy the generated MCP context URL
- Paste the URL into your MCP-compatible AI client (e.g., Claude Desktop)
- The AI assistant will have access to:
- The student's question or help request
- Their code submission
- Test results and error messages
- Assignment requirements (if handout_url is configured)
The MCP server is implemented as a Supabase Edge Function and follows the Model Context Protocol specification. You can extend it by:
- Adding new tools: Define additional MCP tools in the Edge Function
- Expanding data access: Add new database queries (respecting RLS policies)
- Customizing context: Modify what information is provided to AI assistants
The MCP server is designed with privacy in mind:
- No user table access: The server never queries the
userstable directly - No private profiles: The
is_private_profileflag is never exposed - Instructor/grader only: Only authenticated course staff can access the MCP server
- RLS enforcement: All database queries respect row-level security policies
- Audit logging: MCP requests are logged for security and debugging
The MCP server works with any client that supports the Model Context Protocol:
- Claude Desktop: Anthropic's desktop application with MCP support
- Cursor: AI-powered code editor with MCP integration
- Custom clients: Build your own MCP client using the protocol specification
- Verify Supabase is running:
npx supabase status - Check that Edge Functions are running:
npx supabase functions serve - Ensure you're authenticated as an instructor or grader
- Verify your account has instructor or grader role in the course
- Check that RLS policies allow access to the requested data
- Ensure the MCP context URL is correctly formatted
- Verify the assignment has a
handout_urlconfigured - Check that the URL is accessible to the AI assistant
- Ensure the handout document is in a format the AI can read (PDF, Markdown, HTML)
Planned improvements to the MCP server include:
- Expanded tool set: Additional tools for accessing course analytics and gradebook data
- Real-time updates: Support for streaming updates to AI assistants
- Custom prompts: Configurable system prompts for different types of assistance
- Integration with autograder: Direct access to test case details and grading rubrics