Server data from the Official MCP Registry
Duolingo profile, streak, XP, courses, words and friends; can switch the active course
About
Duolingo profile, streak, XP, courses, words and friends; can switch the active course
Security Report
Valid MCP server (2 strong, 3 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (8/8 approved).
8 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: DUOLINGO_USERNAME
Environment variable: DUOLINGO_JWT
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"duolingo": {
"command": "npx",
"args": [
"-y",
"@udondan/duolingo@3.0.0"
],
"env": {
"DUOLINGO_JWT": "your-duolingo-jwt-here",
"DUOLINGO_USERNAME": "your-duolingo-username-here"
}
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
@udondan/duolingo
[!NOTE] Unofficial community project. Not affiliated with, endorsed or authorized by Duolingo.
A TypeScript package that provides a client library for the Duolingo API, a
command line interface (duolingo) and an
MCP server for LLM agents (e.g. Claude).
Built natively in TypeScript against the unofficial Duolingo REST API — no third-party Duolingo library dependency.
Table of Contents
Getting Your JWT Token
The CLI, the MCP server and the library all require a Duolingo JWT token for authentication.
- Log in to duolingo.com in your browser.
- Open the browser developer console (F12 → Console tab).
- Run:
document.cookie.match(new RegExp('(^| )jwt_token=([^;]+)'))[0].slice(11); - Copy the output — that is your JWT token.
Note: JWT tokens expire. If you get authentication errors, repeat the steps above.
CLI
CLI Installation
npm install -g @udondan/duolingo
duolingo --help
Or run it without installing: npx -y @udondan/duolingo --help.
The CLI and the MCP server are also available as the Docker image
udondan/duolingo (amd64 and
arm64), no Node.js needed. See With Docker.
Credentials
The CLI reads DUOLINGO_USERNAME and DUOLINGO_JWT from the environment. You
can also put them in ~/.config/duolingo/config:
mkdir -p ~/.config/duolingo
cat > ~/.config/duolingo/config <<'EOF'
DUOLINGO_USERNAME=your_username
DUOLINGO_JWT=your_jwt_token
EOF
chmod 0600 ~/.config/duolingo/config
The file is only read when no other user can access it (mode 0600).
Environment variables take precedence over the file.
Commands
Output is JSON by default. Use --format markdown (or -f markdown) for the
same readable text the MCP tools return.
duolingo streak
duolingo --format markdown progress es
duolingo known-words fr --username someone
duolingo leaderboard --unit month
| Command | Description |
|---|---|
user [-u name] | Profile: name, bio, location, followers, languages |
settings | Account settings |
streak [-u name] | Current streak, daily goal and longest streak |
xp | XP earned and lessons completed today |
languages [-u name] | Languages being learned, with abbreviations |
courses [-u name] | All courses, including Math, Chess and Music |
switch-course <abbr> [--from abbr] | Make another language course the active one |
friends | Users the authenticated user follows |
calendar [-u name] | Recent activity of the current course |
leaderboard [--unit week|month] | Friends ranked by XP |
shop | Shop items and prices |
health | Hearts and refill status |
currencies | Gem and lingot balances |
streak-goal | Current streak goal and checkpoints |
language <name> [-u name] | Level, points and streak of a language (e.g. French) |
progress <abbr> | Detailed progress in a language (e.g. fr) |
topics <abbr> [--filter f] [-u name] | Topic names, see below for the filters |
known-words <abbr> [-u name] | Words learned |
learned-skills <abbr> [-u name] | Learned skills in learning order |
voices [abbr] | Text-to-speech voices |
audio-url <word> [abbr] [--voice v] [--no-random] | Pronunciation audio URL |
mcp | Start the MCP server (stdio) |
topics --filter takes known (learned, the default), unknown (not learned
yet), golden (learned and fully mastered) or reviewable (learned, but not
fully mastered).
Errors go to stderr and the CLI exits with code 1.
With Docker
Arguments after the image name are passed to the CLI. -e NAME without a
value takes the variable from your shell:
docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo streak
As an alias, the image behaves like an installed duolingo:
alias duolingo='docker run --rm -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo'
duolingo --format markdown progress es
The config file ~/.config/duolingo/config is not visible inside the
container, so pass the credentials as environment variables.
MCP Server
MCP Installation
The server is listed in the
MCP Registry
as io.github.udondan/duolingo.
Option A — run directly with npx (no install needed):
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt npx -y @udondan/duolingo mcp
Option B — install globally:
npm install -g @udondan/duolingo
DUOLINGO_USERNAME=your_username DUOLINGO_JWT=your_jwt duolingo mcp
Option C — run the Docker image:
docker run --rm -i -e DUOLINGO_USERNAME -e DUOLINGO_JWT udondan/duolingo
Without arguments, the image starts the MCP server. -i keeps stdin open,
which the server uses to talk to the client.
Option D — clone and build from source:
git clone https://github.com/udondan/duolingo.git
cd duolingo
bun install && bun run build
node dist/cli.js mcp
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"duolingo": {
"command": "npx",
"args": ["-y", "@udondan/duolingo", "mcp"],
"env": {
"DUOLINGO_USERNAME": "your_username",
"DUOLINGO_JWT": "your_jwt_token"
}
}
}
}
With Docker instead of npx, the entry looks like this. -e NAME without a
value passes the variable from env to the container:
{
"mcpServers": {
"duolingo": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"DUOLINGO_USERNAME",
"-e",
"DUOLINGO_JWT",
"udondan/duolingo"
],
"env": {
"DUOLINGO_USERNAME": "your_username",
"DUOLINGO_JWT": "your_jwt_token"
}
}
}
}
Claude Code
claude mcp add duolingo -- npx -y @udondan/duolingo mcp
Then set the environment variables before starting Claude Code:
export DUOLINGO_USERNAME="your_username"
export DUOLINGO_JWT="your_jwt_token"
Docker MCP Toolkit
With the Docker MCP Toolkit of Docker Desktop, the server runs as a container behind the MCP Gateway. The gateway starts the container on demand and passes its tools on to the connected clients. The credentials are stored as secrets in Docker Desktop instead of in plain text in the client configuration.
Requires Docker Desktop with the MCP Toolkit enabled.
-
Download the server definition
docker-mcp.ymland add it to a Toolkit profile. The Toolkit only reads such files from its catalogs directory:mkdir -p ~/.docker/mcp/catalogs curl -fsSL https://raw.githubusercontent.com/udondan/duolingo/main/docker-mcp.yml -o ~/.docker/mcp/catalogs/duolingo.yml # new profile "duolingo" ... docker mcp profile create --name duolingo --id duolingo --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml" # ... or add it to an existing profile docker mcp profile server add default --server "file://$HOME/.docker/mcp/catalogs/duolingo.yml"The profile keeps the image at the version it had when it was added. Run
profile server addagain to update. -
Store the credentials as secrets (see Getting Your JWT Token):
docker mcp secret set duolingo.username=your_username docker mcp secret set duolingo.jwt=your_jwt_token -
Connect a client to the profile:
docker mcp client connect claude-desktop --profile duolingodocker mcp client connect --helplists more clients such asclaude-code,cursororvscode. This also works in Docker Desktop under MCP Toolkit.
docker mcp gateway run --profile duolingo --dry-run --verbose checks the setup
without starting a client. The output should end with duolingo: (N tools).
Available Tools
All tools are read-only except duolingo_switch_course, which changes the
active course of your account.
Account
| Tool | Description |
|---|---|
duolingo_get_user_info | Profile: username, name, bio, location, avatar, followers, learning language |
duolingo_get_settings | Notification and account settings |
duolingo_get_streak_info | Current streak, longest streak, daily goal, extended today |
duolingo_get_daily_xp_progress | XP goal, XP earned today, lessons completed today |
duolingo_get_languages | Languages being learned, each with full name and abbreviation |
duolingo_get_courses | All courses including Math, Chess, and Music with XP per course |
duolingo_switch_course | Make another of your language courses the active one (changes the account) |
duolingo_get_friends | Users the authenticated user follows, with total XP |
duolingo_get_calendar | Recent activity calendar for the current course (~last 2 weeks) |
duolingo_get_leaderboard | Authenticated user's friends sorted by XP for week or month |
duolingo_get_shop_items | Full shop catalogue with prices and item types |
duolingo_get_health | Current hearts count, max hearts, refill timing |
duolingo_get_currencies | Gem and lingot balances |
duolingo_get_streak_goal | Current streak goal with upcoming checkpoints |
Language
| Tool | Description |
|---|---|
duolingo_get_language_details | Level, points, streak for a specific language |
duolingo_get_language_progress | Detailed progress: level %, points to next level, fluency |
duolingo_get_topics | Topic names: known, unknown, golden or reviewable |
duolingo_get_known_words | Set of known words for a language |
duolingo_get_learned_skills | Full skill objects sorted by learning order |
duolingo_get_language_voices | Available TTS voice names for a language |
duolingo_get_audio_url | Pronunciation audio URL for a word |
Courses on the learning path no longer fill the legacy skill tree. For the
authenticated user's current course, the topic, skill and word tools read it
from the current API instead: there, a topic is mastered once all its levels
(crowns) are finished, and words come from the Words page. Duolingo only
returns this for the active course; for your other courses the tools say so,
and duolingo_switch_course makes one of them active. Switching changes the
active course in the Duolingo apps too, so the tool is only meant to be used
when you ask for it.
Library
Library Installation
npm install @udondan/duolingo
Quick Start
import { DuolingoClient } from '@udondan/duolingo';
const client = new DuolingoClient('your_username', 'your_jwt_token');
// Get all courses including Math, Chess, and Music
const userData = await client.getUserData();
const userId = userData.id;
const v2 = await client.getUserDataV2(userId);
for (const course of v2.courses) {
console.log(`${course.subject}: ${course.xp} XP`);
}
// Get streak info
const streak = v2.streak;
const longestStreak = v2.streakData.longestStreak?.length;
// Get friends
const friends = await client.getFollowing(userId);
for (const friend of friends) {
console.log(`${friend.username}: ${friend.totalXp} XP`);
}
// Get shop items
const items = await client.getShopItems();
const streakFreeze = items.find((i) => i.id === 'streak_freeze');
// Get hearts
const health = await client.getHealth();
console.log(`Hearts: ${health.hearts}/${health.maxHearts}`);
API Reference
new DuolingoClient(username, jwt)
Creates a new client instance. Results are cached per instance.
const client = new DuolingoClient('your_username', 'your_jwt_token');
User Data
// Legacy API — returns language_data with skills, calendar, etc.
// Required for: language details, topics, known words, learned skills
const userData = await client.getUserData(username?);
// 2023-05-23 API — returns all courses (language + math/chess/music),
// richer streak data, subscriber level, gems, health
const userId = userData.id;
const v2 = await client.getUserDataV2(userId);
// Resolve a username to a numeric user ID
const id = await client.getUserIdByUsername('someuser');
Courses (all subjects)
const v2 = await client.getUserDataV2(userId);
// All courses
v2.courses; // DuolingoCourse[]
// Filter by subject
const langCourses = v2.courses.filter((c) => c.subject === 'language');
const mathCourses = v2.courses.filter((c) => c.subject === 'math');
const chessCourses = v2.courses.filter((c) => c.subject === 'chess');
const musicCourses = v2.courses.filter((c) => c.subject === 'music');
Each course has: id, subject, topic, xp, fromLanguage.
Language courses also have: learningLanguage, title, authorId.
// Make another language course the active one. This changes the account:
// the Duolingo apps continue with that course. Pass the source language
// when you learn the language from more than one.
const course = await client.switchCourse('es'); // DuolingoCourse
await client.switchCourse('fr', 'de');
Daily XP Progress
const progress = await client.getUserDataById(userId, [
'xpGoal',
'xpGains',
'streakData',
]);
// progress.xpGoal — daily XP goal
// progress.xpGains — array of { xp, skillId, time } for recent lessons
// progress.streakData.updatedTimestamp — last streak update
Friends & Social
// People this user follows (= friends)
const following = await client.getFollowing(userId);
// following[0].username, .totalXp, .userScore?.score (weekly XP), .isFollowedBy
// People who follow this user
const followers = await client.getFollowers(userId);
Shop, Health & Currencies
// Full shop catalogue (read-only)
const items = await client.getShopItems();
// items[0].id, .name, .type, .price, .currencyType, .lastUsedDate
// Hearts / health (authenticated user only)
const health = await client.getHealth();
// health.hearts, .maxHearts, .eligibleForFreeRefill, .secondsUntilNextHeartSegment
// Gem and lingot balances (authenticated user only)
const { gems, lingots } = await client.getCurrencies();
Streak Goals
// Current streak goal with checkpoints
const goal = await client.getStreakGoalCurrent();
// goal.hasActiveGoal, goal.streakGoal.lastCompleteGoal, .checkpoints, .nextSelectedGoal
// Available next goal options
const options = await client.getStreakGoalNextOptions();
TTS Audio
// Discover available voices for a language
const voices = await client.getLanguageVoices('es'); // ['beaes', 'juniores', ...]
// Build an audio URL
const url = await client.buildAudioUrl('hola', 'es');
const urlWithVoice = await client.buildAudioUrl('hola', 'es', 'beaes');
Error Handling
import {
DuolingoClient,
DuolingoAuthError,
DuolingoNotFoundError,
DuolingoCaptchaError,
DuolingoClientError,
} from '@udondan/duolingo';
try {
const data = await client.getUserData('someuser');
} catch (err) {
if (err instanceof DuolingoAuthError) {
// JWT expired — extract a new one from the browser
} else if (err instanceof DuolingoNotFoundError) {
// User does not exist
} else if (err instanceof DuolingoCaptchaError) {
// Duolingo blocked the request — try again later
} else if (err instanceof DuolingoClientError) {
// Other API error
}
}
Development
Setup, tests, the rules for MCP tools and commits are described in CONTRIBUTING.md.
Project Structure
src/
├── index.ts # Library entry point — exports client, types, errors
├── cli.ts # `duolingo` binary
├── mcp.ts # MCP server (stdio transport), started by `duolingo mcp`
├── version.ts # Package version
├── cli/
│ ├── program.ts # CLI commands (commander)
│ └── config-file.ts # ~/.config/duolingo/config loader
├── client/
│ ├── duolingo.ts # DuolingoClient — all API methods
│ ├── courses.ts # Picking the course to switch to
│ ├── tts.ts # TTS voices and audio URLs
│ ├── types.ts # TypeScript interfaces for all API responses
│ └── errors.ts # Custom error classes
├── views/
│ ├── account.ts # Languages, courses, shop, health, currencies
│ ├── language.ts # Language details, progress, topics, words, audio
│ ├── path-course.ts # Courses on the learning path
│ ├── profile.ts # User info and settings
│ ├── progress.ts # Streak, daily XP, streak goal, calendar
│ ├── social.ts # Friends and leaderboard
│ └── view.ts # View type and rendering
└── tools/
├── account.ts # Account tools
├── language.ts # Language tools
└── helpers.ts # Shared utilities (error handling, Zod schemas)
API Versions Used
| Endpoint | API Version | Used For |
|---|---|---|
/users/<username> | Legacy | User profile, language data, skills, calendar |
/2023-05-23/users/{id} | Current | Courses (all subjects), streak, health, gems |
PATCH /2023-05-23/users/{id} | Current | Switching the active course |
/2023-05-23/friends/users/{id}/following | Current | Friends, leaderboard |
/2023-05-23/shop-items | Current | Shop catalogue |
/users/{id}/streak-goal-current | Current | Streak goals |
/2017-06-30/sessions | Current | TTS voice discovery |
Security and contributing
Please report vulnerabilities privately as described in SECURITY.md, not in a public issue. To contribute, see CONTRIBUTING.md.
License
MIT — see LICENSE
Disclaimer
This is an unofficial, independent open-source project and is not affiliated with Duolingo, Inc. Duolingo is a trademark of Duolingo, Inc. The name is used only to describe compatibility. The API used is not public and may change at any time. Use at your own risk and in accordance with the Duolingo Terms and Conditions.
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
