https://github.com/jamubc/canvas-mcp-tool
https://github.com/jamubc/canvas-mcp-tool
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jamubc/canvas-mcp-tool
- Owner: jamubc
- License: other
- Created: 2025-07-09T20:28:48.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-12T05:38:55.000Z (11 months ago)
- Last Synced: 2025-10-11T12:35:55.754Z (8 months ago)
- Language: TypeScript
- Size: 279 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
canvas-mcp-tool
Leverage
on
to quickly scan through your courses, find assignments and related content & stay up to date with your academics.
📋 Available Tools
-
list_assignments - List assignments for a course
-
get_assignment - Get assignment details
-
list_courses - List your enrolled courses
-
get_course - Get details about a specific course
-
get_profile - Get your user profile
-
list_users - List users in a course
-
get_dashboard_cards - Get your dashboard cards
-
list_calendar_events - List calendar events
-
get_file_metadata - Get information about a Canvas file
-
get_file_content - Extract text content from Canvas files (DOCX, TXT, and more)
Claude Desktop
{
"mcpServers": {
"canvas": {
"command": "npx",
"args": ["-y", "canvas-mcp-tool"],
"env": {
"CANVAS_API_URL": "https://your-schools-canvas-url.com",
"CANVAS_API_TOKEN": "your_token_here",
"CANVAS_API_VERSION": "v1",
"CANVAS_API_TIMEOUT": "30000",
"CANVAS_MAX_RETRIES": "3"
}
}
}
}
Claude Code (Recommended)
# Simple usage (if env vars are already set in your shell):
claude mcp add canvas -- npx -y canvas-mcp-tool
# Or inline specify all required and optional variables:
CANVAS_API_URL="https://your-schools-canvas-url.com" \
CANVAS_API_TOKEN="your_canvas_api_token_here" \
CANVAS_API_VERSION="v1" \
CANVAS_API_TIMEOUT=30000 \
CANVAS_MAX_RETRIES=3 \
claude mcp add canvas -- npx -y canvas-mcp-tool
Gemini CLI
Add to your ~/.gemini/settings.json:
{
"mcpServers": {
"canvas": {
"command": "npx",
"args": ["-y", "canvas-mcp-tool"],
"env": {
"CANVAS_API_URL": "https://your-schools-canvas-url.com",
"CANVAS_API_TOKEN": "your_token_here",
"CANVAS_API_VERSION": "v1",
"CANVAS_API_TIMEOUT": "30000",
"CANVAS_MAX_RETRIES": "3"
}
}
}
}
Note: Gemini CLI requires all environment variables to be explicitly defined in the configuration.
## Configuration
After installation, you'll need to configure your Canvas URL and API token:
## Getting a Canvas API Token
> **Warning:** Your Canvas API token is sensitive - treat it like a password and never share it or commit it to source control.
1. Log into your Canvas account
2. Go to Account → Settings
3. Scroll to "Approved Integrations"
4. Click "+ New Access Token"
5. Enter a purpose and click "Generate Token"
6. Copy the token and use in it your preferred setup.
### For Claude Desktop
You can add these to your shell profile (`~/.zshrc`, `~/.bashrc`, etc.) so they're loaded automatically:
```bash
# ~/.zshrc or ~/.bashrc
export CANVAS_API_URL="https://your-schools-canvas-url.com"
export CANVAS_API_TOKEN="your_canvas_api_token_here"
export CANVAS_API_VERSION="v1"
export CANVAS_API_TIMEOUT=30000
export CANVAS_MAX_RETRIES=3
```
## Local Setup
1. Clone this repository
2. Install dependencies:
```bash
npm install
```
3. Create a `.env` file with your Canvas credentials:
```bash
cp .env.example .env
```
4. Edit `.env` and add your Canvas API token:
```
CANVAS_API_URL=https://your-schools-canvas-url.com
CANVAS_API_TOKEN=your_canvas_api_token_here
```
Add optional cache and logging settings (defaults shown):
```
CACHE_ENABLED=true # Enable response caching (set to false to disable)
CACHE_TTL=300 # Cache time-to-live in seconds
LOG_LEVEL=info # Logging level: debug, info, warn, error
LOGGING_ENABLED=true # Enable logging (set to false to disable)
```
## Build
```bash
npm run build
```