logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

LMSDataBridge-ContextAdapter

Facilitates secure, granular interaction with Learning Management System (LMS) environments, specifically supporting Canvas instances (both standard and AWS-hosted). Provides standardized API access for data retrieval, including course structures, assessment details, discussion threads, and advanced capabilities like PDF content parsing.

Author

LMSDataBridge-ContextAdapter logo

PewterZz

No License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

canvaslmscanvascloudcanvas lmspewterzz canvaslmscanvas instances

Learning Management System Data Bridge Context Adapter

This specialized server acts as a sophisticated intermediary layer, translating high-level requests into specific LMS API calls. It is engineered to interface cleanly with frameworks like Smithery, employing a progressive authorization strategy.

Progressive Credential Handover (Lazy Authorization)

Adhering to best practices for initial discovery and subsequent secure operation, this adapter implements 'lazy loading' for sensitive access details, aligning with Smithery's recommended protocol:

  1. Service Enumeration (Public Access): The catalog endpoint (/catalog/instruments) permits immediate querying of available functions without requiring any bearer token or user credentials. This is crucial for automated system introspection.

  2. Function Invocation (Protected Access): Credentials (API keys, domain identifiers) are strictly mandated only at the moment a specific data operation is executed via the payload.

This methodology yields three principal advantages:

  • Seamless Discovery: Client applications (like Smithery) can immediately visualize the data retrieval options.
  • Robust Security Posture: Access to sensitive user or institutional data is gated until the final execution step.
  • Credential Minimization: Sensitive configuration parameters are only transmitted when actively interacting with protected resources.

Network Interface Definitions

Queryable Endpoints (No Pre-authentication Needed)

  • GET /catalog/instruments: Retrieves the complete manifest of exposed data manipulation functions.
  • GET /catalog/instruments/{identifier}: Fetches the schema and metadata for a solitary specified function.

Executable Endpoints (Authentication Required in Payload)

  • POST /execute/{identifier}: Initiates the execution of a chosen function, requiring authentication details within the request body.

Execution Payload Structure

The data required to secure the connection and parameters for the operation must be structured as follows:

{ "operational_params": { "param_A": "input_A", "param_B": "input_B" }, "security_context": { "auth_token": "your-canvas-api-key", "lms_host": "your-canvas-domain.instructure.com" } }

Operational Results Schema

Successful Return

{ "status": "completed", "payload": { // Data specific to the executed function } }

Failure Return

{ "status": "error", "reason": "Descriptive error summary" }

Registered Data Functions

  1. Fetch Institutional Enrollments

    • ID: retrieve-enrollments
    • Synopsis: Queries the LMS roster to list active courses.
    • Arguments:
      • query_limit (Optional): Cap on the quantity of returned course records.
  2. Access Assessment Items

    • ID: lookup-assessments
    • Synopsis: Retrieves a catalogue of assignments pertaining to a specified course context.
    • Arguments:
      • course_ref_id (Mandatory): The unique identifier mapping to the target course.

Deployment & Build Process

  1. Resolve dependencies: npm install
  2. Compile source artifacts: npm run build
  3. Launch service process: npm start

Containerization Blueprint

Instructions for deployment via containerization:

bash docker build -t lms-data-bridge . docker run -p 8080:8080 lms-data-bridge

LMS Data Bridge Service

smithery integration status

This backend proxy is engineered to abstract and pre-process data originating from various Learning Management System (LMS) endpoints, specifically targeting Canvas environments. The resultant information stream is optimized for ingestion by Large Language Models (LLMs) or sophisticated analytical engines.

It encompasses features for pulling course hierarchies, detailed assessment metadata (including attached resource manifest links), discussion artifacts, and the capability to perform optical character recognition (OCR) style extraction from embedded PDF documents hosted within the LMS.

Initialization Procedure

  1. Repository Acquisition (If Necessary): bash git clone cd LMSDataBridge

  2. Dependency Resolution: bash npm install

  3. Configuration File Setup: Establish a .env file in the root directory, populating it with requisite secrets:

    env

    Primary LMS Endpoint

    PRIMARY_LMS_URL=https://primary.canvas-instance.instructure.com PRIMARY_AUTH_SECRET=primary_api_key_secret

    Secondary/AWS Hosted LMS Endpoint

    AWS_LMS_URL=https://aws.canvas-instance.instructure.com AWS_AUTH_SECRET=aws_api_key_secret

    Listener Port (Default: 3000)

    SERVICE_PORT=8080

  4. Service Activation:

    • Development Mode (Hot Reloading): npm run dev
    • Production Mode: npm start

The service will become accessible at http://localhost:SERVICE_PORT (e.g., http://localhost:8080).

API Functionality Map

All operations assume that the necessary configuration resides in the .env file.

Liveness Probe

  • GET /status

    • Purpose: Verifies active service operation.
    • Test Call: bash curl http://localhost:8080/status

    • Positive Acknowledgment: Data Bridge Adapter Operational. (MIME Type: text/plain)

Primary LMS Interface (/api/primary/)

Leverages PRIMARY_LMS_URL and PRIMARY_AUTH_SECRET.

  • GET /api/primary/courses/{courseId}

    • Synopsis: Retrieve comprehensive details for a single course.
  • GET /api/primary/courses/{courseId}/assessments

    • Synopsis: Obtain the collection of assessments associated with the specified course context.
  • GET /api/primary/assessments/{courseId}/{assessmentId}

    • Synopsis: Detailed retrieval of a singular assessment item.
  • GET /api/primary/assessments/{courseId}/{assessmentId}/content-manifest

    • Synopsis: Fetches the assignment body text alongside a structured list of resolved links to embedded files.
  • GET /api/primary/discussions/{courseId}/{topicId}

    • Synopsis: Retrieve the full content and metadata for a specified discussion thread.

Document Processing Utilities (/api/process/pdf/)

Utilizes Primary LMS credentials for file acquisition.

  • POST /api/process/pdf/ingest-text

    • Synopsis: Downloads a file based on its internal Canvas File ID and performs text stream extraction.
    • Input Format: application/json

      { "file_reference": 44827106 }

    • Success Output Example:

      { "extracted_stream": "Text content flows here... Page break..." }

    • Failure Modes: Errors cover invalid file ID reference (400), authentication failure (401), or PDF parsing exceptions (500).

Federated LMS Interface (/api/aws/)

These endpoints mirror the Primary Interface functions but route requests through AWS_LMS_URL using AWS_AUTH_SECRET. They are designed to handle federated or secondary Canvas deployments.

  • GET /api/aws/courses/{courseId}
  • GET /api/aws/assessments/{courseId}/{assessmentId}/content-manifest (Note: File download URIs in the response will correctly point to the AWS host)

Exception Management

The adapter employs centralized error interception. Failures are generally encapsulated in a structured JSON object designed for machine readability:

{ "error_state": { "code": "INTERNAL_EXCEPTION_XYZ", "detail": "Detailed explanation of the failure cause and path..." } }

Developers should consult the running service's standard output for full stack traces.

WIKIPEDIA: Cloud computing is defined by the International Organization for Standardization (ISO) as a model enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.

== Essential Attributes == The NIST model, a foundational definition, outlines five core tenets for a genuine cloud service offering:

  • Self-Service Provisioning: Consumers procure computational assets (e.g., virtual machines, storage volume) automatically without human intervention from the vendor.
  • Extensive Network Availability: Resources are accessible via standard communication protocols usable across diverse client architectures (mobile, desktop, thin clients).
  • Shared Resource Infrastructure: The provider allocates its physical and logical assets among multiple clients using a multi-tenant paradigm, dynamically shifting capacity based on load.
  • Elastic Scalability: The system can dynamically expand or contract its capacity quickly, often automatically, to match fluctuating user demand, giving the illusion of infinite availability.
  • Usage Metering: Resource consumption (compute cycles, I/O, bandwidth) is continuously monitored and reported, ensuring transparency for both provider and consumer.

== Chronology == Conceptual roots trace back to the 1960s with the development of mainframe time-sharing operating systems. The term 'cloud' itself, used metaphorically for interconnected service spaces, emerged in telecommunications contexts before being popularized in computing contexts around 1994 by firms exploring agent-based systems, solidifying into 'cloud computing' as a business concept in the mid-1990s.

See Also

`