Udemy MCP Server
by uzairasif98
README.md
# š Udemy MCP Server (Python)
A **Model Context Protocol (MCP)** server that connects AI assistants ā such as Claude Desktop, Antigravity, Cursor, and others ā to the **Udemy** platform.
With your regular Udemy account you get access to both **public features** (searching courses, viewing curricula, reading reviews) **and private features** (your enrolled courses and profile info).
---
## ⨠Features
- š **Search courses** ā by keyword, category, price, level, language, and more
- š **View course details** ā descriptions, learning goals, prerequisites, ratings
- š **Browse curricula** ā lecture outlines, durations, and free preview flags
- ā **Read reviews** ā student ratings and written feedback
- š·ļø **List categories** ā discover all top-level Udemy categories
- š¤ **View your profile** ā display name, title, and avatar
- š¦ **List enrolled courses** ā see everything you're currently learning
---
## š Project Structure
```
UdemyMcpPython/
āāā main.py # Entry point ā starts the MCP server
āāā requirements.txt # Python dependencies
āāā .env.example # Template for environment variables
āāā .gitignore
āāā README.md
āāā src/
āāā __init__.py # Package marker
āāā server.py # MCP tool definitions (7 tools)
āāā client.py # Async Udemy API client (httpx)
```
---
## š Getting Started
### Prerequisites
- **Python 3.10+**
- A **Udemy account** (free or paid)
### 1. Clone the repository
```bash
git clone https://github.com/<your-username>/UdemyMcpPython.git
cd UdemyMcpPython
```
### 2. Create a virtual environment & install dependencies
```bash
python -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
pip install -r requirements.txt
```
### 3. Configure environment variables
```bash
cp .env.example .env
```
Open `.env` and fill in your credentials (see [Authentication](#-authentication) below).
### 4. Run the server
```bash
python main.py
```
---
## š Authentication
The server supports **two authentication methods**. You only need to set up one.
### Method 1: Access Token (ā Recommended)
Use the session cookie from your regular Udemy login ā gives access to **all** tools including private ones.
1. Log into [udemy.com](https://www.udemy.com) in your browser.
2. Open **Developer Tools** (`F12` or `Cmd + Option + I` on Mac / `Ctrl + Shift + I` on Windows).
3. Navigate to **Application** ā **Cookies** ā `https://www.udemy.com` (in Firefox: **Storage** ā **Cookies**).
4. Find the cookie named **`access_token`** and copy its value.
5. Paste it into your `.env` file:
```env
UDEMY_ACCESS_TOKEN=your_access_token_here
```
### Method 2: API Client Credentials
If you have Udemy Developer / Affiliate API keys:
1. Go to [Udemy API Clients](https://www.udemy.com/user/edit-api-clients/).
2. Copy your **Client ID** and **Client Secret**.
3. Add them to `.env`:
```env
UDEMY_CLIENT_ID=your_client_id
UDEMY_CLIENT_SECRET=your_client_secret
```
> [!NOTE]
> API Client credentials provide access to public endpoints only (course search, details, curriculum, reviews, categories). Private endpoints (profile, enrolled courses) require Method 1.
---
## š ļø Available MCP Tools
| Tool | Description | Auth Required |
| :--- | :--- | :---: |
| `get_my_profile` | Fetch profile details of the logged-in user | ā
Access Token |
| `get_my_enrolled_courses` | List courses you are enrolled in (with completion %) | ā
Access Token |
| `search_udemy_courses` | Search courses with rich filters (category, price, rating, level, language, ordering) | ā |
| `get_udemy_course_details` | Get course overview, prerequisites, learning goals, instructors, and subscriber count | ā |
| `get_udemy_course_curriculum` | View lecture outline, content durations, and free preview availability | ā |
| `get_udemy_course_reviews` | Read student ratings and review comments (filterable by star rating) | ā |
| `list_udemy_categories` | List all top-level course categories on Udemy | ā |
---
## āļø MCP Client Configuration
Add the following to your MCP client's configuration file (`mcp_config.json`, `claude_desktop_config.json`, etc.):
```json
{
"mcpServers": {
"udemy": {
"command": "/absolute/path/to/UdemyMcpPython/.venv/bin/python",
"args": ["/absolute/path/to/UdemyMcpPython/main.py"],
"env": {
"UDEMY_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN_HERE"
}
}
}
}
```
> [!TIP]
> Replace `/absolute/path/to/UdemyMcpPython` with the actual path where you cloned the project. On Windows, use the `.venv\Scripts\python.exe` path instead.
---
## š§° Tech Stack
| Component | Technology |
| :--- | :--- |
| Language | Python 3.10+ |
| MCP Framework | [`mcp[cli]`](https://pypi.org/project/mcp/) ā„ 1.2.0 |
| HTTP Client | [`httpx`](https://www.python-httpx.org/) ā„ 0.27.0 |
| Config | [`python-dotenv`](https://pypi.org/project/python-dotenv/) ā„ 1.0.0 |
| Validation | [`pydantic`](https://docs.pydantic.dev/) ā„ 2.0.0 |
---
## š License
This project is open-source. Feel free to use and modify it for your own purposes.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues