Skip to main content
Glama
Top Academy MCP Server

Top Academy MCP Server

by egoistsar
README.md
# Top Academy MCP Server

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![MCP Compatible](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)

Connect this server to your AI agent and ask it to find an IT course — right in the chat, no browser needed.

Works with **Claude Desktop**, **Cursor**, **Windsurf**, **Cline** and any MCP-compatible client.

---

## Tools

| Tool | Description |
| ---- | ----------- |
| `find_course` | Find courses by description: "want to become a designer", "Python from scratch" |
| `check_enrollment` | Check enrollment status: open now / in 1 month / on request |
| `list_directions` | List all directions: programming, design, marketing, etc. |

**116 IT courses** from [top-academy.ru](https://online.top-academy.ru), updated nightly.

---

## Quick Start (Claude Desktop / Cursor)

### 1. Clone and install

```bash
git clone https://github.com/top-academy/top-academy-mcp.git
cd top-academy-mcp
pip install -r requirements.txt
```

### 2. Add to Claude Desktop

Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "academy-top": {
      "command": "python3",
      "args": ["/absolute/path/to/top-academy-mcp/server.py"]
    }
  }
}
```

Restart Claude Desktop. The MCP tools icon will appear in the bottom-left corner.

### 3. Add to Cursor

Settings → MCP → Add Server:

```json
{
  "command": "python3",
  "args": ["/absolute/path/to/top-academy-mcp/server.py"]
}
```

---

## Use Public Server (HTTP)

A ready-to-use server is hosted at `https://mcp.top-academy.ru`.

Request an API key: [online.top-academy.ru](https://online.top-academy.ru)

**Claude Desktop:**

```json
{
  "mcpServers": {
    "academy-top": {
      "url": "https://mcp.top-academy.ru/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

**Cursor (HTTP mode):**

```json
{
  "url": "https://mcp.top-academy.ru/mcp",
  "headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
```

---

## Example Prompts

```text
I want to learn Python from scratch. How much does it cost and when can I start?
```

```text
Show all directions with enrollment open right now
```

```text
Is there a cybersecurity course? When is the next group?
```

---

## Self-Host on VPS

### Requirements

| Parameter | Minimum | Recommended |
| --------- | ------- | ----------- |
| CPU | 1 vCPU | 2–4 vCPU |
| RAM | 512 MB | 2 GB |
| OS | Ubuntu 22.04 | Ubuntu 22.04 |
| Python | 3.10+ | 3.11+ |

### Deploy

```bash
git clone https://github.com/top-academy/top-academy-mcp.git /opt/top-academy-mcp
cd /opt/top-academy-mcp
pip3 install -r requirements.txt

# Generate API key
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
```

### Run

```bash
API_KEY=your_key MODE=http python3 server.py
# or with multiple workers:
API_KEY=your_key uvicorn server:http_app --host 0.0.0.0 --port 8000 --workers 4
```

Check health:

```bash
curl http://localhost:8000/health
# {"status": "ok", "courses": 116}
```

### Systemd (auto-start after reboot)

Create `/etc/systemd/system/top-academy-mcp.service`:

```ini
[Unit]
Description=Top Academy MCP Server
After=network.target

[Service]
User=ubuntu
WorkingDirectory=/opt/top-academy-mcp
Environment="API_KEY=your_key"
ExecStart=uvicorn server:http_app --host 127.0.0.1 --port 8000 --workers 4
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
```

```bash
sudo systemctl daemon-reload
sudo systemctl enable top-academy-mcp
sudo systemctl start top-academy-mcp
```

### Nginx + SSL (recommended)

```nginx
server {
    listen 443 ssl;
    server_name mcp.your-domain.ru;

    ssl_certificate /etc/letsencrypt/live/mcp.your-domain.ru/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mcp.your-domain.ru/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
```

Get free SSL with certbot:

```bash
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d mcp.your-domain.ru
```

### Nightly Data Update (cron)

```bash
# Add to crontab (crontab -e):
0 3 * * * /opt/top-academy-mcp/update_data.sh >> /var/log/top-academy-mcp-update.log 2>&1
```

`update_data.sh` is included in the repo — it scrapes the course catalog and restarts the server.

---

## GitHub Actions (auto-deploy on push)

Create `.github/workflows/deploy.yml`:

```yaml
name: Deploy
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to VPS
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.VPS_HOST }}
          username: ${{ secrets.VPS_USER }}
          key: ${{ secrets.VPS_SSH_KEY }}
          script: |
            cd /opt/top-academy-mcp
            git pull
            systemctl restart top-academy-mcp
```

---

## Links

- Website: [online.top-academy.ru](https://online.top-academy.ru)
- All course links include UTM parameters for analytics tracking

---

## MCP-сервер Академии ТОП (на русском)

Подключи этот сервер к своему AI-агенту и попроси его подобрать онлайн-курс — прямо в диалоге, без браузера.

## Что умеет сервер

| Инструмент | Что делает |
| ----------- | ----------- |
| `find_course` | Подбирает курсы по описанию: «хочу стать дизайнером», «Python с нуля» |
| `check_enrollment` | Проверяет статус записи: открыта сейчас / через 1 мес / по заявке |
| `list_directions` | Показывает все направления: программирование, дизайн, маркетинг и др. |

## Режим 1: Локальный запуск (stdio) — для Claude Desktop / Cursor

### 1. Установи зависимости

```bash
python3 -m pip install -r requirements.txt
```

### 2. Подключи к Claude Desktop

Открой или создай файл:

```text
~/Library/Application Support/Claude/claude_desktop_config.json
```

Добавь секцию `mcpServers`:

```json
{
  "mcpServers": {
    "academy-top": {
      "command": "python3",
      "args": ["/ABSOLUTE/PATH/TO/top-academy-mcp/server.py"]
    }
  }
}
```

### 3. Перезапусти Claude Desktop

После изменения конфига нужно полностью закрыть и открыть Claude Desktop.
В левом нижнем углу появится иконка MCP-инструментов.

## Режим 2: HTTP-сервер (деплой на VPS)

Смотри английскую секцию выше — всё детально описано там.

Быстрый запуск:

```bash
API_KEY=ваш_ключ MODE=http python3 server.py
```

Подключение клиентов:

```json
{
  "mcpServers": {
    "academy-top": {
      "url": "https://mcp.top-academy.ru/mcp",
      "headers": {
        "Authorization": "Bearer ваш_ключ"
      }
    }
  }
}
```

## Примеры запросов

```text
Хочу освоить Python с нуля. Сколько стоит и когда можно начать?
```

```text
Покажи все направления с открытым набором прямо сейчас
```

```text
Есть ли курс по кибербезопасности? Когда ближайшая группа?
```

## Обновление данных о курсах

Данные хранятся в `data/courses_enriched.json`.
Чтобы обновить (после изменения каталога):

```bash
python3 update_data.sh
# или вручную:
python3 /path/to/scrape_courses.py
```

После обновления файла перезапустить сервер — данные загружаются при старте.

## Ссылки

- Сайт Академии ТОП: [online.top-academy.ru](https://online.top-academy.ru)
- Все ссылки из сервера содержат UTM-метку для отслеживания переходов в Яндекс Метрике