mcp-canvas-gateway
Programmatic interface for interacting with the Canvas Learning Management System, facilitating the automation of administrative tasks related to course structure and user assignments via the Canvas REST API. Enhances operational efficiency through features such as institutional catalog retrieval and role-based assignment filtering, augmented by integrated guidance mechanisms.
Author

enkhbold470
Quick Info
Actions
Tags
Canvas MCP Endpoint Implementation
This repository details a Model Context Protocol (MCP) server designed to interface directly with the Canvas LMS API endpoints. It furnishes the capabilities required for remote, automated manipulation of Canvas resources.
Core Capabilities
- Retrieve complete listings of organizational courses, with an optional filter based on participant assignment roles (e.g., instructor, learner, teaching assistant).
- Provision of immediate, contextual assistance prompts for tool invocation.
Necessary Preconditions
- Execution environment requires Node.js, version 18 or higher.
- Access credentials for a deployed Canvas LMS platform.
- A valid Canvas API authentication token.
- The Cursor IDE (for client-side utilization of the server).
Deployment Sequence
- Obtain a local copy of this codebase.
-
Install required software packages: bash npm install
-
Configure requisite environment variables: bash export CANVAS_BASE_URL="https://your-canvas-domain.edu" export CANVAS_ACCESS_TOKEN="your-secret-api-key"
-
Compile the source code: bash npm run build
-
Initialize the server process: bash npm start
Integration with Cursor IDE
To leverage this gateway within the Cursor environment:
- Access Cursor's application preference pane.
- Navigate to the section dedicated to MCP server configuration.
- Introduce a new configuration entry:
{ "mcpServers": { "canvas": { "command": "npm", "args": [ "start" ], "cwd": "/absolute/path/to/mcp-server-canvas" } } }
- Persist the changes and relaunch Cursor.
- The collection of Canvas utilities will subsequently materialize within Cursor's designated MCP interface panel.
Exposed Functionality
fetch_courses
Queries the system to retrieve all aggregated course records.
Parameters:
- role_filter (optional): Constrains the returned set of courses based on the primary engagement role (e.g., 'teacher', 'student', 'ta').
Sample Output Schema:
{ "content": [ { "type": "text", "text": [ { "id": 1234, "name": "Introductory Computer Science", "code": "CS101", "status": "active", "timelineStart": "2024-09-01T00:00:00Z", "timelineEnd": "2025-05-30T23:59:59Z" } ] } ] }
fetch-courses-assist
A conversational helper designed to clarify the proper invocation syntax and parameter usage for the fetch_courses operation.
Development Guide
This server infrastructure is constructed utilizing TypeScript and the official MCP Software Development Kit. To extend functionality:
- Augment the
CanvasAPIclass with novel API interaction methods. - Register supplementary command interfaces using
server.tool(). - Register explanatory dialogue prompts using
server.prompt(). - Recompile the artifact and conduct verification testing.
Diagnostics and Resolution
Should operational anomalies arise:
- Confirm the integrity and proper setting of all required environment variables.
- Validate that the supplied Canvas API credentials possess the requisite authorization scope.
- Examine the diagnostic logs produced by the Cursor MCP server component for error indicators.
- Verify the file system path specified within the Cursor configuration accurately points to this running service.
