Metadata-Version: 2.4
Name: mcp-lmsnex
Version: 0.2.2
Summary: MCP server bridging NEXA agents to LMSNEX (Creator, Manager, Learner domains)
Author-email: banusoppan <banu.soppan@ivedha.com>
License: MIT
Project-URL: Homepage, https://github.com/ivedha-tech/lmsnex-mcp-server
Project-URL: Documentation, https://github.com/ivedha-tech/lmsnex-mcp-server#readme
Project-URL: Repository, https://github.com/ivedha-tech/lmsnex-mcp-server
Project-URL: Issues, https://github.com/ivedha-tech/lmsnex-mcp-server/issues
Keywords: mcp,lmsnex,nexa,model-context-protocol,lms,ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: fastapi>=0.116.1
Requires-Dist: uvicorn>=0.35.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: pypdf>=4.0.0
Requires-Dist: pdfplumber>=0.11.0
Requires-Dist: pymupdf>=1.24.0
Requires-Dist: python-docx>=1.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-pptx>=0.6.21
Requires-Dist: openai>=1.40.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.9.0; extra == "dev"

# lmsnex-mcp-server

MCP bridge between **NEXA** agents and **LMSNEX**, supporting three agent domains:

| Domain | Agent | Capabilities |
|--------|-------|--------------|
| **Creator** | Nexa Course Composer | Ingest materials, draft courses, SME review |
| **Manager** | Nexa Academy Operator | Enrollments, learning paths, reporting, certifications |
| **Learner** | Nexa Learning Companion | Content search with citations, progress, knowledge gaps |

## Architecture

```
┌─────────────┐   MCP    ┌──────────────────┐   REST   ┌──────────┐
│  NEXA Agent │ ◄──────► │  lmsnex-server   │ ◄──────► │  LMSNEX  │
│  (client)   │ stdio/SSE│  (Python)        │  x-api-key│  API     │
└─────────────┘          └──────────────────┘          └──────────┘
```

See [ARCHITECTURE.md](ARCHITECTURE.md) for details and [AGENTS.md](AGENTS.md) for per-agent tool scoping.

## Quick start

### 1. Install

```bash
cd lmsnex-mcp-server
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp app/config.example.py app/config.py
```

### 2. Configure

Set environment variables:

```bash
export LMSNEX_API_BASE_URL="https://your-lmsnex-host/api"
export LMSNEX_API_KEY="your-api-key-here"
```

### 3. Run (stdio)

```bash
python -m app.mcp_server
# or after pip install:
mcp-lmsnex
```

### 4. Run (HTTP — Cloud Run / local)

```bash
./run-http-server-local.sh
# Health: http://localhost:8080/health
# Tools:  GET http://localhost:8080/mcp/tools
```

## NEXA MCP client config (stdio)

```json
{
  "mcpServers": {
    "lmsnex": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "app.mcp_server"],
      "cwd": "/path/to/lmsnex-mcp-server",
      "env": {
        "LMSNEX_API_BASE_URL": "https://your-lmsnex-host/api",
        "LMSNEX_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

## MCP tools

### Creator
- `upload_source_material`, `ingest_source_material`, `create_course_draft`
- `generate_course_modules`, `save_course_modules`
- `save_course_objectives`, `save_course_assessments`
- `submit_course_for_review`, `get_course_draft_status`
- `generate_course_from_article`, `generate_course_from_powerpoint` (text-only PPTX → Moodle)
- `generate_quiz_from_content` (course text → MCQ / T-F / short answer; easy|medium|hard)
- `generate_speaker_notes`, `split_presentation_into_chapters` / `split_master_deck`

### Manager
- `list_users`, `list_cohorts`, `enroll_users`, `assign_learning_path`
- `get_enrollment_report`, `get_completion_report`
- `issue_certification`, `get_certification_status`

### Learner
- `search_course_content` (returns moduleId, title, excerpt citations)
- `get_module_content`, `get_learner_progress`
- `get_recommended_next_steps`, `record_knowledge_gap`

## MCP resources

- `lmsnex://courses/catalog`
- `lmsnex://learning-paths/all`

## Docker

```bash
docker build -t lmsnex-mcp-server .
docker run -p 8080:8080 \
  -e LMSNEX_API_BASE_URL="https://your-lmsnex-host/api" \
  -e LMSNEX_API_KEY="your-api-key-here" \
  lmsnex-mcp-server
```

## Cloud Run

```bash
./deploy-cloudrun-http.sh
```

## Tests

```bash
python test_api.py
python test_mcp_client.py
python test_setup.py
python test_package.py
```

## Project layout

```
lmsnex-mcp-server/
├── app/
│   ├── mcp_server.py          # Stdio MCP server
│   ├── http_mcp_server.py     # HTTP/SSE wrapper
│   ├── config.example.py
│   └── loaders/
│       └── lmsnex_api_loader.py
├── pyproject.toml
├── requirements.txt
├── Dockerfile
├── AGENTS.md
└── ARCHITECTURE.md
```

## License

MIT
