convez.ai
MCP ServerIntegração & APIsIntermediário
tylergibbs1

Canvas MCP Server

tylergibbs1/canvas-mcp

Acesso estruturado a Canvas LMS para agentes de IA via API REST

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que fornece acesso estruturado a Canvas LMS para agentes de IA, incluindo cursos, prazos, notas, envios e discussões via API REST oficial. Integra-se com qualquer instância Canvas hospedada pelo Instructure.

Instalação

$npx convez-ai tylergibbs1/canvas-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Automatizar consultas de prazos e notas em múltiplos cursos
  • Submeter tarefas e responder discussões via agentes de IA
  • Construir assistentes para planejamento de coursework e organização acadêmica

Veredito

MCP server robusto e bem arquitetado para Canvas LMS com 11 ferramentas orientadas ao fluxo de trabalho do estudante. Prioriza segurança com dry-run em operações de escrita e design limpo que aproveita a API REST — ideal para quem quer automatizar tarefas acadêmicas sem scraping frágil.

README

A tradução para o português deste README ainda está na fila.

canvas-mcp

CI License: MIT Node Model Context Protocol

A Model Context Protocol server that gives AI agents structured access to Canvas LMS — coursework, deadlines, grades, submissions, discussions, and messages — over the official REST API.

Works with any Instructure-hosted Canvas instance. Built and validated against canvas.okstate.edu.

Contents

Why the REST API

Canvas exposes a stable, versioned API at /api/v1/. Wrapping it — rather than scraping the web UI — yields:

  • Single-call actions instead of multi-page navigation.
  • Resilience to UI redesigns; the API is versioned.
  • Compact, structured JSON that doesn't flood an agent's context with rendered HTML.
  • Simple auth via one bearer token.

Browser automation is reserved for things genuinely outside Canvas — embedded LTI tools such as zyBooks, Cengage, or Coursera quizzes, whose contents Canvas itself cannot see.

Features

  • 11 workflow-oriented tools spanning the full student workflow, designed for agent ergonomics (human-readable names over opaque IDs, consolidated multi-step actions).
  • Dry-run safety on every write — nothing is submitted, posted, or sent without an explicit confirm: true.
  • Cross-course planner — one call returns everything due across all courses.
  • Zero-config secrets — the server auto-loads a local .env, so no token ever appears on a command line or in client config.
  • Tested — offline boot check in CI plus a live contract/regression suite.

Tools

ToolDescriptionAccess
canvas_list_coursesActive courses with code, term, and current graderead
canvas_deadlinesEverything due soon across all courses (via the planner)read
canvas_list_assignmentsAssignments in a course with due dates and submission statusread
canvas_get_assignmentFull detail: instructions, rubric, accepted types, your statusread
canvas_get_gradesCourse grade summary, or per-assignment feedback and rubricread
canvas_list_announcementsRecent announcements, all courses or oneread
canvas_get_discussionList discussion topics, or read a full threadread
canvas_find_personResolve a name to a user ID for messagingread
canvas_submit_assignmentSubmit a text entry, URL, or uploaded filewrite
canvas_post_replyReply to a discussion topicwrite
canvas_send_messageSend a Canvas inbox messagewrite

Installation

Requirements: Node.js ≥ 22.

git clone https://github.com/tylergibbs1/canvas-mcp.git
cd canvas-mcp
npm install
npm run build

Configuration

Generate a token in Canvas: Account → Settings → "+ New Access Token". Treat it like a password.

cp .env.example .env   # then set CANVAS_TOKEN
VariableRequiredDescription
CANVAS_BASE_URLyesYour Canvas origin, e.g. https://canvas.okstate.edu (no trailing slash).
CANVAS_TOKENyesA personal access token.

The server reads .env automatically. Real environment variables take precedence, so you may also pass these inline if you prefer.

Usage

Claude Code

The server auto-loads .env, so no secret is needed on the command line:

claude mcp add --scope user canvas -- node /absolute/path/to/canvas-mcp/dist/index.js

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "canvas": {
      "command": "node",
      "args": ["/absolute/path/to/canvas-mcp/dist/index.js"],
      "env": {
        "CANVAS_BASE_URL": "https://your-school.instructure.com",
        "CANVAS_TOKEN": "your_token_here"
      }
    }
  }
}

Any MCP-compatible client works — point it at node dist/index.js with the two environment variables set.

Write safety

Every write tool defaults to a dry run: it validates inputs and returns a preview of exactly what would be sent, but performs no action. You must re-call with confirm: true to actually submit, post, or send. An accidental or hallucinated call cannot change anything in Canvas.

Development

npm run dev       # run from source with tsx
npm run build     # compile TypeScript to dist/
npm test          # offline: boot the server and verify all tools register (no token)
npm run eval      # live: contract/regression suite (requires a token)
npm run inspect   # interactive MCP Inspector (requires a token)

Evaluation

  • eval/eval.mjs (npm run eval) asserts data-independent invariants against the live API — deadline ordering, valid status values, HTML stripping, cross-tool grade consistency, and that every write tool's confirm:false path returns a dry run and never executes.
  • eval/tasks.md provides realistic agent task prompts (happy path, multi-step, write safety, scope boundary) for behavioral evaluation, each with "what good looks like."

Security

  • Tokens are secrets. .env is git-ignored; never commit it. Anyone with your token can act as you in Canvas.
  • Scoped to your account. The server can only do what your Canvas account can do.
  • Revocation. Remove a token anytime in Canvas under Account → Settings → Approved Integrations.
  • Tokens are sent only to your configured CANVAS_BASE_URL over HTTPS.

Contributing

Issues and pull requests are welcome. Please run npm run build and npm test before opening a PR; if you have a Canvas token available, npm run eval is encouraged.

License

MIT © Tyler Gibbs

Ver o original no GitHub

Bom para

Relacionados