@mtgibbs/canvas-lms-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +539 -0
- package/esm/_dnt.shims.d.ts +6 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +61 -0
- package/esm/agent.d.ts +10 -0
- package/esm/agent.d.ts.map +1 -0
- package/esm/agent.js +17 -0
- package/esm/cli.js +6 -0
- package/esm/package.json +3 -0
- package/esm/src/api/assignments.d.ts +40 -0
- package/esm/src/api/assignments.d.ts.map +1 -0
- package/esm/src/api/assignments.js +133 -0
- package/esm/src/api/client.d.ts +61 -0
- package/esm/src/api/client.d.ts.map +1 -0
- package/esm/src/api/client.js +179 -0
- package/esm/src/api/courses.d.ts +32 -0
- package/esm/src/api/courses.d.ts.map +1 -0
- package/esm/src/api/courses.js +85 -0
- package/esm/src/api/stats.d.ts +15 -0
- package/esm/src/api/stats.d.ts.map +1 -0
- package/esm/src/api/stats.js +58 -0
- package/esm/src/api/submissions.d.ts +33 -0
- package/esm/src/api/submissions.d.ts.map +1 -0
- package/esm/src/api/submissions.js +103 -0
- package/esm/src/api/users.d.ts +87 -0
- package/esm/src/api/users.d.ts.map +1 -0
- package/esm/src/api/users.js +139 -0
- package/esm/src/mcp/prompts/course-analysis.d.ts +7 -0
- package/esm/src/mcp/prompts/course-analysis.d.ts.map +1 -0
- package/esm/src/mcp/prompts/course-analysis.js +36 -0
- package/esm/src/mcp/prompts/daily-checkin.d.ts +7 -0
- package/esm/src/mcp/prompts/daily-checkin.d.ts.map +1 -0
- package/esm/src/mcp/prompts/daily-checkin.js +31 -0
- package/esm/src/mcp/prompts/grade-recovery.d.ts +7 -0
- package/esm/src/mcp/prompts/grade-recovery.d.ts.map +1 -0
- package/esm/src/mcp/prompts/grade-recovery.js +35 -0
- package/esm/src/mcp/prompts/index.d.ts +15 -0
- package/esm/src/mcp/prompts/index.d.ts.map +1 -0
- package/esm/src/mcp/prompts/index.js +20 -0
- package/esm/src/mcp/prompts/missing-work-audit.d.ts +7 -0
- package/esm/src/mcp/prompts/missing-work-audit.d.ts.map +1 -0
- package/esm/src/mcp/prompts/missing-work-audit.js +36 -0
- package/esm/src/mcp/prompts/week-planning.d.ts +7 -0
- package/esm/src/mcp/prompts/week-planning.d.ts.map +1 -0
- package/esm/src/mcp/prompts/week-planning.js +34 -0
- package/esm/src/mcp/server.d.ts +15 -0
- package/esm/src/mcp/server.d.ts.map +1 -0
- package/esm/src/mcp/server.js +51 -0
- package/esm/src/mcp/tools/get-courses.d.ts +11 -0
- package/esm/src/mcp/tools/get-courses.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-courses.js +29 -0
- package/esm/src/mcp/tools/get-due-this-week.d.ts +13 -0
- package/esm/src/mcp/tools/get-due-this-week.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-due-this-week.js +75 -0
- package/esm/src/mcp/tools/get-missing-assignments.d.ts +12 -0
- package/esm/src/mcp/tools/get-missing-assignments.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-missing-assignments.js +33 -0
- package/esm/src/mcp/tools/get-stats.d.ts +12 -0
- package/esm/src/mcp/tools/get-stats.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-stats.js +28 -0
- package/esm/src/mcp/tools/get-todo.d.ts +13 -0
- package/esm/src/mcp/tools/get-todo.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-todo.js +55 -0
- package/esm/src/mcp/tools/get-unsubmitted-past-due.d.ts +12 -0
- package/esm/src/mcp/tools/get-unsubmitted-past-due.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-unsubmitted-past-due.js +64 -0
- package/esm/src/mcp/tools/get-upcoming-assignments.d.ts +12 -0
- package/esm/src/mcp/tools/get-upcoming-assignments.d.ts.map +1 -0
- package/esm/src/mcp/tools/get-upcoming-assignments.js +29 -0
- package/esm/src/mcp/tools/index.d.ts +18 -0
- package/esm/src/mcp/tools/index.d.ts.map +1 -0
- package/esm/src/mcp/tools/index.js +26 -0
- package/esm/src/mcp/tools/list-assignments.d.ts +13 -0
- package/esm/src/mcp/tools/list-assignments.d.ts.map +1 -0
- package/esm/src/mcp/tools/list-assignments.js +40 -0
- package/esm/src/mcp/types.d.ts +83 -0
- package/esm/src/mcp/types.d.ts.map +1 -0
- package/esm/src/mcp/types.js +20 -0
- package/esm/src/types/canvas.d.ts +288 -0
- package/esm/src/types/canvas.d.ts.map +1 -0
- package/esm/src/types/canvas.js +5 -0
- package/esm/src/utils/config.d.ts +19 -0
- package/esm/src/utils/config.d.ts.map +1 -0
- package/esm/src/utils/config.js +54 -0
- package/esm/src/utils/init.d.ts +9 -0
- package/esm/src/utils/init.d.ts.map +1 -0
- package/esm/src/utils/init.js +20 -0
- package/manifest.json +91 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 mtgibbs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
# Canvas LMS MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mtgibbs/canvas-lms-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@mtgibbs/canvas-lms-mcp)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
An MCP (Model Context Protocol) server that connects AI assistants like Claude to your Canvas LMS account. Query grades, assignments, missing work, and more through natural language.
|
|
8
|
+
|
|
9
|
+
**Perfect for:** Parents monitoring their child's academic progress, students tracking their own work, or anyone who wants to interact with Canvas data through AI.
|
|
10
|
+
|
|
11
|
+
## What Can It Do?
|
|
12
|
+
|
|
13
|
+
Ask Claude things like:
|
|
14
|
+
- "What assignments are due this week?"
|
|
15
|
+
- "Show me missing assignments across all classes"
|
|
16
|
+
- "What's my grade in Biology?"
|
|
17
|
+
- "Are there any late assignments I should know about?"
|
|
18
|
+
- "What's on the to-do list for the next 7 days?"
|
|
19
|
+
|
|
20
|
+
## Installation Options
|
|
21
|
+
|
|
22
|
+
Choose the method that works best for you:
|
|
23
|
+
|
|
24
|
+
| Method | Best For | Credential Storage |
|
|
25
|
+
|--------|----------|-------------------|
|
|
26
|
+
| [Desktop Extension](#option-1-desktop-extension-recommended) | Easy one-click install | OS Keychain (secure) |
|
|
27
|
+
| [npm Package](#option-2-npm-package) | Flexibility, 1Password users | Config file or password manager |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Prerequisites (All Methods)
|
|
32
|
+
|
|
33
|
+
### 1. Get Your Canvas API Token
|
|
34
|
+
|
|
35
|
+
1. Log into your Canvas LMS instance (e.g., `https://yourschool.instructure.com`)
|
|
36
|
+
2. Go to **Account** → **Settings**
|
|
37
|
+
3. Scroll to **Approved Integrations**
|
|
38
|
+
4. Click **+ New Access Token**
|
|
39
|
+
5. Give it a name (e.g., "Claude MCP") and click **Generate Token**
|
|
40
|
+
6. **Copy the token immediately** - you won't be able to see it again
|
|
41
|
+
|
|
42
|
+
### 2. Find Your Canvas Base URL
|
|
43
|
+
|
|
44
|
+
Your Canvas base URL is the main URL you use to access Canvas:
|
|
45
|
+
- `https://yourschool.instructure.com`
|
|
46
|
+
- `https://canvas.yourdistrict.org`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Option 1: Desktop Extension (Recommended)
|
|
51
|
+
|
|
52
|
+
The easiest way to get started. Your API token is stored securely in your operating system's keychain.
|
|
53
|
+
|
|
54
|
+
### Install
|
|
55
|
+
|
|
56
|
+
1. Download the latest `.mcpb` file from [Releases](https://github.com/mtgibbs/canvas-lms-mcp/releases)
|
|
57
|
+
2. Double-click to install, or drag into Claude Desktop
|
|
58
|
+
3. Claude Desktop will prompt you to enter your Canvas credentials
|
|
59
|
+
4. Done! Start chatting about your courses
|
|
60
|
+
|
|
61
|
+
### What Gets Stored
|
|
62
|
+
|
|
63
|
+
- **API Token** → macOS Keychain / Windows Credential Manager (encrypted)
|
|
64
|
+
- **Base URL** → Claude Desktop settings
|
|
65
|
+
- **Student ID** → Claude Desktop settings (if using observer account)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Option 2: npm Package
|
|
70
|
+
|
|
71
|
+
More flexible setup with multiple credential management options.
|
|
72
|
+
|
|
73
|
+
**Requires:** [Node.js 18+](https://nodejs.org/)
|
|
74
|
+
|
|
75
|
+
### Basic Setup
|
|
76
|
+
|
|
77
|
+
Edit your Claude Desktop configuration file:
|
|
78
|
+
|
|
79
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
80
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"canvas": {
|
|
86
|
+
"command": "npx",
|
|
87
|
+
"args": ["-y", "@mtgibbs/canvas-lms-mcp"],
|
|
88
|
+
"env": {
|
|
89
|
+
"CANVAS_API_TOKEN": "your_token_here",
|
|
90
|
+
"CANVAS_BASE_URL": "https://yourschool.instructure.com"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Restart Claude Desktop after saving.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Securing Your API Token
|
|
102
|
+
|
|
103
|
+
The basic setup stores your token in plain text. Here are more secure alternatives:
|
|
104
|
+
|
|
105
|
+
### Option A: 1Password CLI (Recommended for 1Password Users)
|
|
106
|
+
|
|
107
|
+
If you use [1Password](https://1password.com/), you can inject secrets at runtime so they never touch your config file.
|
|
108
|
+
|
|
109
|
+
**1. Install the 1Password CLI:** [Download here](https://1password.com/downloads/command-line/)
|
|
110
|
+
|
|
111
|
+
**2. Store your Canvas credentials in 1Password** (note the vault and item names)
|
|
112
|
+
|
|
113
|
+
**3. Create a wrapper script** at `~/.config/canvas-mcp-wrapper.sh`:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
#!/bin/bash
|
|
117
|
+
# Canvas MCP 1Password Wrapper
|
|
118
|
+
|
|
119
|
+
# Ensure 1Password CLI is authenticated
|
|
120
|
+
if ! op account get &>/dev/null 2>&1; then
|
|
121
|
+
eval $(op signin)
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# Export credentials from 1Password and run the MCP server
|
|
125
|
+
export CANVAS_API_TOKEN=$(op read "op://Private/Canvas LMS/token")
|
|
126
|
+
export CANVAS_BASE_URL=$(op read "op://Private/Canvas LMS/url")
|
|
127
|
+
# Uncomment for observer accounts:
|
|
128
|
+
# export CANVAS_STUDENT_ID=$(op read "op://Private/Canvas LMS/student_id")
|
|
129
|
+
|
|
130
|
+
exec npx -y @mtgibbs/canvas-lms-mcp
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**4. Make it executable:**
|
|
134
|
+
```bash
|
|
135
|
+
chmod +x ~/.config/canvas-mcp-wrapper.sh
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**5. Update your Claude Desktop config:**
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"mcpServers": {
|
|
142
|
+
"canvas": {
|
|
143
|
+
"command": "/Users/YOUR_USERNAME/.config/canvas-mcp-wrapper.sh",
|
|
144
|
+
"args": []
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Now your token lives in 1Password and is only loaded when the MCP server starts.
|
|
151
|
+
|
|
152
|
+
### Option B: Shell Environment Variables (Claude Code)
|
|
153
|
+
|
|
154
|
+
If you're using Claude Code (CLI), you can use environment variable expansion:
|
|
155
|
+
|
|
156
|
+
**1. Add to your shell profile** (`~/.zshrc` or `~/.bashrc`):
|
|
157
|
+
```bash
|
|
158
|
+
export CANVAS_API_TOKEN="your_token_here"
|
|
159
|
+
export CANVAS_BASE_URL="https://yourschool.instructure.com"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**2. In your `.mcp.json` or Claude Code config**, use variable expansion:
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"canvas": {
|
|
167
|
+
"command": "npx",
|
|
168
|
+
"args": ["-y", "@mtgibbs/canvas-lms-mcp"],
|
|
169
|
+
"env": {
|
|
170
|
+
"CANVAS_API_TOKEN": "${CANVAS_API_TOKEN}",
|
|
171
|
+
"CANVAS_BASE_URL": "${CANVAS_BASE_URL}"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Option C: Restrict File Permissions
|
|
179
|
+
|
|
180
|
+
If you must store the token in the config file, at least restrict access:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# macOS/Linux
|
|
184
|
+
chmod 600 ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## For Parent/Observer Accounts
|
|
190
|
+
|
|
191
|
+
If you're a parent with an observer account linked to your child's Canvas account, add the student ID:
|
|
192
|
+
|
|
193
|
+
### Desktop Extension
|
|
194
|
+
Enter the Student ID when prompted during setup.
|
|
195
|
+
|
|
196
|
+
### npm Package
|
|
197
|
+
Add `CANVAS_STUDENT_ID` to your environment variables:
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"env": {
|
|
201
|
+
"CANVAS_API_TOKEN": "...",
|
|
202
|
+
"CANVAS_BASE_URL": "...",
|
|
203
|
+
"CANVAS_STUDENT_ID": "123456"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Finding Your Child's Student ID
|
|
209
|
+
|
|
210
|
+
1. Log into Canvas with your observer account
|
|
211
|
+
2. The student ID appears in URLs when viewing their information (e.g., `/users/123456`)
|
|
212
|
+
3. Or ask your school's Canvas administrator
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Available Tools
|
|
217
|
+
|
|
218
|
+
Once connected, Claude has access to these capabilities:
|
|
219
|
+
|
|
220
|
+
| Tool | Description |
|
|
221
|
+
|------|-------------|
|
|
222
|
+
| `get_courses` | List all courses with current grades |
|
|
223
|
+
| `get_missing_assignments` | Assignments flagged as missing by Canvas |
|
|
224
|
+
| `get_unsubmitted_past_due` | Past-due work not yet submitted |
|
|
225
|
+
| `get_upcoming_assignments` | Assignments due soon for a specific course |
|
|
226
|
+
| `get_due_this_week` | All assignments due across all courses |
|
|
227
|
+
| `list_assignments` | Search/filter assignments by status |
|
|
228
|
+
| `get_stats` | Late/missing statistics by course |
|
|
229
|
+
| `get_todo` | Planner items and to-do list |
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Available Prompts
|
|
234
|
+
|
|
235
|
+
Prompts are pre-built conversation starters that guide Claude through common workflows:
|
|
236
|
+
|
|
237
|
+
| Prompt | Description |
|
|
238
|
+
|--------|-------------|
|
|
239
|
+
| `daily-checkin` | Quick daily overview of grades, due items, and concerns |
|
|
240
|
+
| `week-planning` | Plan the upcoming week with prioritized assignments |
|
|
241
|
+
| `course-analysis` | Deep dive into a specific course's performance |
|
|
242
|
+
| `grade-recovery` | Find opportunities to improve grades through extra credit or resubmissions |
|
|
243
|
+
| `missing-work-audit` | Comprehensive audit of all missing and late work |
|
|
244
|
+
|
|
245
|
+
### Using Prompts
|
|
246
|
+
|
|
247
|
+
In Claude Desktop, you can trigger prompts directly:
|
|
248
|
+
|
|
249
|
+
1. Click the **prompt icon** (📝) in the chat input
|
|
250
|
+
2. Select a prompt from the list
|
|
251
|
+
3. Fill in any required parameters (like student ID)
|
|
252
|
+
4. Claude will execute the workflow using the appropriate tools
|
|
253
|
+
|
|
254
|
+
Or just ask naturally - Claude will use the right tools:
|
|
255
|
+
> "Can you do a daily check-in for my student?"
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Example Conversations
|
|
260
|
+
|
|
261
|
+
These examples show realistic interactions, including which tools Claude calls and what output to expect.
|
|
262
|
+
|
|
263
|
+
### Example 1: Daily Check-in
|
|
264
|
+
|
|
265
|
+
**User prompt:**
|
|
266
|
+
> "Give me a quick update on my kid's school situation"
|
|
267
|
+
|
|
268
|
+
**Tools called:**
|
|
269
|
+
1. `get_courses` - retrieves all courses with current grades
|
|
270
|
+
2. `get_missing_assignments` - checks for missing work
|
|
271
|
+
3. `get_due_this_week` - finds upcoming deadlines
|
|
272
|
+
|
|
273
|
+
**Claude's response:**
|
|
274
|
+
> Here's today's overview for your student:
|
|
275
|
+
>
|
|
276
|
+
> **Current Grades:**
|
|
277
|
+
> - AP Biology: 92% (A-)
|
|
278
|
+
> - English 11: 87% (B+)
|
|
279
|
+
> - US History: 78% (C+)
|
|
280
|
+
> - Algebra 2: 91% (A-)
|
|
281
|
+
>
|
|
282
|
+
> **Needs Attention:**
|
|
283
|
+
> - "Chapter 12 Reading Quiz" in US History - due yesterday, not submitted
|
|
284
|
+
> - "Lab Report: Photosynthesis" in AP Biology - due 2 days ago
|
|
285
|
+
>
|
|
286
|
+
> **Coming Up This Week:**
|
|
287
|
+
> - Essay Draft (English 11) - due Thursday
|
|
288
|
+
> - Unit Test (Algebra 2) - due Friday
|
|
289
|
+
>
|
|
290
|
+
> I'd recommend prioritizing those two missing assignments first, especially the History quiz since that class has the lowest grade.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### Example 2: Finding Missing Work
|
|
295
|
+
|
|
296
|
+
**User prompt:**
|
|
297
|
+
> "What assignments are missing across all classes?"
|
|
298
|
+
|
|
299
|
+
**Tools called:**
|
|
300
|
+
1. `get_missing_assignments` - gets Canvas-flagged missing items
|
|
301
|
+
2. `get_unsubmitted_past_due` - catches items Canvas may have missed
|
|
302
|
+
|
|
303
|
+
**Claude's response:**
|
|
304
|
+
> I found 4 missing assignments:
|
|
305
|
+
>
|
|
306
|
+
> | Assignment | Course | Due Date | Points |
|
|
307
|
+
> |------------|--------|----------|--------|
|
|
308
|
+
> | Chapter 12 Reading Quiz | US History | Jan 18 | 20 |
|
|
309
|
+
> | Lab Report: Photosynthesis | AP Biology | Jan 16 | 50 |
|
|
310
|
+
> | Vocabulary Set 8 | English 11 | Jan 15 | 15 |
|
|
311
|
+
> | Problem Set 7.3 | Algebra 2 | Jan 10 | 25 |
|
|
312
|
+
>
|
|
313
|
+
> **Total points at risk:** 110 points
|
|
314
|
+
>
|
|
315
|
+
> The Biology lab report is worth the most - I'd start there. The Algebra problem set is oldest, so check if late submissions are still accepted.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
### Example 3: Planning the Week
|
|
320
|
+
|
|
321
|
+
**User prompt:**
|
|
322
|
+
> "What's due in the next 7 days? Help me prioritize."
|
|
323
|
+
|
|
324
|
+
**Tools called:**
|
|
325
|
+
1. `get_due_this_week` - retrieves all assignments due in the next 7 days
|
|
326
|
+
2. `get_stats` - gets late/missing statistics for context
|
|
327
|
+
|
|
328
|
+
**Claude's response:**
|
|
329
|
+
> Here's what's coming up in the next 7 days:
|
|
330
|
+
>
|
|
331
|
+
> **High Priority (worth 50+ points):**
|
|
332
|
+
> - Unit 5 Test (Algebra 2) - Friday, Jan 24 - 100 points
|
|
333
|
+
> - Research Paper Draft (English 11) - Thursday, Jan 23 - 75 points
|
|
334
|
+
>
|
|
335
|
+
> **Medium Priority:**
|
|
336
|
+
> - Lab Questions (AP Biology) - Wednesday, Jan 22 - 30 points
|
|
337
|
+
> - Map Quiz (US History) - Tuesday, Jan 21 - 25 points
|
|
338
|
+
>
|
|
339
|
+
> **Lower Priority:**
|
|
340
|
+
> - Discussion Post (English 11) - Sunday, Jan 26 - 10 points
|
|
341
|
+
>
|
|
342
|
+
> **Suggested Schedule:**
|
|
343
|
+
> - Monday: Start research paper outline
|
|
344
|
+
> - Tuesday: Map quiz prep + continue paper
|
|
345
|
+
> - Wednesday: Bio lab questions
|
|
346
|
+
> - Thursday: Finish and submit paper
|
|
347
|
+
> - Friday: Algebra test prep
|
|
348
|
+
>
|
|
349
|
+
> Note: US History currently has 2 missing assignments, so staying current there is important.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Troubleshooting
|
|
354
|
+
|
|
355
|
+
### "CANVAS_API_TOKEN is required"
|
|
356
|
+
Your API token isn't being passed correctly. Double-check:
|
|
357
|
+
- The token is in the `env` section of your config
|
|
358
|
+
- There are no extra spaces or quotes around the token
|
|
359
|
+
- The config file is valid JSON
|
|
360
|
+
- If using 1Password wrapper, run it manually to test: `~/.config/canvas-mcp-wrapper.sh`
|
|
361
|
+
|
|
362
|
+
### "CANVAS_BASE_URL is required"
|
|
363
|
+
Make sure your Canvas URL is set and includes `https://`.
|
|
364
|
+
|
|
365
|
+
### Server not appearing in Claude
|
|
366
|
+
- Restart Claude Desktop completely
|
|
367
|
+
- Check that your config file is valid JSON (use a [JSON validator](https://jsonlint.com/))
|
|
368
|
+
- Ensure Node.js 18+ is installed: `node --version`
|
|
369
|
+
|
|
370
|
+
### "Unauthorized" or 401 errors
|
|
371
|
+
- Your API token may have expired - generate a new one
|
|
372
|
+
- Make sure the token has the necessary permissions
|
|
373
|
+
- Verify the base URL is correct (no trailing slash)
|
|
374
|
+
|
|
375
|
+
### Can't see student data (parent accounts)
|
|
376
|
+
- Verify `CANVAS_STUDENT_ID` is set correctly
|
|
377
|
+
- Confirm your observer account is properly linked to the student in Canvas
|
|
378
|
+
- Try the student ID without quotes (as a number)
|
|
379
|
+
|
|
380
|
+
### 1Password wrapper not working
|
|
381
|
+
- Run `op signin` manually first to authenticate
|
|
382
|
+
- Check that the item path matches your vault: `op read "op://VaultName/ItemName/field"`
|
|
383
|
+
- Ensure the wrapper script is executable: `chmod +x ~/.config/canvas-mcp-wrapper.sh`
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## Privacy & Security
|
|
388
|
+
|
|
389
|
+
### Data Collection
|
|
390
|
+
|
|
391
|
+
This MCP server collects and processes the following data **locally on your machine**:
|
|
392
|
+
|
|
393
|
+
| Data Type | Source | Purpose |
|
|
394
|
+
|-----------|--------|---------|
|
|
395
|
+
| Course information | Canvas API | Display grades and course lists |
|
|
396
|
+
| Assignment data | Canvas API | Show due dates, missing work, submissions |
|
|
397
|
+
| Student identifiers | Canvas API | Associate data with correct student |
|
|
398
|
+
| API credentials | User-provided | Authenticate with Canvas |
|
|
399
|
+
|
|
400
|
+
### Data Usage
|
|
401
|
+
|
|
402
|
+
- **Local processing only**: All data flows directly between Canvas and Claude on your machine
|
|
403
|
+
- **No external transmission**: This server does not send data to any third-party services
|
|
404
|
+
- **No telemetry**: We do not collect usage statistics, analytics, or crash reports
|
|
405
|
+
- **No data storage**: Data is fetched on-demand and not persisted between sessions
|
|
406
|
+
|
|
407
|
+
### Third-Party Services
|
|
408
|
+
|
|
409
|
+
This extension connects to:
|
|
410
|
+
- **Canvas LMS** (your school's instance): To retrieve academic data using your API token
|
|
411
|
+
- **Claude** (Anthropic): The AI assistant that processes your queries locally
|
|
412
|
+
|
|
413
|
+
We do not share your data with any other third parties.
|
|
414
|
+
|
|
415
|
+
### Data Retention
|
|
416
|
+
|
|
417
|
+
- **Session-based**: Data is only held in memory during active use
|
|
418
|
+
- **No caching**: Academic data is not cached or stored locally
|
|
419
|
+
- **Credentials**: Stored according to your installation method:
|
|
420
|
+
- Desktop Extension: OS Keychain (macOS Keychain / Windows Credential Manager)
|
|
421
|
+
- npm + 1Password: Your 1Password vault
|
|
422
|
+
- npm with env vars: Your config file (recommend restricting file permissions)
|
|
423
|
+
|
|
424
|
+
### Your Rights
|
|
425
|
+
|
|
426
|
+
- You can revoke access at any time by deleting your Canvas API token
|
|
427
|
+
- Uninstalling the extension removes all local configuration
|
|
428
|
+
- Your school's Canvas instance retains its own data per their policies
|
|
429
|
+
|
|
430
|
+
### Security Measures
|
|
431
|
+
|
|
432
|
+
- **Token scope**: Your API token only accesses data you can already see in Canvas
|
|
433
|
+
- **Read-only operations**: This server only reads data; it cannot modify assignments or grades
|
|
434
|
+
- **No network exposure**: The server only communicates via local stdio, not over the network
|
|
435
|
+
|
|
436
|
+
### Contact
|
|
437
|
+
|
|
438
|
+
For privacy questions or concerns:
|
|
439
|
+
- **GitHub Issues**: [github.com/mtgibbs/canvas-lms-mcp/issues](https://github.com/mtgibbs/canvas-lms-mcp/issues)
|
|
440
|
+
- **Author**: [@mtgibbs](https://github.com/mtgibbs)
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Support
|
|
445
|
+
|
|
446
|
+
Need help? Here's how to get support:
|
|
447
|
+
|
|
448
|
+
- **Bug Reports**: [Open an issue](https://github.com/mtgibbs/canvas-lms-mcp/issues/new?template=bug_report.md)
|
|
449
|
+
- **Feature Requests**: [Open an issue](https://github.com/mtgibbs/canvas-lms-mcp/issues/new?template=feature_request.md)
|
|
450
|
+
- **Questions**: [Start a discussion](https://github.com/mtgibbs/canvas-lms-mcp/discussions)
|
|
451
|
+
- **Security Issues**: Please report security vulnerabilities privately via [GitHub Security Advisories](https://github.com/mtgibbs/canvas-lms-mcp/security/advisories/new)
|
|
452
|
+
|
|
453
|
+
Response times: We aim to respond to issues within a few days. This is a community project maintained in spare time.
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Development
|
|
458
|
+
|
|
459
|
+
This project is built with [Deno](https://deno.land/) and uses [dnt](https://github.com/denoland/dnt) for npm packaging.
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# Clone the repo
|
|
463
|
+
git clone https://github.com/mtgibbs/canvas-lms-mcp.git
|
|
464
|
+
cd canvas-lms-mcp
|
|
465
|
+
|
|
466
|
+
# Run MCP server in development (requires Deno)
|
|
467
|
+
deno run -A agent.ts
|
|
468
|
+
|
|
469
|
+
# Run CLI in development
|
|
470
|
+
deno task dev courses --format table
|
|
471
|
+
|
|
472
|
+
# Build npm package
|
|
473
|
+
deno task build:npm
|
|
474
|
+
|
|
475
|
+
# Build Desktop Extension
|
|
476
|
+
deno task build:extension
|
|
477
|
+
|
|
478
|
+
# Type check
|
|
479
|
+
deno task check
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Releasing
|
|
483
|
+
|
|
484
|
+
Releases are fully automated via [Release Please](https://github.com/googleapis/release-please) + [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) (OIDC). No tokens required!
|
|
485
|
+
|
|
486
|
+
**How it works:**
|
|
487
|
+
```
|
|
488
|
+
Push commits with conventional messages (feat:, fix:, etc.)
|
|
489
|
+
↓
|
|
490
|
+
Release Please creates/updates a Release PR
|
|
491
|
+
↓
|
|
492
|
+
Merge the PR when ready
|
|
493
|
+
↓
|
|
494
|
+
Release Please creates GitHub Release + tag
|
|
495
|
+
↓
|
|
496
|
+
Publish workflow runs automatically
|
|
497
|
+
↓
|
|
498
|
+
npm package published + .mcpb attached to release
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
**Commit message format:**
|
|
502
|
+
- `feat: add new tool` → minor version bump (0.1.0 → 0.2.0)
|
|
503
|
+
- `fix: correct API error` → patch version bump (0.1.0 → 0.1.1)
|
|
504
|
+
- `feat!: breaking change` → major version bump (0.1.0 → 1.0.0)
|
|
505
|
+
- `chore: update deps` → no release
|
|
506
|
+
|
|
507
|
+
**First-time setup:**
|
|
508
|
+
|
|
509
|
+
1. Publish the first version manually:
|
|
510
|
+
```bash
|
|
511
|
+
deno task build:npm
|
|
512
|
+
cd npm && npm publish --access public
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
2. Configure Trusted Publisher on npmjs.com:
|
|
516
|
+
- Go to your package → **Settings** → **Trusted Publisher**
|
|
517
|
+
- Select **GitHub Actions**
|
|
518
|
+
- Organization/user: `mtgibbs`
|
|
519
|
+
- Repository: `canvas-lms-mcp`
|
|
520
|
+
- Workflow filename: `publish.yml`
|
|
521
|
+
- Click **Set up connection**
|
|
522
|
+
|
|
523
|
+
After that, just push commits and merge Release PRs - everything else is automatic!
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## License
|
|
528
|
+
|
|
529
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## Links
|
|
534
|
+
|
|
535
|
+
- [Canvas LMS API Documentation](https://canvas.instructure.com/doc/api/)
|
|
536
|
+
- [MCP Protocol Specification](https://modelcontextprotocol.io/)
|
|
537
|
+
- [Claude Desktop](https://claude.ai/download)
|
|
538
|
+
- [1Password CLI](https://1password.com/downloads/command-line/)
|
|
539
|
+
- [Report Issues](https://github.com/mtgibbs/canvas-lms-mcp/issues)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Deno } from "@deno/shim-deno";
|
|
2
|
+
export { Deno } from "@deno/shim-deno";
|
|
3
|
+
const dntGlobals = {
|
|
4
|
+
Deno,
|
|
5
|
+
};
|
|
6
|
+
export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
7
|
+
function createMergeProxy(baseObj, extObj) {
|
|
8
|
+
return new Proxy(baseObj, {
|
|
9
|
+
get(_target, prop, _receiver) {
|
|
10
|
+
if (prop in extObj) {
|
|
11
|
+
return extObj[prop];
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return baseObj[prop];
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
set(_target, prop, value) {
|
|
18
|
+
if (prop in extObj) {
|
|
19
|
+
delete extObj[prop];
|
|
20
|
+
}
|
|
21
|
+
baseObj[prop] = value;
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
deleteProperty(_target, prop) {
|
|
25
|
+
let success = false;
|
|
26
|
+
if (prop in extObj) {
|
|
27
|
+
delete extObj[prop];
|
|
28
|
+
success = true;
|
|
29
|
+
}
|
|
30
|
+
if (prop in baseObj) {
|
|
31
|
+
delete baseObj[prop];
|
|
32
|
+
success = true;
|
|
33
|
+
}
|
|
34
|
+
return success;
|
|
35
|
+
},
|
|
36
|
+
ownKeys(_target) {
|
|
37
|
+
const baseKeys = Reflect.ownKeys(baseObj);
|
|
38
|
+
const extKeys = Reflect.ownKeys(extObj);
|
|
39
|
+
const extKeysSet = new Set(extKeys);
|
|
40
|
+
return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
|
|
41
|
+
},
|
|
42
|
+
defineProperty(_target, prop, desc) {
|
|
43
|
+
if (prop in extObj) {
|
|
44
|
+
delete extObj[prop];
|
|
45
|
+
}
|
|
46
|
+
Reflect.defineProperty(baseObj, prop, desc);
|
|
47
|
+
return true;
|
|
48
|
+
},
|
|
49
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
50
|
+
if (prop in extObj) {
|
|
51
|
+
return Reflect.getOwnPropertyDescriptor(extObj, prop);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return Reflect.getOwnPropertyDescriptor(baseObj, prop);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
has(_target, prop) {
|
|
58
|
+
return prop in extObj || prop in baseObj;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
package/esm/agent.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server for Canvas LMS Integration
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for the MCP server. It initializes the Canvas API
|
|
5
|
+
* client and starts the MCP server with stdio transport.
|
|
6
|
+
*
|
|
7
|
+
* Tools and prompts are defined in src/mcp/tools and src/mcp/prompts.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/esm/agent.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server for Canvas LMS Integration
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for the MCP server. It initializes the Canvas API
|
|
5
|
+
* client and starts the MCP server with stdio transport.
|
|
6
|
+
*
|
|
7
|
+
* Tools and prompts are defined in src/mcp/tools and src/mcp/prompts.
|
|
8
|
+
*/
|
|
9
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
+
import { ensureClient } from "./src/utils/init.js";
|
|
11
|
+
import { createServer } from "./src/mcp/server.js";
|
|
12
|
+
// Initialize Canvas API client
|
|
13
|
+
await ensureClient();
|
|
14
|
+
// Create and start the MCP server
|
|
15
|
+
const server = createServer();
|
|
16
|
+
const transport = new StdioServerTransport();
|
|
17
|
+
await server.connect(transport);
|
package/esm/cli.js
ADDED
package/esm/package.json
ADDED