This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
pip install uv
uv pip install -e .
.env
file with CANVAS_API_TOKEN
and CANVAS_API_URL
canvas-mcp-server
canvas-mcp-server
(or ./start_canvas_server.sh
for legacy setup)canvas-mcp-server --test
canvas-mcp-server --config
~/Library/Application Support/Claude/claude_desktop_config.json
canvas-mcp/
├── src/canvas_mcp/ # Main application code
│ ├── core/ # Core utilities (client, config, validation)
│ ├── tools/ # MCP tool implementations
│ ├── resources/ # MCP resources and prompts
│ └── server.py # FastMCP server entry point
├── docs/ # Essential documentation
├── archive/ # Legacy code and development specs (git-ignored)
├── .env # Configuration
└── start_canvas_server.sh # Server startup script
@validate_params
decorator with sophisticated Union/Optional type handlingcourse_code_to_id_cache
and id_to_course_code_cache
get_course_id()
abstractionformat_date()
and parse_date()
functions{action}_{entity}[_{specifier}]
patternmake_canvas_request()
use_form_data=True
for Canvas compatibilityfetch_all_paginated_results()
handles Canvas pagination transparentlyanonymize_response_data()
validate_parameter()
: Runtime type coercion supporting complex types@validate_params
: Automatic validation decorator for all MCP toolsget_course_id()
: Converts any identifier type to Canvas IDget_course_code()
: Reverse lookup from ID to human-readable coderefresh_course_cache()
: Rebuilds identifier mapping from Canvas APIget_student_analytics()
: Multi-dimensional educational data analysisget_assignment_analytics()
: Statistical performance analysis with grade distributionget_peer_review_completion_analytics()
: Peer review tracking and completion analysisget_peer_review_comments()
: Extract actual peer review comment text and analysisanalyze_peer_review_quality()
: Comprehensive comment quality analysis with metricsidentify_problematic_peer_reviews()
: Automated flagging of low-quality reviewssend_conversation()
: Core Canvas messaging with form data supportsend_peer_review_reminders()
: Automated peer review reminder workflowsend_peer_review_followup_campaign()
: Complete analytics → messaging pipelineMessageTemplates
: Flexible template system for various communication types@mcp.tool()
decorator with @validate_params
Union[str, int]
and get_course_id()
for flexibilityformat_date()
for all date outputsuse_form_data=True
for Canvas messaging endpoints_should_anonymize_endpoint()
list_discussion_topics(course_id)
- Find available discussion forumslist_discussion_entries(course_id, topic_id)
- See all posts in a discussionget_discussion_entry_details(course_id, topic_id, entry_id)
- Get complete student commentreply_to_discussion_entry(course_id, topic_id, entry_id, "Your response")
- Respond to student commentscreate_discussion_topic(course_id, title, message)
- Start new discussion forumspost_discussion_entry(course_id, topic_id, message)
- Add top-level postsget_peer_review_completion_analytics(course_id, assignment_id)
- Get students needing remindersMessageTemplates.get_template()
or custom message contentsend_peer_review_reminders()
for targeted messagingsend_peer_review_followup_campaign()
for complete automated workflowget_peer_review_comments(course_id, assignment_id)
- Get all review text and metadataanalyze_peer_review_quality(course_id, assignment_id)
- Generate comprehensive quality metricsidentify_problematic_peer_reviews(course_id, assignment_id)
- Find reviews needing attentionextract_peer_review_dataset(course_id, assignment_id, format="csv")
- Export for further analysisgenerate_peer_review_feedback_report(course_id, assignment_id)
- Create instructor-ready reportsCANVAS_API_URL
environment variableCANVAS_API_TOKEN
use_form_data=True
for /conversations
endpointsDo not be afraid to question what I say. Do not always respond with “You’re right!” Question the assertions I make and decide whether they are true. If they are probably true, don’t question them. If they are probably false, question them. If you are unsure, question them. Always think critically about what I say and decide for yourself whether it is true or false