Skip to main content
Glama
README.md
# Canvas MCP on Cloudflare

This project deploys a read-only Canvas MCP server to Cloudflare Workers.

It includes a setup page so any user can:

1. Enter their Canvas base URL
2. Enter their Canvas access token
3. Generate a private MCP endpoint to paste into Poke

The generated MCP URL contains an encrypted Canvas configuration. Treat it like a password.

## What it supports

- Courses
- Assignments
- Files
- PDF text extraction
- Folders
- Modules
- Pages
- Announcements
- Discussion topics
- Quizzes
- Calendar events
- Todo items

## Local development

1. Install dependencies:

```bash
npm install
```

2. Add a Worker secret for local `wrangler dev`:

```bash
echo 'CONFIG_ENCRYPTION_SECRET=replace-with-a-long-random-string' > .dev.vars
```

3. Start the Worker locally:

```bash
npm run dev
```

4. Open the local URL shown by Wrangler, fill in the form, and copy the generated MCP URL.

## Deploy to Cloudflare

1. Authenticate if needed:

```bash
npx wrangler whoami
```

2. Set the encryption secret:

```bash
npx wrangler secret put CONFIG_ENCRYPTION_SECRET
```

Use a long random value. Example:

```bash
openssl rand -base64 32
```

3. Deploy:

```bash
npm run deploy
```

4. Open the deployed Worker URL. Users can generate their own MCP URL from the setup page.

## Poke setup

1. In Canvas, create an access token from `Account > Settings`.
2. Open the deployed setup page.
3. Paste the Canvas base URL and token.
4. Copy the generated MCP URL.
5. In Poke, add an integration and use that generated MCP URL as the server URL.

## Optional local Node mode

The original local server still works if you prefer fixed environment variables:

```bash
CANVAS_BASE_URL=https://canvas.school.edu \
CANVAS_TOKEN=your-token \
npm run start:http
```

## License

Licensed under the GNU General Public License v3.0. See [LICENSE](LICENSE).