AI Assistance Tools
Pawtograder includes a Model Context Protocol (MCP) server that enables AI assistants to help instructors and TAs support students who are struggling with errors in their programming assignments.Overview
The MCP server provides AI assistants with secure, read-only access to help request data, discussion threads, student submissions, test results, and build output. This allows AI tools to provide context-aware assistance when helping students debug their code.Authentication
The MCP server uses Supabase OAuth authentication and is restricted to instructors and graders only. Students cannot access the MCP server.Privacy Protection
The MCP server is designed with privacy in mind:- Never exposes the users table
- Does not expose
is_private_profileflags - Provides only the data necessary to help students with their assignments
Available Tools
The MCP server provides the following tools for AI assistants:- Fetch help requests: View active and past help requests from students
- Fetch discussion threads: Access discussion board posts and replies
- Fetch submissions: Retrieve student submission details
- Fetch test results: View autograder test output and results
- Fetch build output: Access compilation and build logs
Assignment Context
To provide better context to AI assistants, assignments now include ahandout_url field. This field can be set to point to the assignment handout or specification, allowing AI assistants to understand the assignment requirements when helping students.
Using AI Assistance
AI Help Button
When viewing a help request chat or discussion thread, instructors and graders will see an AI Help button. Clicking this button generates an MCP context that can be used with any MCP-compatible AI client.MCP-Compatible Clients
The MCP server works with any MCP-compatible client, including:- Claude Desktop
- Other AI assistants that support the Model Context Protocol
Local Development
When running Pawtograder locally with Supabase, the MCP server is available at:description: “Use AI tools to help support students with programming errors and debugging” icon: “sparkles”
AI Assistance for Office Hours
Pawtograder includes AI assistance tools that enable instructors and TAs to use AI assistants (like Claude) to help support students who are struggling with errors in their programming assignments.Overview
The AI assistance feature uses the Model Context Protocol (MCP) to provide AI assistants with secure, read-only access to relevant course data. This allows AI tools to:- Fetch help requests and discussion threads
- Review student submissions and test results
- Analyze build output and error messages
- Provide context-aware suggestions for helping students
AI assistance is only available to instructors and graders. Students cannot access these tools directly. All access is authenticated through Supabase OAuth.
Features
AI Help Button
When viewing a help request chat or discussion thread, instructors and TAs will see an AI Help button. Clicking this button:- Generates an MCP context for the current conversation
- Provides a connection string that can be used with any MCP-compatible client
- Includes relevant assignment context, submission data, and test results
Available Tools
The MCP server provides several tools for AI assistants:- Fetch help requests: Retrieve details about student help requests
- View discussion threads: Access course discussion posts and replies
- Review submissions: Examine student code submissions
- Analyze test results: Review autograder output and test failures
- Check build output: Inspect compilation errors and build logs
Privacy Protection
The AI assistance system is designed with privacy in mind:- Never exposes the users table or private profile information
- Only provides access to course-related data
- Requires instructor or grader authentication
- All access is logged and auditable
Setting Up AI Assistance
Adding Assignment Context
To help AI assistants provide better support, you can add ahandout_url to your assignments. This URL should point to the assignment handout or instructions, which provides important context for the AI assistant.
To add a handout URL:
- Navigate to the assignment settings
- Add the URL to the assignment handout in the
handout_urlfield - Save the assignment
Using AI Assistance
With Claude Desktop
- Click the AI Help button in a help request or discussion thread
- Copy the MCP connection string
- Add the connection to your Claude Desktop MCP configuration
- Claude will have access to the relevant course context
With Other MCP Clients
Any MCP-compatible client can connect to the Pawtograder MCP server using the connection string provided by the AI Help button.Best Practices
- Review AI suggestions: Always review and verify AI-generated suggestions before sharing with students
- Use for context: AI assistance is most helpful for understanding error patterns and suggesting debugging approaches
- Maintain privacy: Don’t share AI-generated content that includes sensitive student information
- Provide feedback: If AI suggestions are unhelpful, use that as an opportunity to improve assignment documentation
Technical Details
The MCP server is built into Pawtograder and uses:- Supabase OAuth for authentication
- Read-only database access
- Secure token-based authorization
- Standard MCP protocol for tool invocation
Getting AI Help
When viewing a help request or discussion thread, click the AI Help button to copy a formatted prompt that includes:- The student’s question and conversation history
- Linked assignment details and handout URL
- Submission files and test results
- Suggested MCP tools for fetching additional context
Setting Up MCP Access
To use AI assistance with Claude Desktop:1. Install Claude Desktop
Download from claude.ai/download2. Create an API Token
- Go to Settings → API Tokens in Pawtograder
- Click Create New Token
- Give it a name (e.g., “Claude Desktop”)
- Copy the token (it will only be shown once)
3. Configure Claude Desktop
Add this configuration to your Claude Desktop config file: macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
YOUR_TOKEN_HERE with the token you created in step 2.
4. Restart Claude Desktop
Quit and reopen Claude Desktop. You should see “pawtograder” listed as an available MCP server.Available AI Tools
The MCP server provides these tools for AI assistants:Context Tools
- get_help_request - Fetch help request with full conversation history
- get_discussion_thread - Fetch discussion thread with replies
- get_assignment - Get assignment spec, handout URL, and rubric
Submission Tools
- get_submission - Get submission metadata and summary
- list_submission_files - See what files were submitted
- get_submission_files - Fetch specific source files (supports glob patterns like
*.java)
Test Tools
- list_submission_tests - See all test results (pass/fail, scores)
- get_test_output - Get detailed output for specific tests
- get_submission_build_output - Get compilation/build errors
Search Tools
- search_help_requests - Find related help requests
- search_discussion_threads - Find similar questions from other students
AI Analysis Features
AI assistance is available in multiple contexts:- Help requests: Click AI Help in the help request chat
- Discussion threads: Click the AI Help icon in thread actions
- Test failures: Click AI Help on failing test results
- Build errors: Click AI Help on build error messages
- Test insights: Click AI Analyze on common error patterns
Providing Feedback
After using AI assistance, you’ll be prompted to provide feedback on whether the analysis was helpful. This feedback helps improve the AI assistance feature for your course.AI assistance is only available to instructors and graders. Students cannot access these tools.
Privacy and Security
The MCP server is designed with privacy in mind:- Never exposes student email addresses or user table data
- Only accessible to instructors and graders
- Requires authentication via API tokens
- All data access respects Pawtograder’s existing permissions
How It Works
The AI assistance system uses the Model Context Protocol (MCP) to enable AI assistants to access relevant student data securely. When helping a student, you can click the AI Help button to generate context that can be shared with MCP-compatible AI clients like Claude.Available Context
The AI assistance tools can access:- Help requests: Current and past help requests with student descriptions
- Discussion threads: Related discussion posts and replies
- Submissions: Student code submissions for assignments
- Test results: Autograder output and test failures
- Build output: Compilation errors and build logs
- Assignment handouts: Assignment instructions and requirements (when configured)
Using AI Help
The AI Help button appears in two locations:- Help request chat view: When actively helping a student through office hours
- Discussion thread view: When viewing student questions on the discussion board
Privacy and Security
The AI assistance system is designed with privacy in mind:- Instructor/grader access only: Only users with instructor or grader roles can access AI assistance tools
- Supabase OAuth authentication: Secure authentication ensures only authorized users can access student data
- No user table exposure: The system never exposes the users table or private profile information
- Audit trail: All AI assistance requests are logged for compliance and review
Configuration
To enable AI assistance for an assignment, instructors can add ahandout_url field to the assignment. This URL points to the assignment instructions or handout, providing the AI assistant with context about what students are trying to accomplish.
The AI assistance feature requires an MCP-compatible client to use the generated context. The system generates the context but does not directly integrate with any specific AI service.
Best Practices
When using AI assistance to help students:- Review AI suggestions: Always review AI-generated responses before sharing with students
- Maintain pedagogical goals: Ensure AI assistance supports learning rather than providing complete solutions
- Protect student privacy: Be mindful of what information you share with AI tools
- Use assignment context: Set the
handout_urlfield on assignments to help AI understand requirements
Security Considerations
- The MCP server requires authentication and is restricted to course staff
- All access is logged and auditable
- The server provides read-only access to course data
- Sensitive user information is never exposed
- Review AI suggestions: Always review and verify AI-generated suggestions before sharing them with students
- Use as a starting point: Treat AI suggestions as a starting point for your own analysis, not a complete solution
- Maintain pedagogical goals: Ensure that AI-assisted help still supports learning objectives and doesn’t simply provide answers
- Protect student privacy: Be mindful of student data when using external AI services
MCP Server Setup
For advanced users who want to set up their own MCP server integration, the system provides:- Supabase OAuth authentication flow
- RESTful API endpoints for fetching student data
- Tools for retrieving help requests, submissions, test results, and build output
- Secure token-based access control