Skip to main content
Glama
MCP Learning Server

MCP Learning Server

README.md
# MCP Learning Server

[![CI](https://github.com/shastripranav/mcp-learning-server/actions/workflows/ci.yml/badge.svg)](https://github.com/shastripranav/mcp-learning-server/actions/workflows/ci.yml)

MCP server connecting MCP clients to SCORM packages, xAPI analytics, and enterprise course catalogs.

The MCP ecosystem has servers for databases, CRMs, and DevOps — but enterprise learning platforms remain unrepresented. This server fills that gap by exposing SCORM package management, xAPI learning analytics, and course catalog operations through the [Model Context Protocol](https://modelcontextprotocol.io/).

## Features

- **13 MCP Tools** across three domains: SCORM, xAPI analytics, and course management
- **4 MCP Resources** for direct data access by MCP clients
- **SCORM 1.2 + 2004** package parsing with full namespace handling
- **xAPI analytics** — learner progress, completion rates, skill gaps, activity summaries
- **Course catalog** with 25 seeded courses, search, filtering, and recommendations
- **Dual transport** — stdio (Claude Desktop) and streamable-http (remote)

## Quick Start

### Install

```bash
cd mcp-learning-server
pip install -e .
```

### Run (stdio — for Claude Desktop)

```bash
python -m mcp_learning_server
```

### Run (HTTP — for remote access)

```bash
MCP_TRANSPORT=streamable-http MCP_SERVER_PORT=8080 python -m mcp_learning_server
```

### Claude Desktop Configuration

Add to your Claude Desktop MCP config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "learning": {
      "command": "python",
      "args": ["-m", "mcp_learning_server"],
      "env": {
        "MCP_LRS_ENDPOINT": "http://localhost:8080/xapi/",
        "MCP_LRS_USERNAME": "your-key",
        "MCP_LRS_PASSWORD": "your-secret"
      }
    }
  }
}
```

## Architecture

```mermaid
flowchart TB
    subgraph Clients["MCP Clients"]
        Claude[Claude Desktop]
        OtherStdio[Other stdio clients]
        HTTPClient[HTTP / web clients]
    end

    Claude -->|stdio| Server
    OtherStdio -->|stdio| Server
    HTTPClient -->|streamable-http| Server

    Server[MCP Learning Server]

    Server --> SCORM[SCORM Tools<br/>parse, metadata, list SCOs, launch URL]
    Server --> XAPI[xAPI Analytics<br/>statements, progress, completion, skill gaps, activity]
    Server --> Catalog[Course Catalog<br/>list, details, search, recommend]
    Server --> Resources[MCP Resources<br/>4 read-only resources]

    SCORM --> Packages[(SCORM zip<br/>packages)]
    XAPI --> Store[(xAPI LRS<br/>external, via httpx)]
    Catalog --> CourseDB[(Course catalog<br/>SQLite, 25 seeded courses)]

    classDef tool fill:#eef,stroke:#447,stroke-width:1px
    class SCORM,XAPI,Catalog,Resources tool
```

```
┌──────────────────────────────────────────────────┐
│                    MCP Client                     │
│                        │                          │
│                   MCP Protocol                    │
└────────────────────────┬─────────────────────────┘
                         │
┌────────────────────────┴─────────────────────────┐
│            Enterprise Learning Server             │
│                                                   │
│  ┌─────────────┐ ┌──────────────┐ ┌───────────┐  │
│  │ SCORM Tools │ │  xAPI Tools  │ │Course Tools│  │
│  │  (4 tools)  │ │  (5 tools)   │ │ (4 tools)  │  │
│  └──────┬──────┘ └──────┬───────┘ └─────┬─────┘  │
│         │               │               │         │
│  ┌──────┴──────┐ ┌──────┴───────┐ ┌─────┴─────┐  │
│  │SCORM Parser │ │  LRS Client  │ │Course Store│  │
│  │  (lxml)     │ │  (httpx)     │ │ (SQLite)   │  │
│  └─────────────┘ └──────────────┘ └───────────┘  │
│         │               │               │         │
│    SCORM Zips      xAPI LRS        SQLite DB      │
└───────────────────────────────────────────────────┘
```

## Tool Reference

### SCORM Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| `scorm_parse_package` | Parse a SCORM 1.2/2004 zip and extract full structure | `package_path` |
| `scorm_get_metadata` | Get title, version, SCO count from manifest | `package_path` |
| `scorm_list_scos` | List all SCOs with titles and sequencing | `package_path` |
| `scorm_get_launch_url` | Get launch URL for a specific SCO | `package_path`, `sco_id` |

### xAPI Analytics Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| `xapi_get_statements` | Query xAPI statements with filters | `agent_email`, `verb?`, `activity_id?`, `since?`, `limit?` |
| `xapi_get_learner_progress` | Aggregated progress summary | `agent_email`, `course_id?` |
| `xapi_get_completion_rates` | Completion rates by course or learner | `activity_id?`, `group_by?` |
| `xapi_get_skill_gaps` | Identify below-threshold skills | `agent_email`, `threshold?` |
| `xapi_summarize_activity` | Natural language activity summary | `agent_email`, `days?` |

### Course Management Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| `course_list` | List courses with filtering | `status?`, `domain?`, `search?` |
| `course_get_details` | Full course details with modules | `course_id` |
| `course_search` | Keyword search ranked by relevance | `query`, `limit?` |
| `course_recommend` | Personalized recommendations | `agent_email`, `count?` |

### MCP Resources

| URI | Description |
|-----|-------------|
| `learning://courses` | Full course catalog |
| `learning://learner/{email}/profile` | Learner profile with history |
| `learning://learner/{email}/progress` | Current progress across courses |
| `learning://analytics/completion-rates` | Org-wide completion data |

## Configuration

| Environment Variable | Default | Description |
|---------------------|---------|-------------|
| `MCP_LRS_ENDPOINT` | *(empty)* | xAPI LRS URL |
| `MCP_LRS_USERNAME` | *(empty)* | LRS Basic Auth key |
| `MCP_LRS_PASSWORD` | *(empty)* | LRS Basic Auth secret |
| `MCP_SCORM_STORAGE_PATH` | `./scorm_packages` | SCORM package directory |
| `MCP_COURSE_DB_PATH` | `./data/courses.db` | SQLite database path |
| `MCP_TRANSPORT` | `stdio` | Transport: `stdio` or `streamable-http` |
| `MCP_SERVER_HOST` | `0.0.0.0` | HTTP server host |
| `MCP_SERVER_PORT` | `8080` | HTTP server port |

The xAPI tools gracefully degrade when no LRS is configured — they return helpful error messages instead of crashing.

## Development

```bash
# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Lint
ruff check src/ tests/
```

## Course Catalog

The server seeds 25 courses across 5 domains on first run:

- **Technical** (5) — Python, Cloud, Docker/K8s, API Design, Microservices
- **Compliance** (5) — GDPR, InfoSec, Harassment Prevention, Ethics, SOX
- **Leadership** (5) — New Manager, Strategy, Conflict Resolution, Executive Presence, Coaching
- **Product** (5) — PM Foundations, Agile/Scrum, UX Design, A/B Testing, Growth Metrics
- **Data Science** (5) — SQL Analytics, Machine Learning, Data Viz, Deep Learning, NLP

## License

MIT